diff --git a/bigbluebutton-tests/playwright/presentation/presentation.js b/bigbluebutton-tests/playwright/presentation/presentation.js index 83e4fb45ea..ba153b978e 100644 --- a/bigbluebutton-tests/playwright/presentation/presentation.js +++ b/bigbluebutton-tests/playwright/presentation/presentation.js @@ -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) { diff --git a/bigbluebutton-tests/playwright/presentation/presentation.spec.js b/bigbluebutton-tests/playwright/presentation/presentation.spec.js index 005eaf7588..f77a1904f1 100644 --- a/bigbluebutton-tests/playwright/presentation/presentation.spec.js +++ b/bigbluebutton-tests/playwright/presentation/presentation.spec.js @@ -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); diff --git a/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/moderator-share-camera-as-content-Chromium-linux.png b/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/moderator-share-camera-as-content-Chromium-linux.png new file mode 100644 index 0000000000..6b57eaea54 Binary files /dev/null and b/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/moderator-share-camera-as-content-Chromium-linux.png differ diff --git a/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/viewer-share-camera-as-content-Chromium-linux.png b/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/viewer-share-camera-as-content-Chromium-linux.png new file mode 100644 index 0000000000..2a88ad70be Binary files /dev/null and b/bigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/viewer-share-camera-as-content-Chromium-linux.png differ