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

20 lines
695 B
JavaScript
Raw Normal View History

const { ELEMENT_WAIT_TIME, ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
const e = require('../core/elements');
2021-08-21 04:33:57 +08:00
const { getElementLength } = require('../core/util');
2020-03-25 02:13:51 +08:00
async function startSharedNotes(test) {
2021-08-20 04:22:31 +08:00
try {
await test.waitForSelector(e.sharedNotes, ELEMENT_WAIT_TIME);
await test.click(e.sharedNotes, true);
await test.waitForSelector(e.hideNoteLabel, ELEMENT_WAIT_LONGER_TIME);
const resp = await test.page.evaluate(getElementLength, e.etherpad) >= 1;
await test.waitForSelector(e.etherpad, ELEMENT_WAIT_TIME);
2021-08-20 04:22:31 +08:00
return resp === true;
} catch (err) {
await test.logger(err);
2021-08-20 04:22:31 +08:00
return false;
}
2020-03-25 02:13:51 +08:00
}
exports.startSharedNotes = startSharedNotes;