diff --git a/bigbluebutton-tests/playwright/connectionStatus/connectionStatus.js b/bigbluebutton-tests/playwright/connectionStatus/connectionStatus.js index b01d7501cd..91edb33f51 100644 --- a/bigbluebutton-tests/playwright/connectionStatus/connectionStatus.js +++ b/bigbluebutton-tests/playwright/connectionStatus/connectionStatus.js @@ -1,10 +1,8 @@ const { expect } = require('@playwright/test'); const { MultiUsers } = require('../user/multiusers'); const e = require('../core/elements'); -const { ELEMENT_WAIT_TIME, ELEMENT_WAIT_LONGER_TIME } = require('../core/constants'); +const { ELEMENT_WAIT_TIME } = require('../core/constants'); const { openConnectionStatus, checkNetworkStatus } = require('./util'); -const { startScreenshare } = require('../screenshare/util'); -const { waitAndClearNotification } = require('../notifications/util'); class ConnectionStatus extends MultiUsers { diff --git a/bigbluebutton-tests/playwright/core/elements.js b/bigbluebutton-tests/playwright/core/elements.js index 7066b532d7..983fccdab9 100644 --- a/bigbluebutton-tests/playwright/core/elements.js +++ b/bigbluebutton-tests/playwright/core/elements.js @@ -188,11 +188,12 @@ exports.messageTitle = 'h2[data-test="messageTitle"]'; exports.notesTitle = 'h2[data-test="notesTitle"]'; // User -exports.userAvatar = 'div[data-test="userAvatar"]'; +const userAvatar = 'div[data-test="userAvatar"]'; +exports.userAvatar = userAvatar; exports.moderatorAvatar = 'div[data-test="moderatorAvatar"]'; exports.viewerAvatar = 'div[data-test="viewerAvatar"]'; -exports.applauseIcon = `${this.userAvatar} > div > i[class="icon-bbb-applause"]`; -exports.awayIcon = `${this.userAvatar} > div > i[class="icon-bbb-time"]`; +exports.applauseIcon = `${userAvatar} > div > i[class="icon-bbb-applause"]`; +exports.awayIcon = `${userAvatar} > div > i[class="icon-bbb-time"]`; exports.setStatus = 'li[data-test="setStatus"]'; exports.away = 'li[data-test="away"]'; exports.applaud = 'li[data-test="applause"]'; diff --git a/bigbluebutton-tests/playwright/media/100PagesFile.pdf b/bigbluebutton-tests/playwright/core/media/100PagesFile.pdf similarity index 100% rename from bigbluebutton-tests/playwright/media/100PagesFile.pdf rename to bigbluebutton-tests/playwright/core/media/100PagesFile.pdf diff --git a/bigbluebutton-tests/playwright/media/mockPollSlide.pdf b/bigbluebutton-tests/playwright/core/media/mockPollSlide.pdf similarity index 100% rename from bigbluebutton-tests/playwright/media/mockPollSlide.pdf rename to bigbluebutton-tests/playwright/core/media/mockPollSlide.pdf diff --git a/bigbluebutton-tests/playwright/media/uploadTest.png b/bigbluebutton-tests/playwright/core/media/uploadTest.png similarity index 100% rename from bigbluebutton-tests/playwright/media/uploadTest.png rename to bigbluebutton-tests/playwright/core/media/uploadTest.png diff --git a/bigbluebutton-tests/playwright/core/page.js b/bigbluebutton-tests/playwright/core/page.js index 3fa443dfc7..f50e337d47 100644 --- a/bigbluebutton-tests/playwright/core/page.js +++ b/bigbluebutton-tests/playwright/core/page.js @@ -1,7 +1,5 @@ require('dotenv').config(); const { expect, default: test } = require('@playwright/test'); -const yaml = require('js-yaml'); -const path = require('path'); const { readFileSync } = require('fs'); const parameters = require('./parameters'); const helpers = require('./helpers'); @@ -47,9 +45,9 @@ class Page { this.waitAndClick(selector, timeout), ]); await expect(download).toBeTruthy(); - const path = await download.path(); - const content = await readFileSync(path, 'utf8'); - await testInfo.attach('downloaded', { path }); + const filePath = await download.path(); + const content = await readFileSync(filePath, 'utf8'); + await testInfo.attach('downloaded', { filePath }); return { download, diff --git a/bigbluebutton-tests/playwright/customparameters/constants.js b/bigbluebutton-tests/playwright/customparameters/constants.js index 32ab2da097..3fc57e5c78 100644 --- a/bigbluebutton-tests/playwright/customparameters/constants.js +++ b/bigbluebutton-tests/playwright/customparameters/constants.js @@ -5,8 +5,9 @@ exports.listenOnlyMode = 'userdata-bbb_listen_only_mode=false'; exports.forceListenOnly = 'userdata-bbb_force_listen_only=true'; exports.skipCheck = 'userdata-bbb_skip_check_audio=true'; exports.skipCheckOnFirstJoin = 'userdata-bbb_skip_check_audio_on_first_join=true'; -exports.docTitle = 'playwright'; -exports.clientTitle = `userdata-bbb_client_title=${this.docTitle}`; +const docTitle = 'playwright'; +exports.docTitle = docTitle; +exports.clientTitle = `userdata-bbb_client_title=${docTitle}`; exports.askForFeedbackOnLogout = 'userdata-bbb_ask_for_feedback_on_logout=true'; exports.displayBrandingArea = 'userdata-bbb_display_branding_area=true'; exports.logo = 'logo=https://bigbluebutton.org/wp-content/themes/bigbluebutton/library/images/bigbluebutton-logo.png'; @@ -26,8 +27,9 @@ exports.outsideToggleRecording = 'userdata-bbb_outside_toggle_recording=true'; exports.showPublicChatOnLogin = 'userdata-bbb_show_public_chat_on_login=false'; exports.forceRestorePresentationOnNewEvents = 'userdata-bbb_force_restore_presentation_on_new_events=true'; exports.bannerText = 'bannerText=some text'; -exports.color = 'FFFF00'; -exports.bannerColor = `bannerColor=%23${this.color}`; +const color = 'FFFF00' +exports.color = color; +exports.bannerColor = `bannerColor=%23${color}`; exports.recordMeeting = 'record=true'; exports.skipVideoPreview = 'userdata-bbb_skip_video_preview=true'; exports.skipVideoPreviewOnFirstJoin = 'userdata-bbb_skip_video_preview_on_first_join=true'; diff --git a/bigbluebutton-tests/playwright/package-lock.json b/bigbluebutton-tests/playwright/package-lock.json index 115453b2cf..bc83176eb6 100644 --- a/bigbluebutton-tests/playwright/package-lock.json +++ b/bigbluebutton-tests/playwright/package-lock.json @@ -4,12 +4,10 @@ "requires": true, "packages": { "": { - "name": "playwright", "devDependencies": { "@playwright/test": "^1.18.1", "axios": "^0.26.1", "dotenv": "^16.0.0", - "js-yaml": "^4.1.0", "playwright": "^1.18.1", "sha1": "^1.1.1" } @@ -1054,12 +1052,6 @@ "node": ">=4" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/axios": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", @@ -1967,18 +1959,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -3410,12 +3390,6 @@ "color-convert": "^1.9.0" } }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "axios": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", @@ -4093,15 +4067,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", diff --git a/bigbluebutton-tests/playwright/package.json b/bigbluebutton-tests/playwright/package.json index e9017df040..fb7a7414c8 100644 --- a/bigbluebutton-tests/playwright/package.json +++ b/bigbluebutton-tests/playwright/package.json @@ -9,7 +9,6 @@ "@playwright/test": "^1.18.1", "axios": "^0.26.1", "dotenv": "^16.0.0", - "js-yaml": "^4.1.0", "playwright": "^1.18.1", "sha1": "^1.1.1" } diff --git a/bigbluebutton-tests/playwright/polling/util.js b/bigbluebutton-tests/playwright/polling/util.js index c5afb8f5fd..5514e7a407 100644 --- a/bigbluebutton-tests/playwright/polling/util.js +++ b/bigbluebutton-tests/playwright/polling/util.js @@ -1,4 +1,3 @@ -const { default: test } = require('@playwright/test'); const e = require('../core/elements.js'); const { getSettings } = require('../core/settings.js'); diff --git a/bigbluebutton-tests/playwright/presentation/util.js b/bigbluebutton-tests/playwright/presentation/util.js index 78feda58a1..e22c861179 100644 --- a/bigbluebutton-tests/playwright/presentation/util.js +++ b/bigbluebutton-tests/playwright/presentation/util.js @@ -19,7 +19,7 @@ async function uploadPresentation(test, fileName, uploadTimeout = ELEMENT_WAIT_L await test.waitAndClick(e.managePresentations); await test.waitForSelector(e.fileUpload); - await test.page.setInputFiles(e.fileUpload, path.join(__dirname, `../media/${fileName}`)); + await test.page.setInputFiles(e.fileUpload, path.join(__dirname, `../core/media/${fileName}`)); await test.hasText('body', e.statingUploadPresentationToast); await test.waitAndClick(e.confirmManagePresentation); diff --git a/bigbluebutton-tests/playwright/settings/util.js b/bigbluebutton-tests/playwright/settings/util.js index 9cb0dd2cb9..7075d96a84 100644 --- a/bigbluebutton-tests/playwright/settings/util.js +++ b/bigbluebutton-tests/playwright/settings/util.js @@ -11,7 +11,7 @@ async function getLocaleValues(elements, locale) { let currentLocale = {}; try { currentLocale = require(`../../../bigbluebutton-html5/public/locales/${locale.replace('-', '_')}.json`); - } catch (e) { } + } catch (err) { } for (const selector in elements) { const currentKey = elements[selector]; @@ -22,7 +22,7 @@ async function getLocaleValues(elements, locale) { let generalLocale = {}; try { generalLocale = require(`../../../bigbluebutton-html5/public/locales/${generalLocaleName}.json`); - } catch (e) { } + } catch (err) { } return generalLocale[currentKey] ? generalLocale[currentKey] : defaultLocale[currentKey]; } } diff --git a/bigbluebutton-tests/playwright/webcam/webcam.spec.js b/bigbluebutton-tests/playwright/webcam/webcam.spec.js index 8cf425a3af..a9746bc4f7 100644 --- a/bigbluebutton-tests/playwright/webcam/webcam.spec.js +++ b/bigbluebutton-tests/playwright/webcam/webcam.spec.js @@ -2,19 +2,19 @@ const { test } = require('@playwright/test'); const { Webcam } = require('./webcam'); test.describe.parallel('Webcam', () => { - test('Shares webcam', async ({ browser, context, page }) => { + test('Shares webcam', async ({ browser, page }) => { const webcam = new Webcam(browser, page); await webcam.init(true, true); await webcam.share(); }); - test('Checks content of webcam', async ({ browser, context, page }) => { + test('Checks content of webcam', async ({ browser, page }) => { const webcam = new Webcam(browser, page); await webcam.init(true, true); await webcam.checksContent(); }); - test('Checks webcam talking indicator', async ({ browser, context, page }) => { + test('Checks webcam talking indicator', async ({ browser, page }) => { const webcam = new Webcam(browser, page); await webcam.init(true, false); await webcam.talkingIndicator();