2021-02-17 04:57:10 +08:00
|
|
|
const { ELEMENT_WAIT_TIME, VIDEO_LOADING_WAIT_TIME } = require('../core/constants');
|
2020-03-12 21:50:54 +08:00
|
|
|
const e = require('../core/elements');
|
2021-08-21 04:33:57 +08:00
|
|
|
const { checkElement } = require('../core/util');
|
2020-03-12 21:50:54 +08:00
|
|
|
|
|
|
|
async function startScreenshare(test) {
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(e.screenShare, ELEMENT_WAIT_TIME);
|
2020-03-12 21:50:54 +08:00
|
|
|
await test.click(e.screenShare, true);
|
|
|
|
}
|
|
|
|
|
2021-03-31 21:10:57 +08:00
|
|
|
async function waitForScreenshareContainer(test) {
|
|
|
|
await test.waitForSelector(e.screenshareConnecting, ELEMENT_WAIT_TIME);
|
|
|
|
await test.waitForSelector(e.screenShareVideo, VIDEO_LOADING_WAIT_TIME);
|
|
|
|
}
|
|
|
|
|
2020-03-12 21:50:54 +08:00
|
|
|
async function getScreenShareContainer(test) {
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(e.screenShareVideo, VIDEO_LOADING_WAIT_TIME);
|
2021-08-26 03:31:54 +08:00
|
|
|
return test.page.evaluate(checkElement, e.screenShareVideo);
|
2021-02-26 23:52:17 +08:00
|
|
|
}
|
2021-05-26 00:05:11 +08:00
|
|
|
|
2021-02-26 23:52:17 +08:00
|
|
|
async function getScreenShareBreakoutContainer(test) {
|
|
|
|
await test.waitForSelector(e.screenshareConnecting, { timeout: VIDEO_LOADING_WAIT_TIME });
|
|
|
|
await test.waitForSelector(e.screenShareVideo, { timeout: VIDEO_LOADING_WAIT_TIME });
|
2021-08-26 03:31:54 +08:00
|
|
|
return test.evaluate(checkElement, e.screenShareVideo);
|
2020-03-12 21:50:54 +08:00
|
|
|
}
|
|
|
|
|
2021-02-26 23:52:17 +08:00
|
|
|
exports.getScreenShareBreakoutContainer = getScreenShareBreakoutContainer;
|
2020-03-12 21:50:54 +08:00
|
|
|
exports.getScreenShareContainer = getScreenShareContainer;
|
|
|
|
exports.startScreenshare = startScreenshare;
|
2021-03-31 21:10:57 +08:00
|
|
|
exports.waitForScreenshareContainer = waitForScreenshareContainer;
|