bigbluebutton-Github/bigbluebutton-tests/playwright/screenshare/screenshare.js
Gabriel Porfirio fc4df4ea5b removing await
2023-11-16 09:00:22 -03:00

48 lines
1.2 KiB
JavaScript

const { default: test } = require('@playwright/test');
const Page = require('../core/page');
const { MultiUsers } = require('../user/multiusers');
const { startScreenshare } = require('./util');
const e = require('../core/elements');
const { getSettings } = require('../core/settings');
class ScreenShare extends Page {
constructor(browser, page) {
super(browser, page);
}
async startSharing() {
const { screensharingEnabled } = getSettings();
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo);
return this.wasRemoved(e.startScreenSharing);
}
await startScreenshare(this);
await this.hasElement(e.isSharingScreen);
}
async testMobileDevice() {
await this.wasRemoved(e.startScreenSharing);
}
}
class MultiUserScreenShare extends MultiUsers {
constructor(browser, context) {
super(browser, context);
}
async startSharing(page) {
const { screensharingEnabled } = getSettings();
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo);
return this.wasRemoved(e.startScreenSharing);
}
await startScreenshare(page);
await page.hasElement(e.isSharingScreen);
}
}
exports.ScreenShare = ScreenShare;
exports.MultiUserScreenShare = MultiUserScreenShare;