fix warnings, uninstall unused lib and move media folder into the core

This commit is contained in:
Anton B 2022-04-07 15:34:25 -03:00
parent 7c709d9492
commit d3e9d85bc6
13 changed files with 20 additions and 58 deletions

View File

@ -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 {

View File

@ -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"]';

View File

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

View File

@ -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,

View File

@ -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';

View File

@ -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",

View File

@ -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"
}

View File

@ -1,4 +1,3 @@
const { default: test } = require('@playwright/test');
const e = require('../core/elements.js');
const { getSettings } = require('../core/settings.js');

View File

@ -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);

View File

@ -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];
}
}

View File

@ -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();