bigbluebutton-Github/bigbluebutton-tests/playwright/layouts/util.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

28 lines
1.1 KiB
JavaScript

const { expect } = require('@playwright/test');
const e = require('../core/elements');
async function reopenChatSidebar(page) {
await page.waitAndClick(e.userListToggleBtn);
try {
await page.hasElement(e.hidePublicChat);
} catch {
await page.waitAndClick(e.chatButton);
await page.hasElement(e.hidePublicChat);
}
}
async function checkScreenshots(layoutTest, description, maskedSelectors, screenshotName, screenshotNumber) {
const modPageWebcamsLocator = layoutTest.modPage.getLocator(maskedSelectors);
await expect(layoutTest.modPage.page, description).toHaveScreenshot(`moderator-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [modPageWebcamsLocator],
});
const userWebcamsLocator = layoutTest.userPage.getLocator(maskedSelectors);
await expect(layoutTest.userPage.page, description).toHaveScreenshot(`user-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [userWebcamsLocator],
});
}
exports.reopenChatSidebar = reopenChatSidebar;
exports.checkScreenshots = checkScreenshots;