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);
|
2020-07-14 03:03:41 +08:00
|
|
|
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;
|