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

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-03-12 21:50:54 +08:00
const Page = require('../core/page');
const util = require('./util');
const e = require('../core/elements');
const { VIDEO_LOADING_WAIT_TIME } = require('../core/constants');
2021-08-21 04:33:57 +08:00
const { checkElementLengthEqualTo } = require('../core/util');
2020-03-12 21:50:54 +08:00
class ShareScreen extends Page {
constructor() {
2021-09-23 03:22:47 +08:00
super();
2020-03-12 21:50:54 +08:00
}
async test() {
try {
await util.startScreenshare(this);
await this.waitForSelector(e.screenshareConnecting);
await this.waitForSelector(e.screenShareVideo, VIDEO_LOADING_WAIT_TIME);
const response = await this.hasElement(e.isSharingScreen, true);
return response === true;
2021-08-26 22:13:18 +08:00
} catch (err) {
await this.logger(err);
return false;
}
}
async testMobileDevice(args, testName, deviceX) {
try {
await this.init(args, undefined, undefined, undefined, testName, undefined, deviceX);
await this.startRecording(testName);
await this.closeAudioModal();
2021-09-23 02:55:51 +08:00
const screenshareBtn = await this.wasRemoved(e.startScreenSharing);
return screenshareBtn;
2021-08-26 22:13:18 +08:00
} catch (err) {
await this.logger(err);
return false;
}
2020-03-12 21:50:54 +08:00
}
}
module.exports = exports = ShareScreen;