test: Backport share camera as content test to 2.7 (#20964)

* backport camera as content test

* add test to ci
This commit is contained in:
Gabriel Luiz Porfirio 2024-08-21 14:56:39 -03:00 committed by GitHub
parent 7a8abd0127
commit f66f07d177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 38 additions and 0 deletions

View File

@ -33,6 +33,38 @@ class Presentation extends MultiUsers {
await checkSvgIndex(this.modPage, '/svg/1');
}
async shareCameraAsContent() {
await this.modPage.hasElement(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.shareCameraAsContent);
await this.modPage.hasElement(e.videoPreview);
await this.modPage.waitAndClick(e.startSharingWebcam);
await this.modPage.hasElement(e.screenshareConnecting);
await this.modPage.wasRemoved(e.screenshareConnecting);
await this.modPage.hasElement(e.screenShareVideo);
// close all notifications displayed before comparing screenshots
for (const closeButton of await this.modPage.getLocator(e.closeToastBtn).all()) {
await closeButton.click();
}
const modWhiteboardLocator = this.modPage.getLocator(e.screenShareVideo);
await expect(modWhiteboardLocator).toHaveScreenshot('moderator-share-camera-as-content.png', {
maxDiffPixels: 1000,
});
await this.userPage.wasRemoved(e.screenshareConnecting);
await this.userPage.hasElement(e.screenShareVideo);
// close all notifications displayed before comparing screenshots
for (const closeButton of await this.userPage.getLocator(e.closeToastBtn).all()) {
await closeButton.click();
}
const viewerWhiteboardLocator = this.userPage.getLocator(e.screenShareVideo);
await expect(viewerWhiteboardLocator).toHaveScreenshot('viewer-share-camera-as-content.png', {
maxDiffPixels: 1000,
});
}
async hideAndRestorePresentation() {
const { presentationHidden } = getSettings();
if (!presentationHidden) {

View File

@ -12,6 +12,12 @@ test.describe.parallel('Presentation', () => {
await presentation.skipSlide();
});
test('Share Camera As Content @ci', async ({ browser, context, page }) => {
const presentation = new Presentation(browser, context);
await presentation.initPages(page);
await presentation.shareCameraAsContent();
});
// https://docs.bigbluebutton.org/2.7/testing/release-testing/#minimizerestore-presentation-automated
test('Hide/Restore presentation @ci', async ({ browser, context, page }) => {
const presentation = new Presentation(browser, context);