diff --git a/bigbluebutton-tests/playwright/polling/poll.js b/bigbluebutton-tests/playwright/polling/poll.js index faaa07aaa4..e3743fb4bb 100644 --- a/bigbluebutton-tests/playwright/polling/poll.js +++ b/bigbluebutton-tests/playwright/polling/poll.js @@ -2,7 +2,7 @@ const { expect, test } = require('@playwright/test'); const { MultiUsers } = require('../user/multiusers'); const e = require('../core/elements'); const util = require('./util.js'); -const { ELEMENT_WAIT_LONGER_TIME, ELEMENT_WAIT_TIME } = require('../core/constants'); +const { ELEMENT_WAIT_LONGER_TIME, ELEMENT_WAIT_TIME, ELEMENT_WAIT_EXTRA_LONG_TIME } = require('../core/constants'); const { getSettings } = require('../core/settings'); const { waitAndClearDefaultPresentationNotification } = require('../notifications/util'); const { uploadSinglePresentation, skipSlide } = require('../presentation/util'); @@ -36,7 +36,7 @@ class Polling extends MultiUsers { } async quickPoll() { - await uploadSinglePresentation(this.modPage, e.questionSlideFileName); + await util.uploadSPresentationForTestingPolls(this.modPage, e.questionSlideFileName); // The slide needs to be uploaded and converted, so wait a bit longer for this step await this.modPage.waitAndClick(e.quickPoll, ELEMENT_WAIT_LONGER_TIME); @@ -129,7 +129,8 @@ class Polling extends MultiUsers { } async customInput() { - await uploadSinglePresentation(this.modPage, e.uploadPresentationFileName); + await util.uploadSPresentationForTestingPolls(this.modPage, e.uploadPresentationFileName); + await this.modPage.waitForSelector(e.whiteboard, 20000); await this.modPage.waitAndClick(e.actions); await this.modPage.waitAndClick(e.polling); @@ -183,11 +184,11 @@ class Polling extends MultiUsers { async smartSlidesQuestions() { await this.modPage.hasElement(e.whiteboard, ELEMENT_WAIT_LONGER_TIME); - await uploadSinglePresentation(this.modPage, e.smartSlides1, ELEMENT_WAIT_LONGER_TIME); + await util.uploadSPresentationForTestingPolls(this.modPage, e.smartSlides1); await this.userPage.hasElement(e.userListItem); // Type Response - await this.modPage.waitAndClick(e.quickPoll); + await this.modPage.waitAndClick(e.quickPoll, ELEMENT_WAIT_LONGER_TIME); await this.userPage.hasElement(e.responsePollQuestion); await this.userPage.type(e.pollAnswerOptionInput, 'test'); await this.userPage.waitAndClick(e.pollSubmitAnswer); @@ -311,7 +312,7 @@ class Polling extends MultiUsers { await waitAndClearDefaultPresentationNotification(this.modPage); await util.startPoll(this.modPage); await this.userPage.waitAndClick(e.pollAnswerOptionBtn); - await uploadSinglePresentation(this.modPage, e.questionSlideFileName); + await util.uploadSPresentationForTestingPolls(this.modPage, e.questionSlideFileName); await this.modPage.waitAndClick(e.publishPollingLabel); // Check poll results await this.modPage.hasElement(e.wbDrawnRectangle); diff --git a/bigbluebutton-tests/playwright/polling/polling.spec.js b/bigbluebutton-tests/playwright/polling/polling.spec.js index 30873465a6..3830f0a0ef 100644 --- a/bigbluebutton-tests/playwright/polling/polling.spec.js +++ b/bigbluebutton-tests/playwright/polling/polling.spec.js @@ -2,13 +2,17 @@ const { test } = require('../fixtures'); const { fullyParallel } = require('../playwright.config'); const { Polling } = require('./poll'); const { initializePages } = require('../core/helpers'); +const { encodeCustomParams } = require('../parameters/util'); +const { PARAMETER_HIDE_PRESENTATION_TOAST } = require('../core/constants'); + +const hidePresentationToast = encodeCustomParams(PARAMETER_HIDE_PRESENTATION_TOAST); test.describe('Polling', async () => { const polling = new Polling(); test.describe.configure({ mode: fullyParallel ? 'parallel' : 'serial' }); test[fullyParallel ? 'beforeEach' : 'beforeAll'](async ({ browser }) => { - await initializePages(polling, browser, { isMultiUser: true }); + await initializePages(polling, browser, { isMultiUser: true, joinParameter: hidePresentationToast }); }); // Manage diff --git a/bigbluebutton-tests/playwright/polling/util.js b/bigbluebutton-tests/playwright/polling/util.js index 5d38486775..461931b9d4 100644 --- a/bigbluebutton-tests/playwright/polling/util.js +++ b/bigbluebutton-tests/playwright/polling/util.js @@ -1,6 +1,7 @@ const { test } = require('@playwright/test'); const e = require('../core/elements.js'); const { getSettings } = require('../core/settings.js'); +const path = require('path'); async function openPoll(testPage) { const { pollEnabled } = getSettings(); @@ -19,5 +20,17 @@ async function startPoll(test, isAnonymous = false) { await test.waitAndClick(e.startPoll); } +async function uploadSPresentationForTestingPolls(test, fileName) { + await test.waitAndClick(e.actions); + await test.waitAndClick(e.managePresentations); + await test.waitForSelector(e.presentationFileUpload); + + await test.page.setInputFiles(e.presentationFileUpload, path.join(__dirname, `../core/media/${fileName}`)); + await test.hasText('body', e.statingUploadPresentationToast); + + await test.waitAndClick(e.confirmManagePresentation); +} + exports.openPoll = openPoll; exports.startPoll = startPoll; +exports.uploadSPresentationForTestingPolls = uploadSPresentationForTestingPolls;