Skip to content

Commit

Permalink
Merge pull request #19573 from gabriellpr/fix-presentation-polling-test
Browse files Browse the repository at this point in the history
test: Fix a few flaky tests
  • Loading branch information
ramonlsouza committed Feb 26, 2024
2 parents 02be350 + d2c26d1 commit 525a1d8
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 10 deletions.
2 changes: 2 additions & 0 deletions bigbluebutton-tests/playwright/core/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ exports.rating = 'div[data-test="rating"]';
exports.errorScreenMessage = 'h1[data-test="errorScreenMessage"]';
exports.errorMessageLabel = 'span[id="error-message"]';
exports.shareCameraAsContent = 'li[data-test="shareCameraAsContent"]';
exports.closePopup = 'button[data-test="closePopup"]';
exports.restoreWelcomeMessages = 'li[data-test="restoreWelcomeMessages"]';

// Accesskey
exports.chatButtonKey = 'div[accesskey="P"]';
Expand Down
11 changes: 9 additions & 2 deletions bigbluebutton-tests/playwright/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ class Options extends MultiUsers {
}

async darkMode() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.waitAndClick(e.closePopup);
await openSettings(this.modPage);

await this.modPage.waitAndClickElement(e.darkModeToggleBtn);
await this.modPage.waitAndClick(e.modalConfirmButton);

const modPageLocator = this.modPage.getLocator('body');
await this.modPage.page.setViewportSize({ width: 1924, height: 1080 });
await this.modPage.page.setViewportSize({ width: 1366, height: 768 });
const screenshotOptions = {
maxDiffPixels: 1000,
};
Expand All @@ -76,17 +78,22 @@ class Options extends MultiUsers {
await openSettings(this.modPage);
await this.modPage.waitAndClickElement(e.darkModeToggleBtn);
await this.modPage.waitAndClick(e.modalConfirmButton);

await this.modPage.waitAndClick(e.chatOptions);
await this.modPage.waitAndClick(e.restoreWelcomeMessages);
}

async fontSizeTest() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.waitAndClick(e.closePopup);
// Increasing font size
await openSettings(this.modPage);
await this.modPage.waitAndClick(e.increaseFontSize);
await this.modPage.waitAndClick(e.modalConfirmButton);

const modPageLocator = this.modPage.getLocator('body');

await this.modPage.page.setViewportSize({ width: 1924, height: 1080 });
await this.modPage.page.setViewportSize({ width: 1366, height: 768 });
const screenshotOptions = {
maxDiffPixels: 1000,
};
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions bigbluebutton-tests/playwright/parameters/parameters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ test.describe.parallel('Custom Parameters', () => {

test.describe.parallel('Audio', () => {
// see https://github.com/bigbluebutton/bigbluebutton/issues/19427
test('Auto join @ci @flaky', async ({ browser, context, page }) => {
test('Auto join @ci', async ({ browser, context, page }) => {
const customParam = new CustomParameters(browser, context);
await customParam.initModPage(page, false, { joinParameter: c.autoJoin });
await customParam.autoJoin();
Expand All @@ -437,7 +437,7 @@ test.describe.parallel('Custom Parameters', () => {
});

// see https://github.com/bigbluebutton/bigbluebutton/issues/19428
test('Force Listen Only @ci @flaky', async ({ browser, context, page }) => {
test('Force Listen Only @ci', async ({ browser, context, page }) => {
const customParam = new CustomParameters(browser, context);
await customParam.initUserPage(false, context, { useModMeetingId: false, joinParameter: c.forceListenOnly });
await customParam.forceListenOnly(page);
Expand All @@ -458,7 +458,7 @@ test.describe.parallel('Custom Parameters', () => {

test.describe.parallel('Presentation', () => {
// see https://github.com/bigbluebutton/bigbluebutton/issues/19456
test('Hide Presentation on join @ci @flaky', async ({ browser, context, page }) => {
test('Hide Presentation on join @ci', async ({ browser, context, page }) => {
const customParam = new CustomParameters(browser, context);
await customParam.initModPage(page, true, { joinParameter: c.hidePresentationOnJoin });
await customParam.initUserPage(true, context, { useModMeetingId: true, joinParameter: c.hidePresentationOnJoin });
Expand Down
6 changes: 4 additions & 2 deletions bigbluebutton-tests/playwright/polling/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.waitForSelector(e.restartPoll);

await this.modPage.hasElement(e.wbDrawnRectangle);
await this.modPage.hasElement(e.wbDrawnRectangle, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.wbDrawnRectangle);

await this.modPage.waitAndClick(e.closePollingBtn);
Expand Down Expand Up @@ -130,7 +130,7 @@ class Polling extends MultiUsers {
}

async customInput() {
await uploadSinglePresentation(this.modPage, e.questionSlideFileName);
await uploadSinglePresentation(this.modPage, e.uploadPresentationFileName);

await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.polling);
Expand All @@ -139,6 +139,8 @@ class Polling extends MultiUsers {
await this.modPage.type(e.pollQuestionArea, 'Test');
await this.modPage.waitAndClick(e.addPollItem);
await this.modPage.type(e.pollOptionItem, 'test1');
await this.modPage.waitAndClick(e.addPollItem);
await this.modPage.type(e.pollOptionItem2, 'test2');
await this.modPage.waitAndClick(e.startPoll);

await this.userPage.hasElement(e.pollingContainer);
Expand Down
4 changes: 2 additions & 2 deletions bigbluebutton-tests/playwright/polling/polling.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('Polling', async () => {
await polling.pollAnonymous();
});

test('Create quick poll - from the slide @ci @flaky', async () => {
test('Create quick poll - from the slide @ci', async () => {
await polling.quickPoll();
});

Expand All @@ -40,7 +40,7 @@ test.describe('Polling', async () => {
await polling.notAbleStartNewPollWithoutPresentation();
});

test('Custom input @ci @flaky', async () => {
test('Custom input @ci', async () => {
await polling.customInput();
});

Expand Down
6 changes: 6 additions & 0 deletions bigbluebutton-tests/playwright/presentation/presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ class Presentation extends MultiUsers {
await this.userPage.wasRemoved(e.presentationStatusInfo);
await this.userPage.wasRemoved(e.smallToastMsg);

await this.modPage.reloadPage();
await this.modPage.closeAudioModal();
await this.modPage.closeAllToastNotifications();
const modWhiteboardLocator = this.modPage.getLocator(e.whiteboard);
await expect(modWhiteboardLocator).toHaveScreenshot('moderator-new-presentation-screenshot.png', {
maxDiffPixels: 1000,
});

await this.userPage.reloadPage();
await this.userPage.closeAudioModal();
await this.userPage.closeAllToastNotifications();
const userWhiteboardLocator = this.userPage.getLocator(e.whiteboard);
await expect(userWhiteboardLocator).toHaveScreenshot('viewer-new-presentation-screenshot.png', {
maxDiffPixels: 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe.parallel('Presentation', () => {
await presentation.hidePresentationToolbar();
});

test('Zoom In, Zoom Out, Reset Zoom @ci @flaky', async ({ browser, context, page }) => {
test('Zoom In, Zoom Out, Reset Zoom @ci', async ({ browser, context, page }) => {
const presentation = new Presentation(browser, context);
await presentation.initPages(page);
await presentation.zoom();
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 525a1d8

Please sign in to comment.