Skip to content

Commit

Permalink
Merge pull request #18416 from gabriellpr/test-diff-presentation-format
Browse files Browse the repository at this point in the history
test: Add more types of presentation to upload
  • Loading branch information
antobinary committed Aug 29, 2023
2 parents a0ab782 + 146a226 commit c0002ab
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 0 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 @@ -265,6 +265,8 @@ exports.answerE = 'div[data-test="numberOfVotes"]>>nth=4';
// Presentation
exports.currentSlideImg = 'img[id="slide-background-shape_image"]';
exports.uploadPresentationFileName = 'uploadTest.png';
exports.presentationPPTX = 'BBB.pptx';
exports.presentationTXT = 'helloWorld.txt';
exports.presentationPlaceholderLabel = 'There is no currently active presentation';
exports.noPresentationLabel = 'There is no currently active presentation';
exports.startScreenSharing = 'button[data-test="startScreenShare"]';
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions bigbluebutton-tests/playwright/core/media/helloWorld.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!!!
45 changes: 45 additions & 0 deletions bigbluebutton-tests/playwright/presentation/presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Presentation extends MultiUsers {
async uploadSinglePresentationTest() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitForSelector(e.skipSlide);
await this.modPage.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_EXTRA_LONG_TIME);
await uploadSinglePresentation(this.modPage, e.pdfFileName, UPLOAD_PDF_WAIT_TIME);

// wait until the notifications disappear
Expand All @@ -85,6 +86,50 @@ class Presentation extends MultiUsers {
});
}

async uploadOtherPresentationsFormat() {
await uploadSinglePresentation(this.modPage, e.uploadPresentationFileName, UPLOAD_PDF_WAIT_TIME);
await this.modPage.waitAndClick(e.smallToastMsg);
await this.modPage.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.wasRemoved(e.presentationStatusInfo);
await this.userPage.wasRemoved(e.smallToastMsg);

const modWhiteboardLocator = this.modPage.getLocator(e.whiteboard);
const userWhiteboardLocator = this.userPage.getLocator(e.whiteboard);

await expect(modWhiteboardLocator).toHaveScreenshot('moderator-png-presentation-screenshot.png', {
maxDiffPixels: 1000,
});
await expect(userWhiteboardLocator).toHaveScreenshot('viewer-png-presentation-screenshot.png', {
maxDiffPixels: 1000,
});

await uploadSinglePresentation(this.modPage, e.presentationPPTX, UPLOAD_PDF_WAIT_TIME);
await this.modPage.waitAndClick(e.smallToastMsg);
await this.modPage.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.wasRemoved(e.presentationStatusInfo);
await this.userPage.wasRemoved(e.smallToastMsg);

await expect(modWhiteboardLocator).toHaveScreenshot('moderator-pptx-presentation-screenshot.png', {
maxDiffPixels: 1000,
});
await expect(userWhiteboardLocator).toHaveScreenshot('viewer-pptx-presentation-screenshot.png', {
maxDiffPixels: 1000,
});

await uploadSinglePresentation(this.modPage, e.presentationTXT, UPLOAD_PDF_WAIT_TIME);
await this.modPage.waitAndClick(e.smallToastMsg);
await this.modPage.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.wasRemoved(e.presentationStatusInfo);
await this.userPage.wasRemoved(e.smallToastMsg);

await expect(modWhiteboardLocator).toHaveScreenshot('moderator-txt-presentation-screenshot.png', {
maxDiffPixels: 1000,
});
await expect(userWhiteboardLocator).toHaveScreenshot('viewer-txt-presentation-screenshot.png', {
maxDiffPixels: 1000,
});
}

async uploadMultiplePresentationsTest() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ test.describe.parallel('Presentation', () => {
await presentation.uploadSinglePresentationTest();
});

test('Upload Other Presentations Format @ci', async ({ browser, context, page }) => {
const presentation = new Presentation(browser, context);
await presentation.initPages(page, true);
await presentation.uploadOtherPresentationsFormat();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#uploading-multiple-presentations-automated
test('Upload multiple presentations', async ({ browser, context, page }) => {
const presentation = new Presentation(browser, context);
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.
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 c0002ab

Please sign in to comment.