Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(tests): Adds visitors go live test.
damencho0897db3efcf0
diff --git a/react/features/base/connection/actions.native.ts b/react/features/base/connection/actions.native.tsindex f71646421e..08045f4834 100644--- a/react/features/base/connection/actions.native.ts+++ b/react/features/base/connection/actions.native.ts@@ -8,6 +8,7 @@ import { setJWT } from '../jwt/actions';import { JitsiConnectionErrors } from '../lib-jitsi-meet';import { _connectInternal } from './actions.native';+import logger from './logger';export * from './actions.any';@@ -34,6 +35,8 @@ export function connect(id?: string, password?: string) {j && dispatch(setJWT(j));return dispatch(_connectInternal(id, password));+ }).catch(e => {+ logger.error('Connection error', e);});}diff --git a/react/features/base/connection/actions.web.ts b/react/features/base/connection/actions.web.tsindex 2c997af642..b547bbac89 100644--- a/react/features/base/connection/actions.web.ts+++ b/react/features/base/connection/actions.web.ts@@ -11,6 +11,7 @@ import LocalRecordingManager from '../../recording/components/Recording/LocalRecimport { setJWT } from '../jwt/actions';import { _connectInternal } from './actions.any';+import logger from './logger';export * from './actions.any';@@ -38,6 +39,8 @@ export function connect(id?: string, password?: string) {j && dispatch(setJWT(j));return dispatch(_connectInternal(id, password));+ }).catch(e => {+ logger.error('Connection error', e);});}diff --git a/react/features/visitors/components/web/VisitorsQueue.tsx b/react/features/visitors/components/web/VisitorsQueue.tsxindex 57dcfde9d5..ddd461ee8e 100644--- a/react/features/visitors/components/web/VisitorsQueue.tsx+++ b/react/features/visitors/components/web/VisitorsQueue.tsx@@ -78,7 +78,9 @@ export default function VisitorsQueue() {const { classes } = useStyles();const { t } = useTranslation();- return (<div className = { classes.container }>+ return (<div+ className = { classes.container }+ id = 'visitors-waiting-queue'><div className = { classes.content }><div className = { classes.contentControls }><span className = { classes.roomName }>diff --git a/tests/pageobjects/Visitors.ts b/tests/pageobjects/Visitors.tsindex ba5ba8959c..c2f16d47b2 100644--- a/tests/pageobjects/Visitors.ts+++ b/tests/pageobjects/Visitors.ts@@ -31,4 +31,33 @@ export default class Visitors extends BasePageObject {return this.participant.driver.$('#visitor-list-header').getText();}++ /**+ * Whether the visitors queue UI is shown.+ */+ isVisitorsQueueUIShown() {+ return this.participant.driver.$('#visitors-waiting-queue').isDisplayed();+ }++ /**+ * Returns the name of the knocking participant (the only one) that is displayed on the notification.+ */+ async getWaitingVisitorsInQueue() {+ const goLiveNotification+ = this.participant.driver.$('//div[@data-testid="notify.waitingVisitors"]');++ await goLiveNotification.waitForDisplayed({+ timeout: 3000,+ timeoutMsg: 'Go live notification not displayed'+ });++ return await goLiveNotification.getText();+ }++ /**+ * Clicks the go live button in the visitors notification.+ */+ async goLive() {+ return this.participant.driver.$('//button[@data-testid="participantsPane.actions.goLive"]').click();+ }}diff --git a/tests/specs/2way/iFrameApiVisitorsLive.spec.ts b/tests/specs/2way/iFrameApiVisitorsLive.spec.tsnew file mode 100644index 0000000000..6a62a49c7d--- /dev/null+++ b/tests/specs/2way/iFrameApiVisitorsLive.spec.ts@@ -0,0 +1,76 @@+import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/participants';+import { expect } from '@wdio/globals';++describe('Visitors', () => {+ it('joining the meeting', async () => {+ const { webhooksProxy } = ctx;++ if (webhooksProxy) {+ webhooksProxy.defaultMeetingSettings = {+ visitorsEnabled: true,+ visitorsLive: false+ };+ }++ await ensureOneParticipant(ctx);++ const { p1 } = ctx;++ if (await p1.execute(() => config.disableIframeAPI)) {+ // skip the test if iframeAPI is disabled or visitors are not supported+ ctx.skipSuiteTests = true;++ return;+ }++ await p1.driver.waitUntil(() => p1.execute(() => APP.conference._room.isVisitorsSupported()), {+ timeout: 2000+ }).then(async () => {+ await p1.switchToAPI();+ }).catch(() => {+ ctx.skipSuiteTests = true;+ });+ });+++ it('go live', async () => {+ await ensureTwoParticipants(ctx, {+ preferGenerateToken: true,+ visitor: true,+ skipWaitToJoin: true,+ skipInMeetingChecks: true+ });++ const { p1, p2 } = ctx;+ const p2Visitors = p2.getVisitors();+ const p1Visitors = p1.getVisitors();++ await p2.driver.waitUntil(async () => p2Visitors.isVisitorsQueueUIShown(), {+ timeout: 5000,+ timeoutMsg: 'Missing visitors queue UI'+ });++ await p1.driver.waitUntil(async () => await p1Visitors.getWaitingVisitorsInQueue()+ === 'Viewers waiting in queue: 1', {+ timeout: 15000,+ timeoutMsg: 'Missing visitors queue count in UI'+ });++ await p1Visitors.goLive();++ await p2.waitToJoinMUC();++ await p2.waitForSendReceiveData({+ checkSend: false,+ msg: 'Visitor is not receiving media'+ }).then(() => p2.waitForRemoteStreams(1));++ await p2.driver.waitUntil(() => p2Visitors.hasVisitorsDialog(), {+ timeout: 5000,+ timeoutMsg: 'Missing visitors dialog'+ });++ expect((await p1Visitors.getVisitorsCount()).trim()).toBe('1');+ expect((await p1Visitors.getVisitorsHeaderFromParticipantsPane()).trim()).toBe('Viewers 1');+ });+});