Skip to content

Commit

Permalink
test: update layout test snapshots (bigbluebutton#21764)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbsa authored Nov 28, 2024
1 parent 2145c8b commit b436c13
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bigbluebutton-tests/playwright/layouts/layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);

await checkScreenshots(this, 'should be the layout focus on presentation', e.webcamContainer, 'focus-on-presentation');
await checkScreenshots(this, 'should be the layout focus on presentation', [e.webcamContainer, e.webcamMirroredVideoContainer], 'focus-on-presentation');
}

async gridLayout() {
Expand All @@ -22,7 +22,7 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);

await checkScreenshots(this, 'should be the grid layout', e.webcamContainer, 'grid-layout');
await checkScreenshots(this, 'should be the grid layout', [e.webcamContainer, e.webcamMirroredVideoContainer], 'grid-layout');
}

async smartLayout() {
Expand All @@ -33,12 +33,12 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);

await checkScreenshots(this, 'should the cameras be above the presentation', e.webcamContainer, 'smart-layout', 1);
await checkScreenshots(this, 'should the cameras be above the presentation', [e.webcamContainer, e.webcamMirroredVideoContainer], 'smart-layout', 1);

await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.wasRemoved(e.chatButton, '');

await checkScreenshots(this, 'should the cameras be on the side of presentation', e.webcamContainer, 'smart-layout', 2);
await checkScreenshots(this, 'should the cameras be on the side of presentation', [e.webcamContainer, e.webcamMirroredVideoContainer], 'smart-layout', 2);
await reopenChatSidebar(this.modPage);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions bigbluebutton-tests/playwright/layouts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ async function reopenChatSidebar(page) {
}

async function checkScreenshots(layoutTest, description, maskedSelectors, screenshotName, screenshotNumber) {
const modPageWebcamsLocator = layoutTest.modPage.getLocator(maskedSelectors);
const getMaskedLocators = (page) => Array.isArray(maskedSelectors)
? maskedSelectors.map(selector => page.getLocator(selector))
: [page.getLocator(maskedSelectors)];

const modPageMaskedSelectors = getMaskedLocators(layoutTest.modPage);
await expect(layoutTest.modPage.page, description).toHaveScreenshot(`moderator-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [modPageWebcamsLocator],
mask: modPageMaskedSelectors,
});

const userWebcamsLocator = layoutTest.userPage.getLocator(maskedSelectors);
const userPageMaskedSelectors = getMaskedLocators(layoutTest.userPage);
await expect(layoutTest.userPage.page, description).toHaveScreenshot(`user-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [userWebcamsLocator],
mask: userPageMaskedSelectors,
});
}

Expand Down

0 comments on commit b436c13

Please sign in to comment.