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
fix(tests): Make tests to go through pre-join automatically.
damencho796a7efa7f45
diff --git a/tests/helpers/Participant.ts b/tests/helpers/Participant.tsindex 449d25a5fd..e2c24fe589 100644--- a/tests/helpers/Participant.ts+++ b/tests/helpers/Participant.ts@@ -112,9 +112,6 @@ export class Participant {useStunTurn: false},pcStatsInterval: 1500,- prejoinConfig: {- enabled: false- },toolbarConfig: {alwaysVisible: true}@@ -264,6 +261,20 @@ export class Participant {await this.switchToIFrame();}+ if (!options.skipPrejoinButtonClick+ // @ts-ignore+ && !Boolean(await this.execute(() => config.prejoinConfig?.enabled === false))) {+ // if prejoin is enabled we want to click the join button+ const p1PreJoinScreen = this.getPreJoinScreen();++ await p1PreJoinScreen.waitForLoading();++ const joinButton = p1PreJoinScreen.getJoinButton();++ await joinButton.waitForDisplayed();+ await joinButton.click();+ }+if (!options.skipWaitToJoin) {await this.waitForMucJoinedOrError();}diff --git a/tests/helpers/types.ts b/tests/helpers/types.tsindex 84ab502f06..9463459e3f 100644--- a/tests/helpers/types.ts+++ b/tests/helpers/types.ts@@ -62,6 +62,11 @@ export type IParticipantJoinOptions = {*/skipDisplayName?: boolean;+ /**+ * Whether to skip the prejoin button 'Join' click when joining.+ */+ skipPrejoinButtonClick?: boolean;+/*** Whether to skip waiting for the participant to join the room. Cases like lobby where we do not succeed to join* based on the logic of the test.@@ -101,6 +106,11 @@ export type IJoinOptions = {*/skipInMeetingChecks?: boolean;+ /**+ * Whether to skip the prejoin button 'Join' click when joining.+ */+ skipPrejoinButtonClick?: boolean;+/*** The skip waiting for the participant to join the room setting to pass to IParticipantJoinOptions.*/diff --git a/tests/specs/media/desktopSharing.spec.ts b/tests/specs/media/desktopSharing.spec.tsindex b165c90921..522d109a18 100644--- a/tests/specs/media/desktopSharing.spec.ts+++ b/tests/specs/media/desktopSharing.spec.ts@@ -183,7 +183,8 @@ describe('Desktop sharing', () => {p2p: {backToP2PDelay: 3,enabled: true- }+ },+ startWithAudioMuted: false}});const { p1 } = ctx;@@ -201,7 +202,8 @@ describe('Desktop sharing', () => {p2p: {backToP2PDelay: 3,enabled: true- }+ },+ startWithAudioMuted: false}});const { p2, p3 } = ctx;@@ -304,11 +306,16 @@ describe('Desktop sharing', () => {await ensureTwoParticipants({configOverwrite: {- startWithAudioMuted: true+ startWithAudioMuted: true,+ startWithVideoMuted: false},skipInMeetingChecks: true});await ensureThreeParticipants({+ configOverwrite: {+ startWithAudioMuted: false,+ startWithVideoMuted: false+ },skipInMeetingChecks: true});const { p2, p3 } = ctx;@@ -334,7 +341,12 @@ describe('Desktop sharing', () => {it('with lastN', async () => {await hangupAllParticipants();- await ensureThreeParticipants();+ await ensureThreeParticipants({+ configOverwrite: {+ startWithAudioMuted: false,+ startWithVideoMuted: false+ },+ });const { p1, p2, p3 } = ctx;await p3.getToolbar().clickDesktopSharingButton();@@ -345,7 +357,8 @@ describe('Desktop sharing', () => {await ensureFourParticipants({configOverwrite: {channelLastN: 2,- startWithAudioMuted: true+ startWithAudioMuted: true,+ startWithVideoMuted: false}});const { p4 } = ctx;diff --git a/tests/specs/media/startMuted.spec.ts b/tests/specs/media/startMuted.spec.tsindex b9bf5a8523..5c5bffcd01 100644--- a/tests/specs/media/startMuted.spec.ts+++ b/tests/specs/media/startMuted.spec.ts@@ -190,6 +190,7 @@ describe('Start muted', () => {const options = {configOverwrite: {startWithAudioMuted: true,+ startWithVideoMuted: false,testing: {testMode: true,debugAudioLevels: true@@ -228,7 +229,9 @@ describe('Start muted', () => {},p2p: {enabled: true- }+ },+ startWithAudioMuted: false,+ startWithVideoMuted: false}});diff --git a/tests/specs/misc/xmppConferenceRequest.spec.ts b/tests/specs/misc/xmppConferenceRequest.spec.tsindex db96f0905a..9ef42a3a07 100644--- a/tests/specs/misc/xmppConferenceRequest.spec.ts+++ b/tests/specs/misc/xmppConferenceRequest.spec.ts@@ -10,6 +10,7 @@ describe('XMPP Conference Request', () => {it('join with conferenceRequestUrl disabled', async () => {await ensureOneParticipant({skipWaitToJoin: true,+ skipPrejoinButtonClick: true,configOverwrite: {prejoinConfig: {enabled: truediff --git a/tests/specs/moderation/lobby.spec.ts b/tests/specs/moderation/lobby.spec.tsindex f1df35592f..c35bd52852 100644--- a/tests/specs/moderation/lobby.spec.ts+++ b/tests/specs/moderation/lobby.spec.ts@@ -49,7 +49,7 @@ describe('Lobby', () => {// media is being receiving and there are two remote streamsawait p3.waitToJoinMUC();await p3.waitForIceConnected();- await p3.waitForSendReceiveData();+ await p3.waitForReceiveMedia();await p3.waitForRemoteStreams(2);// now check third one display name in the room, is the one set in the prejoin screen@@ -107,7 +107,7 @@ describe('Lobby', () => {// media is being receiving and there are two remote streamsawait p3.waitToJoinMUC();await p3.waitForIceConnected();- await p3.waitForSendReceiveData();+ await p3.waitForReceiveMedia();await p3.waitForRemoteStreams(2);// now check third one display name in the room, is the one set in the prejoin screen@@ -275,7 +275,7 @@ describe('Lobby', () => {await p3.waitToJoinMUC();await p3.waitForIceConnected();- await p3.waitForSendReceiveData();+ await p3.waitForReceiveMedia();});it('enable with more than two participants', async () => {@@ -430,19 +430,18 @@ async function enableLobby() {async function enterLobby(participant: Participant, enterDisplayName = false, usePreJoin = false) {const options: IJoinOptions = { };- if (usePreJoin) {- options.configOverwrite = {- prejoinConfig: {- enabled: true- }- };- }+ options.configOverwrite = {+ prejoinConfig: {+ enabled: usePreJoin+ }+ };await ensureThreeParticipants({...options,skipDisplayName: true,skipWaitToJoin: true,- skipInMeetingChecks: true+ skipInMeetingChecks: true,+ skipPrejoinButtonClick: true});const { p3 } = ctx;diff --git a/tests/specs/ui/preJoin.spec.ts b/tests/specs/ui/preJoin.spec.tsindex dfb1d55a0a..88492d74cc 100644--- a/tests/specs/ui/preJoin.spec.ts+++ b/tests/specs/ui/preJoin.spec.ts@@ -15,7 +15,8 @@ describe('Pre-join screen', () => {requireDisplayName: true},skipDisplayName: true,- skipWaitToJoin: true+ skipWaitToJoin: true,+ skipPrejoinButtonClick: true});const p1PreJoinScreen = ctx.p1.getPreJoinScreen();@@ -42,7 +43,8 @@ describe('Pre-join screen', () => {}},skipDisplayName: true,- skipWaitToJoin: true+ skipWaitToJoin: true,+ skipPrejoinButtonClick: true});const p1PreJoinScreen = ctx.p1.getPreJoinScreen();@@ -64,7 +66,8 @@ describe('Pre-join screen', () => {}},skipDisplayName: true,- skipWaitToJoin: true+ skipWaitToJoin: true,+ skipPrejoinButtonClick: true});const { p1 } = ctx;@@ -111,7 +114,8 @@ describe('Pre-join screen', () => {}},skipDisplayName: true,- skipWaitToJoin: true+ skipWaitToJoin: true,+ skipPrejoinButtonClick: true});const p1PreJoinScreen = ctx.p2.getPreJoinScreen();