bigbluebutton-Github/bigbluebutton-tests/puppeteer/notes/util.js

20 lines
714 B
JavaScript
Raw Normal View History

const { ELEMENT_WAIT_TIME, ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
2020-03-25 02:13:51 +08:00
const se = require('./elements');
async function startSharedNotes(test) {
await test.waitForSelector(se.sharedNotes, ELEMENT_WAIT_TIME);
2020-03-25 02:13:51 +08:00
await test.click(se.sharedNotes, true);
await test.waitForSelector(se.hideNoteLabel, ELEMENT_WAIT_LONGER_TIME);
2020-03-25 02:13:51 +08:00
const resp = await test.page.evaluate(getTestElement, se.etherpad);
await test.waitForSelector(se.etherpad, ELEMENT_WAIT_TIME);
2020-03-25 02:13:51 +08:00
return resp;
}
async function getTestElement(element) {
2020-07-21 05:19:24 +08:00
const response = await document.querySelectorAll(element).length >= 1;
2020-03-25 02:13:51 +08:00
return response;
}
exports.getTestElement = getTestElement;
exports.startSharedNotes = startSharedNotes;