bigbluebutton-Github/bigbluebutton-tests/playwright/screenshare/screenshare.js
Gabriel Luiz Porfirio aa57d4528b
test: Add message to the test expect (#20718)
* first steps

* few messages added

* added more messages to the failed tests

* layouts,notifications

* more messages to help

* adding messages to the upload other presentations format

* messages for upload multiple presentation test

* added most of the expect messages

* updates for merging

* fixed broken tests
2024-07-30 18:49:02 -04:00

75 lines
2.6 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, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
await startScreenshare(this);
await this.hasElement(e.isSharingScreen, 'should display the screenshare element');
}
async testMobileDevice() {
await this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
async screenshareStopsExternalVideo() {
const { screensharingEnabled } = getSettings();
await this.waitForSelector(e.whiteboard);
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the screenshare button');
}
await this.waitAndClick(e.actions);
await this.waitAndClick(e.shareExternalVideoBtn);
await this.waitForSelector(e.closeModal);
await this.type(e.videoModalInput, e.youtubeLink);
await this.waitAndClick(e.startShareVideoBtn);
const modFrame = await this.getYoutubeFrame();
await modFrame.hasElement('video', 'should display the video frame');
await startScreenshare(this);
await this.hasElement(e.isSharingScreen, 'should display the screenshare element');
await this.hasElement(e.stopScreenSharing, 'should display the stop screenshare button');
await this.waitAndClick(e.stopScreenSharing);
await this.hasElement(e.whiteboard, 'should display the whiteboard');
}
}
class MultiUserScreenShare extends MultiUsers {
constructor(browser, context) {
super(browser, context);
}
async startSharing(page) {
const { screensharingEnabled } = getSettings();
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
await startScreenshare(page);
await page.hasElement(e.isSharingScreen, 'should display the screenshare element');
}
}
exports.ScreenShare = ScreenShare;
exports.MultiUserScreenShare = MultiUserScreenShare;