bigbluebutton-Github/bigbluebutton-html5/tests/puppeteer/screenshare/util.js

22 lines
673 B
JavaScript
Raw Normal View History

2020-03-12 21:50:54 +08:00
const e = require('../core/elements');
async function startScreenshare(test) {
await test.waitForSelector(e.screenShare);
await test.click(e.screenShare, true);
}
async function getTestElement(element) {
(await document.querySelectorAll(element)[0]) !== null;
}
async function getScreenShareContainer(test) {
await test.waitForSelector(e.screenShareVideo);
const screenShareContainer = await test.evaluate(getTestElement, e.screenShareVideo);
2020-03-12 21:50:54 +08:00
const response = screenShareContainer !== null;
return response;
}
exports.getScreenShareContainer = getScreenShareContainer;
exports.getTestElement = getTestElement;
exports.startScreenshare = startScreenshare;