From f6b907870a5537ea6f02bcc3cc1e17171a0e6ab4 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 26 Oct 2021 14:48:18 -0300 Subject: [PATCH 01/28] improves startSharing function --- bigbluebutton-tests/puppeteer/screenshare/screenshare.js | 8 +++----- .../puppeteer/screenshare/screenshare.obj.js | 2 +- bigbluebutton-tests/puppeteer/screenshare/util.js | 6 +----- bigbluebutton-tests/puppeteer/user/status.js | 2 -- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/bigbluebutton-tests/puppeteer/screenshare/screenshare.js b/bigbluebutton-tests/puppeteer/screenshare/screenshare.js index 1729564867..f116d79cfe 100644 --- a/bigbluebutton-tests/puppeteer/screenshare/screenshare.js +++ b/bigbluebutton-tests/puppeteer/screenshare/screenshare.js @@ -8,14 +8,12 @@ class ShareScreen extends Page { super(); } - async test() { + async startSharing() { try { await util.startScreenshare(this); - await this.waitForSelector(e.screenshareConnecting); - await this.waitForSelector(e.screenShareVideo, VIDEO_LOADING_WAIT_TIME); - const response = await this.hasElement(e.isSharingScreen, true); + const resp = await this.hasElement(e.isSharingScreen); - return response === true; + return resp === true; } catch (err) { await this.logger(err); return false; diff --git a/bigbluebutton-tests/puppeteer/screenshare/screenshare.obj.js b/bigbluebutton-tests/puppeteer/screenshare/screenshare.obj.js index e5cdccb7bb..8d05e0890d 100644 --- a/bigbluebutton-tests/puppeteer/screenshare/screenshare.obj.js +++ b/bigbluebutton-tests/puppeteer/screenshare/screenshare.obj.js @@ -22,7 +22,7 @@ const screenShareTest = () => { await test.logger('begin of ', testName); await test.init(true, true, testName) await test.startRecording(testName); - response = await test.test(); + response = await test.startSharing(); await test.logger('end of ', testName); await test.stopRecording(); screenshot = await test.page.screenshot(); diff --git a/bigbluebutton-tests/puppeteer/screenshare/util.js b/bigbluebutton-tests/puppeteer/screenshare/util.js index 26696b1175..0f05badbe2 100644 --- a/bigbluebutton-tests/puppeteer/screenshare/util.js +++ b/bigbluebutton-tests/puppeteer/screenshare/util.js @@ -3,9 +3,6 @@ const { VIDEO_LOADING_WAIT_TIME } = require('../core/constants'); async function startScreenshare(test) { await test.waitAndClick(e.startScreenSharing); -} - -async function waitForScreenshareContainer(test) { await test.waitForSelector(e.screenshareConnecting); await test.waitForSelector(e.screenShareVideo, VIDEO_LOADING_WAIT_TIME); } @@ -16,5 +13,4 @@ async function getScreenShareBreakoutContainer(test) { } exports.getScreenShareBreakoutContainer = getScreenShareBreakoutContainer; -exports.startScreenshare = startScreenshare; -exports.waitForScreenshareContainer = waitForScreenshareContainer; +exports.startScreenshare = startScreenshare; \ No newline at end of file diff --git a/bigbluebutton-tests/puppeteer/user/status.js b/bigbluebutton-tests/puppeteer/user/status.js index 528a71c8db..a9f8119330 100644 --- a/bigbluebutton-tests/puppeteer/user/status.js +++ b/bigbluebutton-tests/puppeteer/user/status.js @@ -53,7 +53,6 @@ class Status extends Page { async disableScreenshareFromConnectionStatus() { try { await utilScreenshare.startScreenshare(this); - await utilScreenshare.waitForScreenshareContainer(this); await util.connectionStatus(this); await this.waitAndClickElement(e.dataSavingScreenshare); await this.waitAndClickElement(e.closeConnectionStatusModal); @@ -72,7 +71,6 @@ class Status extends Page { await this.joinMicrophone(); await this.shareWebcam(true, ELEMENT_WAIT_LONGER_TIME); await utilScreenshare.startScreenshare(this); - await utilScreenshare.waitForScreenshareContainer(this); await util.connectionStatus(this); await sleep(5000); const connectionStatusItemEmpty = await this.page.evaluate(checkElementLengthEqualTo, e.connectionStatusItemEmpty, 0); From b40f3f92f56e1a3333e602f940e7dad20f1657c3 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 26 Oct 2021 14:51:24 -0300 Subject: [PATCH 02/28] unify webcam tests --- bigbluebutton-tests/puppeteer/all.test.js | 2 -- bigbluebutton-tests/puppeteer/run.sh | 2 +- .../puppeteer/webcam/webcam.obj.js | 23 ++++++++++++ .../puppeteer/webcam/webcamlayout.obj.js | 36 ------------------- .../puppeteer/webcam/webcamlayout.test.js | 3 -- 5 files changed, 24 insertions(+), 42 deletions(-) delete mode 100644 bigbluebutton-tests/puppeteer/webcam/webcamlayout.obj.js delete mode 100644 bigbluebutton-tests/puppeteer/webcam/webcamlayout.test.js diff --git a/bigbluebutton-tests/puppeteer/all.test.js b/bigbluebutton-tests/puppeteer/all.test.js index 5e69f2db0f..a1e916abd2 100644 --- a/bigbluebutton-tests/puppeteer/all.test.js +++ b/bigbluebutton-tests/puppeteer/all.test.js @@ -11,7 +11,6 @@ const stressTest = require('./stress/stress.obj'); const userTest = require('./user/user.obj'); const virtualizedListTest = require('./virtualizedlist/virtualizedlist.obj'); const webcamTest = require('./webcam/webcam.obj'); -const webcamLayout = require('./webcam/webcamlayout.obj'); const whiteboardTest = require('./whiteboard/whiteboard.obj'); process.setMaxListeners(Infinity); @@ -28,7 +27,6 @@ describe('Shared Notes ', sharedNotesTest); describe('User', userTest); describe('Virtualized List', virtualizedListTest); describe('Webcam', webcamTest); -describe('Webcam Layout', webcamLayout); describe('Whiteboard', whiteboardTest); if (process.env.STRESS_TEST === 'true') { describe('Stress', stressTest); diff --git a/bigbluebutton-tests/puppeteer/run.sh b/bigbluebutton-tests/puppeteer/run.sh index 5c94dca5fc..998634b840 100755 --- a/bigbluebutton-tests/puppeteer/run.sh +++ b/bigbluebutton-tests/puppeteer/run.sh @@ -6,7 +6,7 @@ usage() { BBB Health Check OPTIONS: - -t + -t -u Print usage HERE diff --git a/bigbluebutton-tests/puppeteer/webcam/webcam.obj.js b/bigbluebutton-tests/puppeteer/webcam/webcam.obj.js index 2d069f54d7..6ff47caa64 100644 --- a/bigbluebutton-tests/puppeteer/webcam/webcam.obj.js +++ b/bigbluebutton-tests/puppeteer/webcam/webcam.obj.js @@ -54,5 +54,28 @@ const webcamTest = () => { expect(response).toBe(true); Page.checkRegression(7.5, screenshot); }); + + test('Checks webcam talking indicator', async () => { + const test = new Share(); + let response; + let screenshot; + try { + const testName = 'joinWebcamAndMicrophone'; + await test.logger('begin of ', testName); + await test.init(true, false, testName); + await test.startRecording(testName); + await test.webcamLayoutStart(); + response = await test.webcamLayoutTest(testName); + await test.logger('end of ', testName); + await test.stopRecording(); + screenshot = await test.page.screenshot(); + } catch (err) { + await test.logger(err); + } finally { + await test.close(); + } + expect(response).toBe(true); + Page.checkRegression(10.83, screenshot); + }); }; module.exports = exports = webcamTest; diff --git a/bigbluebutton-tests/puppeteer/webcam/webcamlayout.obj.js b/bigbluebutton-tests/puppeteer/webcam/webcamlayout.obj.js deleted file mode 100644 index e3a9a7b105..0000000000 --- a/bigbluebutton-tests/puppeteer/webcam/webcamlayout.obj.js +++ /dev/null @@ -1,36 +0,0 @@ -const Page = require('../core/page'); -const Share = require('./share'); -const { toMatchImageSnapshot } = require('jest-image-snapshot'); -const { MAX_WEBCAM_LAYOUT_TEST_TIMEOUT } = require('../core/constants'); - -expect.extend({ toMatchImageSnapshot }); - -const webcamLayoutTest = () => { - beforeEach(() => { - jest.setTimeout(MAX_WEBCAM_LAYOUT_TEST_TIMEOUT); - }); - - test('Join Webcam and microphone', async () => { - const test = new Share(); - let response; - let screenshot; - try { - const testName = 'joinWebcamAndMicrophone'; - await test.logger('begin of ', testName); - await test.init(true, false, testName); - await test.startRecording(testName); - await test.webcamLayoutStart(); - response = await test.webcamLayoutTest(testName); - await test.logger('end of ', testName); - await test.stopRecording(); - screenshot = await test.page.screenshot(); - } catch (err) { - await test.logger(err); - } finally { - await test.close(); - } - expect(response).toBe(true); - Page.checkRegression(10.83, screenshot); - }); -}; -module.exports = exports = webcamLayoutTest; diff --git a/bigbluebutton-tests/puppeteer/webcam/webcamlayout.test.js b/bigbluebutton-tests/puppeteer/webcam/webcamlayout.test.js deleted file mode 100644 index 692ce0dd06..0000000000 --- a/bigbluebutton-tests/puppeteer/webcam/webcamlayout.test.js +++ /dev/null @@ -1,3 +0,0 @@ -const webcamLayoutTest = require('./webcamlayout.obj'); - -describe('Webcams Layout', webcamLayoutTest); From d8ffd698ef257cc8afbd0cb5f502810a5113a891 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 26 Oct 2021 14:52:52 -0300 Subject: [PATCH 03/28] fix minimizePresentation selector --- bigbluebutton-tests/puppeteer/core/elements.js | 1 + .../puppeteer/customparameters/customparameters.js | 4 ++-- bigbluebutton-tests/puppeteer/user/multiusers.js | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-tests/puppeteer/core/elements.js b/bigbluebutton-tests/puppeteer/core/elements.js index 4c2ed4312f..54678d6818 100644 --- a/bigbluebutton-tests/puppeteer/core/elements.js +++ b/bigbluebutton-tests/puppeteer/core/elements.js @@ -156,6 +156,7 @@ exports.stopScreenSharing = 'button[data-test="stopScreenShare"]'; exports.presentationToolbarWrapper = '#presentationToolbarWrapper'; exports.presentationTitle = '[class^="presentationTitle--"]'; exports.hidePresentation = 'button[data-test="hidePresentationButton"]'; +exports.minimizePresentation = 'button[aria-label="Minimize presentation"]'; exports.restorePresentation = 'button[data-test="restorePresentationButton"]'; exports.nextSlide = '[data-test="nextSlide"]'; exports.prevSlide = '[data-test="prevSlide"]'; diff --git a/bigbluebutton-tests/puppeteer/customparameters/customparameters.js b/bigbluebutton-tests/puppeteer/customparameters/customparameters.js index 0787f5945c..088fd4ad3f 100644 --- a/bigbluebutton-tests/puppeteer/customparameters/customparameters.js +++ b/bigbluebutton-tests/puppeteer/customparameters/customparameters.js @@ -574,7 +574,7 @@ class CustomParameters { await this.page2.startRecording(testName); await this.page1.screenshot(`${testName}`, `01-page1-${testName}`); await this.page2.screenshot(`${testName}`, `01-page2-${testName}`); - await this.page2.waitAndClick(e.hidePresentation); + await this.page2.waitAndClick(e.minimizePresentation); await this.page2.screenshot(`${testName}`, `02-page2-${testName}`); const zoomInCase = await util.zoomIn(this.page1); await this.page1.screenshot(`${testName}`, `02-page1-${testName}`); @@ -619,7 +619,7 @@ class CustomParameters { await this.page2.startRecording(testName); await this.page1.screenshot(`${testName}`, `01-page1-${testName}`); await this.page2.screenshot(`${testName}`, `01-page2-${testName}`); - await this.page2.waitAndClick(e.hidePresentation); + await this.page2.waitAndClick(e.minimizePresentation); await this.page2.screenshot(`${testName}`, `02-page2-${testName}`); const pollCase = await util.poll(this.page1, this.page2) === true; await this.page2.waitForSelector(e.smallToastMsg); diff --git a/bigbluebutton-tests/puppeteer/user/multiusers.js b/bigbluebutton-tests/puppeteer/user/multiusers.js index da70a6940a..3b5a44820a 100644 --- a/bigbluebutton-tests/puppeteer/user/multiusers.js +++ b/bigbluebutton-tests/puppeteer/user/multiusers.js @@ -280,8 +280,8 @@ class MultiUsers { await this.page1.waitAndClick(e.userListButton); await this.page2.waitAndClick(e.userListButton); await this.page2.waitAndClick(e.chatButtonKey); - const onUserListPanel = await this.page1.wasRemoved(e.hidePresentation); - const onChatPanel = await this.page2.wasRemoved(e.hidePresentation); + const onUserListPanel = await this.page1.wasRemoved(e.minimizePresentation); + const onChatPanel = await this.page2.wasRemoved(e.minimizePresentation); return onUserListPanel && onChatPanel; } catch (err) { From ff338c019894c36dd09f2354ef3965fdae2cdbb3 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 26 Oct 2021 14:57:40 -0300 Subject: [PATCH 04/28] add Hide/Restore presentation test --- .../presentation-options/component.jsx | 1 + .../puppeteer/core/elements.js | 1 + .../puppeteer/presentation/presentation.js | 19 ++++++++++++++++ .../presentation/presentation.obj.js | 22 +++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/presentation-options/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/presentation-options/component.jsx index 539ade95b8..9f618bef33 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/presentation-options/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/presentation-options/component.jsx @@ -54,6 +54,7 @@ const PresentationOptionsContainer = ({ + ); }); @@ -111,14 +103,6 @@ class TalkingIndicator extends PureComponent { const nobodyTalking = Service.nobodyTalking(talkers); - const style = { - [styles.talker]: true, - [styles.spoke]: nobodyTalking, - // [styles.muted]: false, - [styles.mobileHide]: sidebarNavigationIsOpen - && sidebarContentIsOpen, - }; - const { moreThanMaxIndicatorsTalking, moreThanMaxIndicatorsWereTalking } = intlMessages; const ariaLabel = intl.formatMessage(nobodyTalking @@ -127,9 +111,12 @@ class TalkingIndicator extends PureComponent { }); return ( -