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): Updates join logic. (#16320)
Дамян Минков85522aea25ba
diff --git a/tests/env.example b/tests/env.exampleindex 38fb805c87..8f3d62d022 100644--- a/tests/env.example+++ b/tests/env.example@@ -26,14 +26,13 @@# Configure properties for jaas-specific tests (specs/jaas). Note that some of the iFrame tests can also# be used to test JaaS, they are configured separately via IFRAME_TENANT, JWT_KID, JWT_PRIVATE_KEY_PATH.-# Domain for the JaaS environment, e.g. stage.8x8.vc-JAAS_DOMAIN=+# Make sure this tenant is configured to not allow guests.# The key ID-JAAS_KID=+#JAAS_KID=# The path to the private key used for generating JWT token (.pk) for jaas-specific tests-JAAS_PRIVATE_KEY_PATH=+#JAAS_PRIVATE_KEY_PATH=# The JaaS tenant, e.g. vpaas-magic-cookie-abcdabcd1234567890-JAAS_TENANT=+#JAAS_TENANT=# An access token to use to create meetings (used for the first participant)#JWT_ACCESS_TOKEN=@@ -67,7 +66,7 @@ JAAS_TENANT=# A shared secret to authenticate the webhook proxy connection#WEBHOOKS_PROXY_SHARED_SECRET=-# The address of the webhooks proxy used to test the webhooks feature (e.g. wss://your.service/?tenant=sometenant)+# The address of the webhooks proxy used to test the webhooks feature (e.g. wss://your.service)#WEBHOOKS_PROXY_URL=# A stream key abd broadcast ID that can be used by the tests to stream to YouTubediff --git a/tests/helpers/Participant.ts b/tests/helpers/Participant.tsindex acfb23241d..dd04e52643 100644--- a/tests/helpers/Participant.ts+++ b/tests/helpers/Participant.ts@@ -13,7 +13,11 @@ import IframeAPI from '../pageobjects/IframeAPI';import InviteDialog from '../pageobjects/InviteDialog';import LargeVideo from '../pageobjects/LargeVideo';import LobbyScreen from '../pageobjects/LobbyScreen';-import Notifications, { TOKEN_AUTH_FAILED_TEST_ID, TOKEN_AUTH_FAILED_TITLE_TEST_ID } from '../pageobjects/Notifications';+import Notifications, {+ MAX_USERS_TEST_ID,+ TOKEN_AUTH_FAILED_TEST_ID,+ TOKEN_AUTH_FAILED_TITLE_TEST_ID+} from '../pageobjects/Notifications';import ParticipantsPane from '../pageobjects/ParticipantsPane';import PasswordDialog from '../pageobjects/PasswordDialog';import PreJoinScreen from '../pageobjects/PreJoinScreen';@@ -137,9 +141,10 @@ export class Participant {script: string | ((...innerArgs: InnerArguments) => ReturnValue),...args: InnerArguments): Promise<ReturnValue> {try {+ // @ts-ignorereturn await this.driver.execute(script, ...args);} catch (error) {- console.error('An error occured while trying to execute a script: ', error);+ console.error('An error occurred while trying to execute a script: ', error);throw error;}}@@ -186,7 +191,7 @@ export class Participant {/*** Joins conference.*- * @param {IJoinOptions} options - Options for joining.+ * @param {IParticipantJoinOptions} options - Options for joining.* @returns {Promise<void>}*/async joinConference(options: IParticipantJoinOptions): Promise<void> {@@ -231,10 +236,6 @@ export class Participant {url = `${url}&jwt="${this._token.jwt}"`;}- if (options.baseUrl) {- this.driver.options.baseUrl = options.baseUrl;- }-await this.driver.setTimeout({ 'pageLoad': 30000 });// drop the leading '/' so we can use the tenant if any@@ -255,7 +256,7 @@ export class Participant {}if (!options.skipWaitToJoin) {- await this.waitToJoinMUC();+ await this.waitForMucJoinedOrError();}await this.postLoadProcess();@@ -339,16 +340,17 @@ export class Participant {/*** Waits until either the MUC is joined, or a password prompt is displayed, or an authentication failure- * notification is displayed.+ * notification is displayed, or max users notification is displayed.*/async waitForMucJoinedOrError(): Promise<void> {await this.driver.waitUntil(async () => {return await this.isInMuc() || await this.getPasswordDialog().isOpen()+ || await this.getNotifications().getNotificationText(MAX_USERS_TEST_ID)|| await this.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TEST_ID)|| await this.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TITLE_TEST_ID);}, {timeout: 10_000,- timeoutMsg: 'Timeout waiting for MUC joined or password prompt.'+ timeoutMsg: 'Timeout waiting for MUC joined or error.'});}diff --git a/tests/helpers/participants.ts b/tests/helpers/participants.tsindex 4e096766ce..3c5a4f7c12 100644--- a/tests/helpers/participants.ts+++ b/tests/helpers/participants.ts@@ -1,36 +1,55 @@import process from 'node:process';import { P1, P2, P3, P4, Participant } from './Participant';-import { IToken, generateToken } from './token';-import { IContext, IJoinOptions } from './types';+import { generateToken } from './token';+import { IJoinOptions, IParticipantOptions } from './types';const SUBJECT_XPATH = '//div[starts-with(@class, "subject-text")]';/*** Ensure that there is on participant.+ * Ensure that the first participant is moderator if there is such an option.*- * @param {IContext} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.* @returns {Promise<void>}*/-export async function ensureOneParticipant(ctx: IContext, options?: IJoinOptions): Promise<void> {- await joinTheModeratorAsP1(ctx, options);+export async function ensureOneParticipant(options?: IJoinOptions): Promise<void> {+ const participantOps = { name: P1 } as IParticipantOptions;++ if (!options?.skipFirstModerator) {+ const jwtPrivateKeyPath = process.env.JWT_PRIVATE_KEY_PATH;++ // we prioritize the access token when iframe is not used and private key is set,+ // otherwise if private key is not specified we use the access token if set+ if (process.env.JWT_ACCESS_TOKEN+ && ((jwtPrivateKeyPath && !ctx.testProperties.useIFrameApi && !options?.preferGenerateToken)+ || !jwtPrivateKeyPath)) {+ participantOps.token = { jwt: process.env.JWT_ACCESS_TOKEN };+ } else if (jwtPrivateKeyPath) {+ participantOps.token = generateToken({+ ...options?.tokenOptions,+ displayName: participantOps.name,+ });+ }+ }++ // make sure the first participant is moderator, if supported by deployment+ await joinParticipant(participantOps, options);}/*** Ensure that there are three participants.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.* @returns {Promise<void>}*/-export async function ensureThreeParticipants(ctx: IContext, options?: IJoinOptions): Promise<void> {- await joinTheModeratorAsP1(ctx, options);+export async function ensureThreeParticipants(options?: IJoinOptions): Promise<void> {+ await ensureOneParticipant(options);// these need to be all, so we get the error when one failsawait Promise.all([- _joinParticipant(P2, ctx, options),- _joinParticipant(P3, ctx, options)+ joinParticipant({ name: P2 }, options),+ joinParticipant({ name: P3 }, options)]);if (options?.skipInMeetingChecks) {@@ -52,51 +71,47 @@ export async function ensureThreeParticipants(ctx: IContext, options?: IJoinOpti/*** Creates the first participant instance or prepares one for re-joining.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.* @returns {Promise<void>}*/-export function joinFirstParticipant(ctx: IContext, options: IJoinOptions = {}): Promise<void> {- return joinTheModeratorAsP1(ctx, options);+export function joinFirstParticipant(options: IJoinOptions = { }): Promise<void> {+ return ensureOneParticipant(options);}/*** Creates the second participant instance or prepares one for re-joining.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.- * @returns {Promise<void>}+ * @returns {Promise<Participant>}*/-export function joinSecondParticipant(ctx: IContext, options?: IJoinOptions): Promise<void> {- return _joinParticipant(P2, ctx, options);+export function joinSecondParticipant(options?: IJoinOptions): Promise<Participant> {+ return joinParticipant({ name: P2 }, options);}/*** Creates the third participant instance or prepares one for re-joining.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.- * @returns {Promise<void>}+ * @returns {Promise<Participant>}*/-export function joinThirdParticipant(ctx: IContext, options?: IJoinOptions): Promise<void> {- return _joinParticipant(P3, ctx, options);+export function joinThirdParticipant(options?: IJoinOptions): Promise<Participant> {+ return joinParticipant({ name: P3 }, options);}/*** Ensure that there are four participants.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to use when joining the participant.* @returns {Promise<void>}*/-export async function ensureFourParticipants(ctx: IContext, options?: IJoinOptions): Promise<void> {- await joinTheModeratorAsP1(ctx, options);+export async function ensureFourParticipants(options?: IJoinOptions): Promise<void> {+ await ensureOneParticipant(options);// these need to be all, so we get the error when one failsawait Promise.all([- _joinParticipant(P2, ctx, options),- _joinParticipant(P3, ctx, options),- _joinParticipant(P4, ctx, options)+ joinParticipant({ name: P2 }, options),+ joinParticipant({ name: P3 }, options),+ joinParticipant({ name: P4 }, options)]);if (options?.skipInMeetingChecks) {@@ -117,28 +132,24 @@ export async function ensureFourParticipants(ctx: IContext, options?: IJoinOptio]);}-/**- * Ensure that the first participant is moderator.- *- * @param {Object} ctx - The context.- * @param {IJoinOptions} options - The options to join.- * @returns {Promise<void>}- */-async function joinTheModeratorAsP1(ctx: IContext, options?: IJoinOptions) {- // make sure the first participant is moderator, if supported by deployment- await _joinParticipant(P1, ctx, options);-}-/*** Ensure that there are two participants.*- * @param {Object} ctx - The context.* @param {IJoinOptions} options - The options to join.*/-export async function ensureTwoParticipants(ctx: IContext, options?: IJoinOptions): Promise<void> {- await joinTheModeratorAsP1(ctx, options);+export async function ensureTwoParticipants(options?: IJoinOptions): Promise<void> {+ await ensureOneParticipant(options);- await _joinParticipant(P2, ctx, options);+ const participantOptions = { name: P2 } as IParticipantOptions;++ if (options?.preferGenerateToken) {+ participantOptions.token = generateToken({+ ...options?.tokenOptions,+ displayName: participantOptions.name,+ });+ }++ await joinParticipant({ name: P2 }, options);if (options?.skipInMeetingChecks) {return Promise.resolve();@@ -156,17 +167,18 @@ export async function ensureTwoParticipants(ctx: IContext, options?: IJoinOption/*** Creates a participant instance or prepares one for re-joining.- * @param name - The name of the participant.- * @param {IContext} ctx - The context.+ * @param participantOptions - The participant options, with required name set.* @param {boolean} options - Join options.+ * @returns {Promise<Participant>} - The participant instance.*/-async function _joinParticipant( // eslint-disable-line max-params- name: string,- ctx: IContext,- options?: IJoinOptions) {+export async function joinParticipant( // eslint-disable-line max-params+ participantOptions: IParticipantOptions,+ options?: IJoinOptions): Promise<Participant> {++ participantOptions.iFrameApi = ctx.testProperties.useIFrameApi;// @ts-ignore- const p = ctx[name] as Participant;+ const p = ctx[participantOptions.name] as Participant;if (p) {if (ctx.testProperties.useIFrameApi) {@@ -174,7 +186,7 @@ async function _joinParticipant( // eslint-disable-line max-params}if (await p.isInMuc()) {- return;+ return p;}if (ctx.testProperties.useIFrameApi) {@@ -188,39 +200,13 @@ async function _joinParticipant( // eslint-disable-line max-params// we want the participant instance re-recreated so we clear any kept state, like endpoint ID}- let token: IToken = { jwt: '' };-- if (name === P1) {- if (!options?.skipFirstModerator) {- // we prioritize the access token when iframe is not used and private key is set,- // otherwise if private key is not specified we use the access token if set- if (process.env.JWT_ACCESS_TOKEN- && ((ctx.jwtPrivateKeyPath && !ctx.testProperties.useIFrameApi && !options?.preferGenerateToken)- || !ctx.jwtPrivateKeyPath)) {- token = { jwt: process.env.JWT_ACCESS_TOKEN };- } else if (ctx.jwtPrivateKeyPath) {- token = generateToken({- ...options?.tokenOptions,- displayName: name,- });- }- }- } else if (name === P2) {- if (options?.preferGenerateToken) {- token = generateToken({- ...options?.tokenOptions,- displayName: name,- });- }- }-- const newParticipant = new Participant({ name, token, iFrameApi: ctx.testProperties.useIFrameApi });+ const newParticipant = new Participant(participantOptions);// set the new participant instance// @ts-ignore- ctx[name] = newParticipant;+ ctx[participantOptions.name] = newParticipant;- let forceTenant;+ let forceTenant = options?.forceTenant;if (options?.preferGenerateToken && !ctx.testProperties.useIFrameApi&& process.env.JWT_KID?.startsWith('vpaas-magic-cookie-') && process.env.IFRAME_TENANT) {@@ -229,8 +215,10 @@ async function _joinParticipant( // eslint-disable-line max-paramsawait newParticipant.joinConference({...options,forceTenant,- roomName: ctx.roomName,+ roomName: options?.roomName || ctx.roomName,});++ return newParticipant;}/**diff --git a/tests/helpers/types.ts b/tests/helpers/types.tsindex 71fd80a95c..2876d32de2 100644--- a/tests/helpers/types.ts+++ b/tests/helpers/types.ts@@ -10,9 +10,6 @@ export type IContext = {* Whether the configuration specifies a JaaS account for the iFrame API tests.*/iFrameUsesJaas: boolean;- jwtKid: string;- jwtPrivateKeyPath: string;- keepAlive: Array<any>;p1: Participant;p2: Participant;p3: Participant;@@ -37,10 +34,6 @@ export type IParticipantOptions = {* Options for joinConference.*/export type IParticipantJoinOptions = {- /**- * Overwrites the base url set in the config.- */- baseUrl?: string;/*** Config overwrites to use.@@ -70,14 +63,14 @@ export type IParticipantJoinOptions = {export type IJoinOptions = {/**- * Overwrites the base url set in the config.+ * Config overwrites to pass to IParticipantJoinOptions.*/- baseUrl?: string;+ configOverwrite?: IConfig;/**- * Config overwrites to use.+ * An optional tenant to use. If provided the URL is prepended with /$forceTenant*/- configOverwrite?: IConfig;+ forceTenant?: string;/*** When joining the first participant and jwt singing material is available and a provided token@@ -86,7 +79,12 @@ export type IJoinOptions = {preferGenerateToken?: boolean;/**- * Whether to skip setting display name.+ * To be able to override the ctx generated room name. If missing the one from the context will be used.+ */+ roomName?: string;++ /**+ *The skip display name setting to pass to IParticipantJoinOptions.*/skipDisplayName?: boolean;@@ -101,8 +99,7 @@ export type IJoinOptions = {skipInMeetingChecks?: 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.+ * The skip waiting for the participant to join the room setting to pass to IParticipantJoinOptions.*/skipWaitToJoin?: boolean;diff --git a/tests/pageobjects/Notifications.ts b/tests/pageobjects/Notifications.tsindex 710d11ae1f..b47dfd2f6a 100644--- a/tests/pageobjects/Notifications.ts+++ b/tests/pageobjects/Notifications.ts@@ -19,6 +19,7 @@ const REENABLE_SELF_VIEW_CLOSE_NOTIFICATION = 'notify.selfViewTitle-dismiss';const REENABLE_SELF_VIEW_NOTIFICATION_ID = 'notify.selfViewTitle';const YOU_ARE_MUTED_TEST_ID = 'notify.mutedTitle';+export const MAX_USERS_TEST_ID = 'dialog.maxUsersLimitReached';export const TOKEN_AUTH_FAILED_TEST_ID = 'dialog.tokenAuthFailed';export const TOKEN_AUTH_FAILED_TITLE_TEST_ID = 'dialog.tokenAuthFailedTitle';diff --git a/tests/specs/2way/audioOnly.spec.ts b/tests/specs/2way/audioOnly.spec.tsindex b87c786f3a..8e1a6c6773 100644--- a/tests/specs/2way/audioOnly.spec.ts+++ b/tests/specs/2way/audioOnly.spec.ts@@ -1,7 +1,7 @@import { ensureTwoParticipants } from '../../helpers/participants';describe('Audio only', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());/*** Enables audio only mode for p1 and verifies that the other participant sees participant1 as video muted.diff --git a/tests/specs/2way/displayName.spec.ts b/tests/specs/2way/displayName.spec.tsindex aaa85a94f0..106a0c2ca4 100644--- a/tests/specs/2way/displayName.spec.ts+++ b/tests/specs/2way/displayName.spec.ts@@ -1,7 +1,7 @@import { ensureTwoParticipants } from '../../helpers/participants';describe('DisplayName', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx, { skipDisplayName: true }));+ it('joining the meeting', () => ensureTwoParticipants({ skipDisplayName: true }));it('check change', async () => {const { p1, p2 } = ctx;@@ -32,7 +32,7 @@ describe('DisplayName', () => {await p2.hangup();- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({skipDisplayName: true});diff --git a/tests/specs/2way/endConference.spec.ts b/tests/specs/2way/endConference.spec.tsindex 1ae9904aac..ba0061b4f9 100644--- a/tests/specs/2way/endConference.spec.ts+++ b/tests/specs/2way/endConference.spec.ts@@ -1,7 +1,7 @@import { ensureTwoParticipants } from '../../helpers/participants';describe('End Conference', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('hangup call and check', async () => {const { p1 } = ctx;diff --git a/tests/specs/2way/fakeDialInAudio.spec.ts b/tests/specs/2way/fakeDialInAudio.spec.tsindex 94520e322c..c949ca5f89 100644--- a/tests/specs/2way/fakeDialInAudio.spec.ts+++ b/tests/specs/2way/fakeDialInAudio.spec.ts@@ -14,7 +14,7 @@ describe('Fake Dial-In', () => {return;}- await ensureOneParticipant(ctx);+ await ensureOneParticipant();// check dial-in is enabled, so skipif (await isDialInEnabled(ctx.p1)) {@@ -34,7 +34,7 @@ describe('Fake Dial-In', () => {return;}- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();});it('wait for audio from second participant', async () => {diff --git a/tests/specs/2way/grantModerator.spec.ts b/tests/specs/2way/grantModerator.spec.tsindex 5b914f771c..f035ddde45 100644--- a/tests/specs/2way/grantModerator.spec.ts+++ b/tests/specs/2way/grantModerator.spec.ts@@ -2,7 +2,7 @@ import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/partidescribe('Grant moderator', () => {it('joining the meeting', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();if (await ctx.p1.execute(() => typeof APP.conference._room.grantOwner !== 'function')) {ctx.skipSuiteTests = true;@@ -10,7 +10,7 @@ describe('Grant moderator', () => {return;}- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();});it('grant moderator and validate', async () => {diff --git a/tests/specs/2way/kick.spec.ts b/tests/specs/2way/kick.spec.tsindex 8bb95fbf16..27be2ffdb4 100644--- a/tests/specs/2way/kick.spec.ts+++ b/tests/specs/2way/kick.spec.ts@@ -2,7 +2,7 @@ import { ensureTwoParticipants } from '../../helpers/participants';describe('Kick', () => {it('joining the meeting', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();if (!await ctx.p1.isModerator()) {ctx.skipSuiteTests = true;@@ -12,7 +12,7 @@ describe('Kick', () => {it('kick and check', () => kickParticipant2AndCheck());it('kick p2p and check', async () => {- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({configOverwrite: {p2p: {enabled: truediff --git a/tests/specs/2way/lockRoom.spec.ts b/tests/specs/2way/lockRoom.spec.tsindex cd0a77c1f6..ea8cd28b9f 100644--- a/tests/specs/2way/lockRoom.spec.ts+++ b/tests/specs/2way/lockRoom.spec.ts@@ -14,13 +14,13 @@ let roomKey: string;* the padlock is unlocked.*/describe('Lock Room', () => {- it('joining the meeting', () => ensureOneParticipant(ctx));+ it('joining the meeting', () => ensureOneParticipant());it('locks the room', () => participant1LockRoom());it('enter participant in locked room', async () => {// first enter wrong pin then correct one- await joinSecondParticipant(ctx, {+ await joinSecondParticipant({skipWaitToJoin: true,skipInMeetingChecks: true});@@ -61,7 +61,7 @@ describe('Lock Room', () => {// Just enter the room and check that is not locked.// if we fail to unlock the room this one will detect it// as participant will fail joining- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p2 } = ctx;const p2SecurityDialog = p2.getSecurityDialog();@@ -97,7 +97,7 @@ describe('Lock Room', () => {// should enter of unlocked room.await ctx.p2.hangup();await participant1LockRoom();- await joinSecondParticipant(ctx, {+ await joinSecondParticipant({skipWaitToJoin: true,skipInMeetingChecks: true});diff --git a/tests/specs/2way/mute.spect.ts b/tests/specs/2way/mute.spect.tsindex 8e848f12a7..dfaab3a4e2 100644--- a/tests/specs/2way/mute.spect.ts+++ b/tests/specs/2way/mute.spect.ts@@ -10,7 +10,7 @@ import {} from '../../helpers/participants';describe('Mute', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('mute p1 and check', () => toggleMuteAndCheck(ctx.p1, ctx.p2, true));@@ -46,7 +46,7 @@ describe('Mute', () => {await p1.getToolbar().clickAudioMuteButton();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p2 } = ctx;@@ -88,7 +88,7 @@ async function toggleMuteAndCheck(async function muteP1BeforeP2JoinsAndScreenshare(p2p: boolean) {await Promise.all([ ctx.p1?.hangup(), ctx.p2?.hangup() ]);- await ensureOneParticipant(ctx, {+ await ensureOneParticipant({configOverwrite: {p2p: {enabled: p2p@@ -100,7 +100,7 @@ async function muteP1BeforeP2JoinsAndScreenshare(p2p: boolean) {await p1.getToolbar().clickVideoMuteButton();- await joinSecondParticipant(ctx, {+ await joinSecondParticipant({configOverwrite: {p2p: {enabled: p2pdiff --git a/tests/specs/2way/preJoin.spec.ts b/tests/specs/2way/preJoin.spec.tsindex d5bd0bb9ae..a7e4222997 100644--- a/tests/specs/2way/preJoin.spec.ts+++ b/tests/specs/2way/preJoin.spec.ts@@ -2,7 +2,7 @@ import { ensureOneParticipant, joinFirstParticipant, joinSecondParticipant } frodescribe('PreJoin', () => {it('display name required', async () => {- await joinFirstParticipant(ctx, {+ await joinFirstParticipant({configOverwrite: {prejoinConfig: {enabled: true,@@ -31,7 +31,7 @@ describe('PreJoin', () => {});it('without lobby', async () => {- await joinFirstParticipant(ctx, {+ await joinFirstParticipant({configOverwrite: {prejoinConfig: {enabled: true,@@ -54,7 +54,7 @@ describe('PreJoin', () => {});it('without audio', async () => {- await joinFirstParticipant(ctx, {+ await joinFirstParticipant({configOverwrite: {prejoinConfig: {enabled: true,@@ -88,7 +88,7 @@ describe('PreJoin', () => {});it('with lobby', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;@@ -102,7 +102,7 @@ describe('PreJoin', () => {await p1SecurityDialog.toggleLobby();await p1SecurityDialog.waitForLobbyEnabled();- await joinSecondParticipant(ctx, {+ await joinSecondParticipant({configOverwrite: {prejoinConfig: {enabled: true,diff --git a/tests/specs/2way/selfView.spec.ts b/tests/specs/2way/selfView.spec.tsindex 29036f9f94..991074eb4f 100644--- a/tests/specs/2way/selfView.spec.ts+++ b/tests/specs/2way/selfView.spec.ts@@ -2,7 +2,7 @@ import type { Participant } from '../../helpers/Participant';import { ensureTwoParticipants } from '../../helpers/participants';describe('Self view', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('hide from menu', async () => {const { p1 } = ctx;diff --git a/tests/specs/2way/singlePort.spec.ts b/tests/specs/2way/singlePort.spec.tsindex e2e28b10c9..8c6f6e5d7a 100644--- a/tests/specs/2way/singlePort.spec.ts+++ b/tests/specs/2way/singlePort.spec.ts@@ -2,7 +2,7 @@ import type { Participant } from '../../helpers/Participant';import { ensureTwoParticipants } from '../../helpers/participants';describe('Single port', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('test', async () => {const { p1, p2 } = ctx;diff --git a/tests/specs/2way/stopVideo.spec.ts b/tests/specs/2way/stopVideo.spec.tsindex 8122a95284..4b0dbe7d9e 100644--- a/tests/specs/2way/stopVideo.spec.ts+++ b/tests/specs/2way/stopVideo.spec.ts@@ -1,7 +1,7 @@import { ensureTwoParticipants, muteVideoAndCheck, unmuteVideoAndCheck } from '../../helpers/participants';describe('Stop video', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('stop video and check', () => muteVideoAndCheck(ctx.p1, ctx.p2));@@ -30,7 +30,7 @@ describe('Stop video', () => {await p1.getToolbar().clickVideoMuteButton();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p2 } = ctx;diff --git a/tests/specs/2way/subject.spec.ts b/tests/specs/2way/subject.spec.tsindex 14c3280dfb..dc99b8fce4 100644--- a/tests/specs/2way/subject.spec.ts+++ b/tests/specs/2way/subject.spec.ts@@ -5,7 +5,7 @@ const MY_TEST_SUBJECT = 'My Test Subject';const SUBJECT_XPATH = '//div[starts-with(@class, "subject-text")]';describe('Subject', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx, {+ it('joining the meeting', () => ensureTwoParticipants({configOverwrite: {subject: MY_TEST_SUBJECT}diff --git a/tests/specs/2way/switchVideo.spec.ts b/tests/specs/2way/switchVideo.spec.tsindex bb7e6c0f6d..f9514eb44a 100644--- a/tests/specs/2way/switchVideo.spec.ts+++ b/tests/specs/2way/switchVideo.spec.ts@@ -1,7 +1,7 @@import { ensureTwoParticipants } from '../../helpers/participants';describe('SwitchVideo', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('p1 click on local', () => ctx.p1.getFilmstrip().pinParticipant(ctx.p1));diff --git a/tests/specs/2way/udp.spec.ts b/tests/specs/2way/udp.spec.tsindex 6a2d8f9dd5..6884597408 100644--- a/tests/specs/2way/udp.spec.ts+++ b/tests/specs/2way/udp.spec.ts@@ -2,7 +2,7 @@ import type { Participant } from '../../helpers/Participant';import { ensureTwoParticipants } from '../../helpers/participants';describe('UDP', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());it('check', async () => {const { p1, p2 } = ctx;diff --git a/tests/specs/2way/urlNormalisation.spec.ts b/tests/specs/2way/urlNormalisation.spec.tsindex c2d0af7447..bd7e97617a 100644--- a/tests/specs/2way/urlNormalisation.spec.ts+++ b/tests/specs/2way/urlNormalisation.spec.ts@@ -19,15 +19,9 @@ describe('URL Normalisation', () => {throw new Error('baseUrl is not set');}- // we want to extract the host and use a custom tenant- const host = new URL(baseUrl).origin;-- // @ts-ignore- ctx.oldRoomName = ctx.roomName;- ctx.roomName = `${ctx.roomName}@example.com`;-- await ensureTwoParticipants(ctx, {- baseUrl: `${host}/[email protected]/`+ await ensureTwoParticipants({+ forceTenant: '[email protected]',+ roomName: `${ctx.roomName}@example.com`});});@@ -41,6 +35,6 @@ describe('URL Normalisation', () => {expect(parts[1]).toBe('tenantexample.com');// @ts-ignore- expect(parts[2]).toBe(`${ctx.oldRoomName}example.com`);+ expect(parts[2]).toBe(`${ctx.roomName}example.com`);});});diff --git a/tests/specs/3way/activeSpeaker.spec.ts b/tests/specs/3way/activeSpeaker.spec.tsindex 519cfa6d6f..c0403e03fe 100644--- a/tests/specs/3way/activeSpeaker.spec.ts+++ b/tests/specs/3way/activeSpeaker.spec.ts@@ -3,7 +3,7 @@ import { ensureThreeParticipants, muteAudioAndCheck } from '../../helpers/particdescribe('ActiveSpeaker', () => {it('testActiveSpeaker', async () => {- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;diff --git a/tests/specs/3way/audioVideoModeration.spec.ts b/tests/specs/3way/audioVideoModeration.spec.tsindex 0446f68f4e..ba272ad051 100644--- a/tests/specs/3way/audioVideoModeration.spec.ts+++ b/tests/specs/3way/audioVideoModeration.spec.ts@@ -11,7 +11,7 @@ describe('AVModeration', () => {it('check for moderators', async () => {// if all 3 participants are moderators, skip this test- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;@@ -84,7 +84,7 @@ describe('AVModeration', () => {await Promise.all([ ctx.p2.hangup(), ctx.p3.hangup() ]);- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;await p2.getToolbar().clickAudioMuteButton();@@ -103,7 +103,7 @@ describe('AVModeration', () => {// we don't use ensureThreeParticipants to avoid all meeting join checks// all participants are muted and checks for media will fail- await ensureOneParticipant(ctx);+ await ensureOneParticipant();// After p1 re-joins either p2 or p3 is promoted to moderator. They should still be muted.const isP2Moderator = await p2.isModerator();@@ -130,7 +130,7 @@ describe('AVModeration', () => {it('grant moderator', async () => {await hangupAllParticipants();- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;@@ -153,7 +153,7 @@ describe('AVModeration', () => {it('ask to unmute', async () => {await hangupAllParticipants();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1, p2 } = ctx;@@ -191,7 +191,7 @@ describe('AVModeration', () => {it('join moderated', async () => {await hangupAllParticipants();- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const p1ParticipantsPane = ctx.p1.getParticipantsPane();@@ -201,7 +201,7 @@ describe('AVModeration', () => {await p1ParticipantsPane.close();// join with second participant and check- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({skipInMeetingChecks: true});const { p1, p2 } = ctx;diff --git a/tests/specs/3way/avatars.spec.ts b/tests/specs/3way/avatars.spec.tsindex c1680d58cd..6b294fbaa9 100644--- a/tests/specs/3way/avatars.spec.ts+++ b/tests/specs/3way/avatars.spec.ts@@ -9,7 +9,7 @@ const HASH = '38f014e4b7dde0f64f8157d26a8c812e';describe('Avatar', () => {it('setup the meeting', () =>- ensureTwoParticipants(ctx, {+ ensureTwoParticipants({skipDisplayName: true}));@@ -81,7 +81,7 @@ describe('Avatar', () => {expect(p1ThumbSrc).toBe(p1LargeSrc);// Join p2- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({skipDisplayName: true});const { p2 } = ctx;@@ -119,7 +119,7 @@ describe('Avatar', () => {await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);// Start the third participant- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({skipInMeetingChecks: true});@@ -200,7 +200,7 @@ describe('Avatar', () => {await p1.hangup();- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({skipDisplayName: true});p1 = ctx.p1;diff --git a/tests/specs/3way/breakoutRooms.spec.ts b/tests/specs/3way/breakoutRooms.spec.tsindex 145ba93b32..af007c49b3 100644--- a/tests/specs/3way/breakoutRooms.spec.ts+++ b/tests/specs/3way/breakoutRooms.spec.ts@@ -14,7 +14,7 @@ const LIST_ITEM_CONTAINER = 'list-item-container';describe('BreakoutRooms', () => {it('check support', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();if (!await ctx.p1.isBreakoutRoomsSupported()) {ctx.skipSuiteTests = true;@@ -165,7 +165,7 @@ describe('BreakoutRooms', () => {});it('auto assign', async () => {- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2 } = ctx;const p1BreakoutRooms = p1.getBreakoutRooms();@@ -322,7 +322,7 @@ describe('BreakoutRooms', () => {// Respect room name suffix as it is important in multi-shard testingctx.roomName += `new-${ctx.roomName}`;- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1, p2 } = ctx;const p1BreakoutRooms = p1.getBreakoutRooms();diff --git a/tests/specs/3way/codecSelection.spec.ts b/tests/specs/3way/codecSelection.spec.tsindex 63b8c9c253..a585544efd 100644--- a/tests/specs/3way/codecSelection.spec.ts+++ b/tests/specs/3way/codecSelection.spec.ts@@ -7,7 +7,7 @@ import {describe('Codec selection', () => {it('asymmetric codecs', async () => {- await ensureOneParticipant(ctx, {+ await ensureOneParticipant({configOverwrite: {videoQuality: {codecPreferenceOrder: [ 'VP9', 'VP8', 'AV1' ]@@ -15,7 +15,7 @@ describe('Codec selection', () => {}});- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({configOverwrite: {videoQuality: {codecPreferenceOrder: [ 'VP8', 'VP9', 'AV1' ]@@ -40,7 +40,7 @@ describe('Codec selection', () => {});it('asymmetric codecs with AV1', async () => {- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({configOverwrite: {videoQuality: {codecPreferenceOrder: [ 'AV1', 'VP9', 'VP8' ]@@ -75,7 +75,7 @@ describe('Codec selection', () => {it('codec switch over', async () => {await hangupAllParticipants();- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({configOverwrite: {videoQuality: {codecPreferenceOrder: [ 'VP9', 'VP8', 'AV1' ]@@ -93,7 +93,7 @@ describe('Codec selection', () => {expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({configOverwrite: {videoQuality: {codecPreferenceOrder: [ 'VP8' ]diff --git a/tests/specs/3way/followMe.spec.ts b/tests/specs/3way/followMe.spec.tsindex 18094d4060..218d8d99b5 100644--- a/tests/specs/3way/followMe.spec.ts+++ b/tests/specs/3way/followMe.spec.ts@@ -2,7 +2,7 @@ import { ensureThreeParticipants, ensureTwoParticipants } from '../../helpers/padescribe('Follow Me', () => {it('joining the meeting', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1 } = ctx;@@ -43,7 +43,7 @@ describe('Follow Me', () => {});it('tile view', async () => {- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;diff --git a/tests/specs/3way/lobby.spec.ts b/tests/specs/3way/lobby.spec.tsindex 2f9fe7a1b0..466ad1494a 100644--- a/tests/specs/3way/lobby.spec.ts+++ b/tests/specs/3way/lobby.spec.ts@@ -10,7 +10,7 @@ import type PreMeetingScreen from '../../pageobjects/PreMeetingScreen';describe('Lobby', () => {it('joining the meeting', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();if (!await ctx.p1.execute(() => APP.conference._room.isLobbySupported())) {ctx.skipSuiteTests = true;@@ -18,7 +18,7 @@ describe('Lobby', () => {});it('enable', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();await enableLobby();});@@ -172,7 +172,7 @@ describe('Lobby', () => {});it('disable while participant in lobby', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1 } = ctx;@@ -201,7 +201,7 @@ describe('Lobby', () => {}await hangupAllParticipants();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1, p2 } = ctx;@@ -231,7 +231,7 @@ describe('Lobby', () => {it('shared password', async () => {await hangupAllParticipants();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1 } = ctx;@@ -273,7 +273,7 @@ describe('Lobby', () => {it('enable with more than two participants', async () => {await hangupAllParticipants();- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();await enableLobby();@@ -312,7 +312,7 @@ describe('Lobby', () => {it('reject and approve in pre-join', async () => {await hangupAllParticipants();- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();await enableLobby();const { p1 } = ctx;@@ -414,7 +414,7 @@ async function enableLobby() {* @return the participant name knocking.*/async function enterLobby(participant: Participant, enterDisplayName = false, usePreJoin = false) {- const options: IJoinOptions = {};+ const options: IJoinOptions = { };if (usePreJoin) {options.configOverwrite = {@@ -424,7 +424,7 @@ async function enterLobby(participant: Participant, enterDisplayName = false, us};}- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({...options,skipDisplayName: true,skipWaitToJoin: true,diff --git a/tests/specs/3way/oneOnOne.spec.ts b/tests/specs/3way/oneOnOne.spec.tsindex 28ccee3842..d77a1545dd 100644--- a/tests/specs/3way/oneOnOne.spec.ts+++ b/tests/specs/3way/oneOnOne.spec.ts@@ -16,7 +16,7 @@ const ONE_ON_ONE_CONFIG_OVERRIDES = {describe('OneOnOne', () => {it('filmstrip hidden in 1on1', async () => {- await ensureTwoParticipants(ctx, ONE_ON_ONE_CONFIG_OVERRIDES);+ await ensureTwoParticipants(ONE_ON_ONE_CONFIG_OVERRIDES);const { p1, p2 } = ctx;@@ -28,7 +28,7 @@ describe('OneOnOne', () => {});it('filmstrip visible with more than 2', async () => {- await ensureThreeParticipants(ctx, ONE_ON_ONE_CONFIG_OVERRIDES);+ await ensureThreeParticipants(ONE_ON_ONE_CONFIG_OVERRIDES);const { p1, p2, p3 } = ctx;diff --git a/tests/specs/3way/startMuted.spec.ts b/tests/specs/3way/startMuted.spec.tsindex 639cf3bae0..99e1ea0a64 100644--- a/tests/specs/3way/startMuted.spec.ts+++ b/tests/specs/3way/startMuted.spec.ts@@ -21,7 +21,7 @@ describe('StartMuted', () => {}} };- await ensureOneParticipant(ctx, options);+ await ensureOneParticipant(options);const { p1 } = ctx;const p1EndpointId = await p1.getEndpointId();@@ -40,7 +40,7 @@ describe('StartMuted', () => {await p1.getFilmstrip().assertAudioMuteIconIsDisplayed(p1, true);await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);- await joinSecondParticipant(ctx, {+ await joinSecondParticipant({...options,skipInMeetingChecks: true});@@ -80,7 +80,7 @@ describe('StartMuted', () => {await p1.waitForRemoteVideo(p2EndpointId, false);// Add a third participant and check p3 is able to receive audio and video from p2.- await joinThirdParticipant(ctx, {+ await joinThirdParticipant({...options,skipInMeetingChecks: true});@@ -109,8 +109,8 @@ describe('StartMuted', () => {}};- await ensureOneParticipant(ctx, options);- await joinSecondParticipant(ctx, {+ await ensureOneParticipant(options);+ await joinSecondParticipant({...options,skipInMeetingChecks: true});@@ -120,7 +120,7 @@ describe('StartMuted', () => {await p2.waitForIceConnected();await p2.waitForSendReceiveData({ checkSend: false });- await joinThirdParticipant(ctx, {+ await joinThirdParticipant({...options,skipInMeetingChecks: true});@@ -172,7 +172,7 @@ describe('StartMuted', () => {}};- await ensureTwoParticipants(ctx, options);+ await ensureTwoParticipants(options);const { p1, p2 } = ctx;@@ -201,7 +201,7 @@ describe('StartMuted', () => {}};- await ensureTwoParticipants(ctx, options);+ await ensureTwoParticipants(options);const { p1, p2 } = ctx;@@ -223,8 +223,8 @@ describe('StartMuted', () => {}};- await ensureOneParticipant(ctx, options);- await joinSecondParticipant(ctx, {+ await ensureOneParticipant(options);+ await joinSecondParticipant({configOverwrite: {testing: {testMode: true,@@ -260,7 +260,7 @@ describe('StartMuted', () => {// Mute p2's video just before p3 joins.await p2.getToolbar().clickVideoMuteButton();- await joinThirdParticipant(ctx, {+ await joinThirdParticipant({configOverwrite: {p2p: {enabled: truediff --git a/tests/specs/3way/tileView.spec.ts b/tests/specs/3way/tileView.spec.tsindex 8b4d39c03a..b6bcb79e2a 100644--- a/tests/specs/3way/tileView.spec.ts+++ b/tests/specs/3way/tileView.spec.ts@@ -14,7 +14,7 @@ const FILMSTRIP_VIEW_LOCAL_VIDEO_CSS_SELECTOR = '#filmstripLocalVideo #localVideconst TILE_VIEW_LOCAL_VIDEO_CSS_SELECTOR = '.remote-videos #localVideoContainer';describe('TileView', () => {- it('joining the meeting', () => ensureTwoParticipants(ctx));+ it('joining the meeting', () => ensureTwoParticipants());// TODO: implements etherpad check@@ -68,7 +68,7 @@ describe('TileView', () => {await p2.getToolbar().clickAudioMuteButton();- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({configOverwrite: {channelLastN: 1,startWithAudioMuted: truediff --git a/tests/specs/4way/desktopSharing.spec.ts b/tests/specs/4way/desktopSharing.spec.tsindex 2475fee7c6..dae64483a2 100644--- a/tests/specs/4way/desktopSharing.spec.ts+++ b/tests/specs/4way/desktopSharing.spec.ts@@ -10,7 +10,7 @@ import {describe('Desktop sharing', () => {it('start', async () => {- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({configOverwrite: {p2p: {enabled: true@@ -48,7 +48,7 @@ describe('Desktop sharing', () => {it('p2p to jvb switch', async () => {await ctx.p2.getToolbar().clickDesktopSharingButton();- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;// Check if a remote screen share tile is created on all participants.@@ -81,7 +81,7 @@ describe('Desktop sharing', () => {await checkForScreensharingTile(p1, p1);await checkForScreensharingTile(p1, p2);- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();await checkForScreensharingTile(p1, p3);await checkForScreensharingTile(p2, p3);@@ -112,7 +112,7 @@ describe('Desktop sharing', () => {await checkForScreensharingTile(p2, p1);// Add p3 back to the conference and check if p1 and p2's shares are visible on p3.- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();await checkForScreensharingTile(p1, p3);await checkForScreensharingTile(p2, p3);@@ -129,7 +129,7 @@ describe('Desktop sharing', () => {it('screen sharing toggle before others join', async () => {await hangupAllParticipants();- await ensureOneParticipant(ctx, {+ await ensureOneParticipant({configOverwrite: {p2p: {enabled: true@@ -146,7 +146,7 @@ describe('Desktop sharing', () => {await p1.getToolbar().clickStopDesktopSharingButton();// Call switches to jvb.- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p2, p3 } = ctx;// p1 starts share again when call switches to jvb.@@ -181,7 +181,7 @@ describe('Desktop sharing', () => {it('audio only and non dominant screen share', async () => {await hangupAllParticipants();- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;// a workaround to directly set audio only mode without going through the rest of the settings in the UI@@ -194,7 +194,9 @@ describe('Desktop sharing', () => {}, SET_AUDIO_ONLY);await p1.getToolbar().clickAudioMuteButton();- await ensureThreeParticipants(ctx, { skipInMeetingChecks: true });+ await ensureThreeParticipants({+ skipInMeetingChecks: true+ });const { p2, p3 } = ctx;await p3.getToolbar().clickAudioMuteButton();@@ -218,7 +220,7 @@ describe('Desktop sharing', () => {it('audio only and dominant screen share', async () => {await hangupAllParticipants();- await ensureOneParticipant(ctx, {+ await ensureOneParticipant({configOverwrite: {startWithAudioMuted: true,startWithVideoMuted: true@@ -235,13 +237,13 @@ describe('Desktop sharing', () => {APP?.conference?.onToggleAudioOnly();}, SET_AUDIO_ONLY);- await ensureTwoParticipants(ctx, {- skipInMeetingChecks: true,+ await ensureTwoParticipants({configOverwrite: {startWithAudioMuted: true- }+ },+ skipInMeetingChecks: true});- await ensureThreeParticipants(ctx, {+ await ensureThreeParticipants({skipInMeetingChecks: true});const { p2, p3 } = ctx;@@ -267,7 +269,7 @@ describe('Desktop sharing', () => {it('with lastN', async () => {await hangupAllParticipants();- await ensureThreeParticipants(ctx);+ await ensureThreeParticipants();const { p1, p2, p3 } = ctx;await p3.getToolbar().clickDesktopSharingButton();@@ -275,7 +277,7 @@ describe('Desktop sharing', () => {await p1.getToolbar().clickAudioMuteButton();await p3.getToolbar().clickAudioMuteButton();- await ensureFourParticipants(ctx, {+ await ensureFourParticipants({configOverwrite: {channelLastN: 2,startWithAudioMuted: truediff --git a/tests/specs/4way/lastN.spec.ts b/tests/specs/4way/lastN.spec.tsindex 9e8302c74f..e2f5cea735 100644--- a/tests/specs/4way/lastN.spec.ts+++ b/tests/specs/4way/lastN.spec.ts@@ -2,20 +2,20 @@ import { ensureFourParticipants, ensureThreeParticipants, ensureTwoParticipantsdescribe('lastN', () => {it('joining the meeting', async () => {- await ensureTwoParticipants(ctx, {- skipInMeetingChecks: true,+ await ensureTwoParticipants({configOverwrite: {startWithAudioMuted: true,startWithVideoMuted: true,channelLastN: 1- }+ },+ skipInMeetingChecks: true});- await ensureThreeParticipants(ctx, {- skipInMeetingChecks: true,+ await ensureThreeParticipants({configOverwrite: {channelLastN: 1- }+ },+ skipInMeetingChecks: true,});});@@ -30,11 +30,11 @@ describe('lastN', () => {// Mute audio on participant3.await p3Toolbar.clickAudioMuteButton();- await ensureFourParticipants(ctx, {- skipInMeetingChecks: true,+ await ensureFourParticipants({configOverwrite: {channelLastN: 1- }+ },+ skipInMeetingChecks: true});const { p1, p2, p4 } = ctx;diff --git a/tests/specs/alone/chatPanel.spec.ts b/tests/specs/alone/chatPanel.spec.tsindex f47d20746f..f7bcdab714 100644--- a/tests/specs/alone/chatPanel.spec.ts+++ b/tests/specs/alone/chatPanel.spec.ts@@ -1,7 +1,7 @@import { ensureOneParticipant } from '../../helpers/participants';describe('Chat Panel', () => {- it('join participant', () => ensureOneParticipant(ctx));+ it('join participant', () => ensureOneParticipant());it('start closed', async () => {expect(await ctx.p1.getChatPanel().isOpen()).toBe(false);diff --git a/tests/specs/alone/dialInAudio.spec.ts b/tests/specs/alone/dialInAudio.spec.tsindex bb43006f61..e41dacac4b 100644--- a/tests/specs/alone/dialInAudio.spec.ts+++ b/tests/specs/alone/dialInAudio.spec.ts@@ -12,7 +12,7 @@ describe('Dial-In', () => {return;}- await ensureOneParticipant(ctx, { preferGenerateToken: true });+ await ensureOneParticipant({ preferGenerateToken: true });// check dial-in is enabledif (!await isDialInEnabled(ctx.p1)) {diff --git a/tests/specs/alone/invite.spec.ts b/tests/specs/alone/invite.spec.tsindex d3e9a6c723..b01d049dc1 100644--- a/tests/specs/alone/invite.spec.ts+++ b/tests/specs/alone/invite.spec.ts@@ -2,7 +2,7 @@ import { ensureOneParticipant } from '../../helpers/participants';import { isDialInEnabled } from '../helpers/DialIn';describe('Invite', () => {- it('join participant', () => ensureOneParticipant(ctx, { preferGenerateToken: true }));+ it('join participant', () => ensureOneParticipant({ preferGenerateToken: true }));it('url displayed', async () => {const { p1 } = ctx;@@ -67,7 +67,7 @@ describe('Invite', () => {await p1.driver.switchWindow(moreNumbersWindow);- await browser.pause(5000);+ await browser.pause(10000);await p1.driver.$('.dial-in-numbers-list').waitForExist();diff --git a/tests/specs/alone/lockRoomDigitsOnly.spec.ts b/tests/specs/alone/lockRoomDigitsOnly.spec.tsindex 3d362c487c..cd50be6ca3 100644--- a/tests/specs/alone/lockRoomDigitsOnly.spec.ts+++ b/tests/specs/alone/lockRoomDigitsOnly.spec.ts@@ -7,7 +7,7 @@ import { ensureOneParticipant } from '../../helpers/participants';* 2. Lock the room with a valid numeric password (should work)*/describe('Lock Room with Digits only', () => {- it('join participant', () => ensureOneParticipant(ctx, {+ it('join participant', () => ensureOneParticipant({configOverwrite: {roomPasswordNumberOfDigits: 5}diff --git a/tests/specs/alone/videoLayout.spec.ts b/tests/specs/alone/videoLayout.spec.tsindex 6dbcb427d0..a6cf14a117 100644--- a/tests/specs/alone/videoLayout.spec.ts+++ b/tests/specs/alone/videoLayout.spec.ts@@ -1,7 +1,7 @@import { ensureOneParticipant } from '../../helpers/participants';describe('Video Layout', () => {- it('join participant', () => ensureOneParticipant(ctx));+ it('join participant', () => ensureOneParticipant());it('check', async () => {const { p1 } = ctx;diff --git a/tests/specs/helpers/jaas.ts b/tests/specs/helpers/jaas.tsindex 05140dea18..54b323fc36 100644--- a/tests/specs/helpers/jaas.ts+++ b/tests/specs/helpers/jaas.ts@@ -1,51 +1,7 @@-import { Participant } from '../../helpers/Participant';+import type { Participant } from '../../helpers/Participant';+import { joinParticipant } from '../../helpers/participants';import { IToken, ITokenOptions, generateToken } from '../../helpers/token';-/**- * Creates a new Participant and joins the MUC with the given name. The jaas-specific properties must be set as- * environment variables: JAAS_DOMAIN and JAAS_TENANT, JAAS_KID, JAAS_PRIVATE_KEY_PATH.- *- * @param roomName The name of the room to join, without the tenant.- * @param instanceId This is the "name" passed to the Participant, I think it's used to match against one of the- * pre-configured browser instances in wdio? It must be one of 'p1', 'p2', 'p3', or 'p4'. TODO: figure out how this- * should be used.- * @param token the token to use, if any.- */-export async function loadPage(roomName: string, instanceId: 'p1' | 'p2' | 'p3' | 'p4', token?: IToken) {- if (!process.env.JAAS_DOMAIN || !process.env.JAAS_TENANT) {- throw new Error('JAAS_DOMAIN and JAAS_TENANT environment variables must be set');- }-- // TODO: this should re-use code from Participant (e.g. setting config).- let url = `https://${process.env.JAAS_DOMAIN}/${process.env.JAAS_TENANT}/${roomName}`;-- if (token) {- url += `?jwt=${token.jwt}`;- }- url += '#config.prejoinConfig.enabled=false&config.requireDisplayName=false';-- const newParticipant = new Participant({ name: instanceId, token });-- try {- await newParticipant.driver.setTimeout({ 'pageLoad': 30000 });-- // Force a refresh if URL changes only in hash params. TODO: clean this up when reactoring.- const currentUrl = await newParticipant.driver.getUrl();-- if (currentUrl.split('#')[0] === url.split('#')[0]) {- console.log('Refreshing the page to ensure the URL is loaded correctly');- await newParticipant.driver.url(url);- await newParticipant.driver.refresh();- } else {- await newParticipant.driver.url(url);- }- await newParticipant.waitForPageToLoad();- } catch (error) {- }-- return newParticipant;-}-export function generateJaasToken(options: ITokenOptions): IToken {if (!process.env.JAAS_PRIVATE_KEY_PATH || !process.env.JAAS_KID) {throw new Error('JAAS_PRIVATE_KEY_PATH and JAAS_KID environment variables must be set');@@ -61,21 +17,26 @@ export function generateJaasToken(options: ITokenOptions): IToken {/*** Creates a new Participant and joins the MUC with the given name. The jaas-specific properties must be set as- * environment variables: JAAS_DOMAIN and IFRAME_TENANT.+ * environment variables: IFRAME_TENANT.*- * @param roomName The name of the room to join, without the tenant.* @param instanceId This is the "name" passed to the Participant, I think it's used to match against one of the* pre-configured browser instances in wdio? It must be one of 'p1', 'p2', 'p3', or 'p4'. TODO: figure out how this* should be used.* @param token the token to use, if any.+ * @param roomName the name of the room to join, if any. If not provided, the ctx generated one will be used.+ * @returns {Promise<Participant>} The Participant that has joined the MUC.*/-export async function joinMuc(roomName: string, instanceId: 'p1' | 'p2' | 'p3' | 'p4', token?: IToken) {- const participant = await loadPage(roomName, instanceId, token);-- try {- await participant.waitForMucJoinedOrError();- } catch (error) {+export async function joinMuc(instanceId: 'p1' | 'p2' | 'p3' | 'p4', token?: IToken, roomName?: string):+Promise<Participant> {+ if (!process.env.JAAS_TENANT) {+ throw new Error('JAAS_TENANT environment variables must be set');}- return participant;+ return await joinParticipant({+ name: instanceId,+ token+ }, {+ forceTenant: process.env.JAAS_TENANT,+ roomName+ });}diff --git a/tests/specs/iframe/chat.spec.ts b/tests/specs/iframe/chat.spec.tsindex 62a9ddd6bb..a06906620e 100644--- a/tests/specs/iframe/chat.spec.ts+++ b/tests/specs/iframe/chat.spec.ts@@ -13,7 +13,7 @@ setTestProperties(__filename, {describe('Chat', () => {it('joining the meeting', async () => {- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1, p2 } = ctx;diff --git a/tests/specs/iframe/invite.spec.ts b/tests/specs/iframe/invite.spec.tsindex dfaef8aa1a..638e44b55d 100644--- a/tests/specs/iframe/invite.spec.ts+++ b/tests/specs/iframe/invite.spec.ts@@ -19,7 +19,7 @@ describe('Invite iframeAPI', () => {let sipJibriDisabled: boolean;it('join participant', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;diff --git a/tests/specs/iframe/participantsPresence.spec.ts b/tests/specs/iframe/participantsPresence.spec.tsindex 9d64599d00..e749b035b4 100644--- a/tests/specs/iframe/participantsPresence.spec.ts+++ b/tests/specs/iframe/participantsPresence.spec.ts@@ -3,7 +3,6 @@ import { isEqual } from 'lodash-es';import { P1, P2, Participant } from '../../helpers/Participant';import { setTestProperties } from '../../helpers/TestProperties';import { ensureTwoParticipants, parseJid } from '../../helpers/participants';-import { IContext } from '../../helpers/types';setTestProperties(__filename, {useIFrameApi: true,@@ -14,7 +13,7 @@ setTestProperties(__filename, {/*** Tests PARTICIPANT_LEFT webhook.*/-async function checkParticipantLeftHook(ctx: IContext, p: Participant, reason: string, checkId = false, conferenceJid: string) {+async function checkParticipantLeftHook(p: Participant, reason: string, checkId = false, conferenceJid: string) {const { webhooksProxy } = ctx;if (webhooksProxy) {@@ -56,7 +55,7 @@ describe('Participants presence', () => {it('joining the meeting', async () => {// ensure 2 participants one moderator and one guest, we will load both with iframeAPI- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p1, p2, webhooksProxy } = ctx;@@ -223,7 +222,9 @@ describe('Participants presence', () => {timeoutMsg: 'videoConferenceLeft not received'});- await ensureTwoParticipants(ctx, { preferGenerateToken: true });+ await ensureTwoParticipants({+ preferGenerateToken: true+ });const { p1, p2, roomName, webhooksProxy } = ctx;@@ -257,7 +258,7 @@ describe('Participants presence', () => {timeoutMsg: 'participantKickedOut event not received on p2 side'});- await checkParticipantLeftHook(ctx, p2, 'kicked', true, conferenceJid);+ await checkParticipantLeftHook(p2, 'kicked', true, conferenceJid);expect(eventP1).toBeDefined();expect(eventP2).toBeDefined();@@ -306,7 +307,7 @@ describe('Participants presence', () => {webhooksProxy?.clearCache();// join again- await ensureTwoParticipants(ctx);+ await ensureTwoParticipants();const { p2 } = ctx;if (webhooksProxy) {@@ -394,7 +395,7 @@ describe('Participants presence', () => {expect(eventConferenceLeftP2).toBeDefined();expect(eventConferenceLeftP2.roomName).toBe(roomName);- await checkParticipantLeftHook(ctx, p2, 'left', false, conferenceJid);+ await checkParticipantLeftHook(p2, 'left', false, conferenceJid);const eventReadyToCloseP2 = await p2.driver.waitUntil(() => p2.getIframeAPI().getEventResult('readyToClose'), {timeout: 2000,@@ -423,7 +424,7 @@ describe('Participants presence', () => {expect(eventConferenceLeft).toBeDefined();expect(eventConferenceLeft.roomName).toBe(roomName);- await checkParticipantLeftHook(ctx, p1, 'left', true, conferenceJid);+ await checkParticipantLeftHook(p1, 'left', true, conferenceJid);if (webhooksProxy) {// ROOM_DESTROYED webhook// @ts-ignorediff --git a/tests/specs/iframe/recording.spec.ts b/tests/specs/iframe/recording.spec.tsindex c94be7496f..66af9a275e 100644--- a/tests/specs/iframe/recording.spec.ts+++ b/tests/specs/iframe/recording.spec.ts@@ -11,7 +11,7 @@ describe('Recording', () => {let liveStreamingDisabled: boolean;it('join participant', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;diff --git a/tests/specs/iframe/transcriptions.spec.ts b/tests/specs/iframe/transcriptions.spec.tsindex 33a5806bbe..c27cc39c5e 100644--- a/tests/specs/iframe/transcriptions.spec.ts+++ b/tests/specs/iframe/transcriptions.spec.ts@@ -13,7 +13,7 @@ setTestProperties(__filename, {describe('Transcriptions', () => {it('joining the meeting', async () => {- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;@@ -26,7 +26,7 @@ describe('Transcriptions', () => {await p1.switchToAPI();- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({configOverwrite: {startWithAudioMuted: true}diff --git a/tests/specs/iframe/visitors.spec.ts b/tests/specs/iframe/visitors.spec.tsindex dcc75d0cf2..38d8e5d637 100644--- a/tests/specs/iframe/visitors.spec.ts+++ b/tests/specs/iframe/visitors.spec.ts@@ -17,7 +17,7 @@ describe('Visitors', () => {};}- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;@@ -38,7 +38,7 @@ describe('Visitors', () => {});it('visitor joins', async () => {- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({preferGenerateToken: true,tokenOptions: { visitor: true },skipInMeetingChecks: truediff --git a/tests/specs/iframe/visitorsLive.spec.ts b/tests/specs/iframe/visitorsLive.spec.tsindex 72f78445a2..ce0d79b1e3 100644--- a/tests/specs/iframe/visitorsLive.spec.ts+++ b/tests/specs/iframe/visitorsLive.spec.ts@@ -20,7 +20,7 @@ describe('Visitors', () => {};}- await ensureOneParticipant(ctx);+ await ensureOneParticipant();const { p1 } = ctx;@@ -42,7 +42,7 @@ describe('Visitors', () => {it('go live', async () => {- await ensureTwoParticipants(ctx, {+ await ensureTwoParticipants({preferGenerateToken: true,tokenOptions: { visitor: true },skipWaitToJoin: true,diff --git a/tests/specs/jaas/joinMuc.spec.ts b/tests/specs/jaas/joinMuc.spec.tsindex 83d9923b1a..10de75275c 100644--- a/tests/specs/jaas/joinMuc.spec.ts+++ b/tests/specs/jaas/joinMuc.spec.ts@@ -9,18 +9,22 @@ setTestProperties(__filename, {describe('XMPP login and MUC join test', () => {it('with a valid token (wildcard room)', async () => {console.log('Joining a MUC with a valid token (wildcard room)');- const p = await joinMuc(ctx.roomName, 'p1', t({ room: '*' }));+ const p = await joinMuc('p1', t({ room: '*' }));expect(await p.isInMuc()).toBe(true);expect(await p.isModerator()).toBe(false);++ await p.hangup();});it('with a valid token (specific room)', async () => {console.log('Joining a MUC with a valid token (specific room)');- const p = await joinMuc(ctx.roomName, 'p1', t({ room: ctx.roomName }));+ const p = await joinMuc('p1', t({ room: ctx.roomName }));expect(await p.isInMuc()).toBe(true);expect(await p.isModerator()).toBe(false);++ await p.hangup();});it('with a token with bad signature', async () => {@@ -29,7 +33,7 @@ describe('XMPP login and MUC join test', () => {token.jwt = token.jwt + 'badSignature';- const p = await joinMuc(ctx.roomName, 'p1', token);+ const p = await joinMuc('p1', token);expect(Boolean(await p.isInMuc())).toBe(false);@@ -37,60 +41,72 @@ describe('XMPP login and MUC join test', () => {|| await p.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TITLE_TEST_ID);expect(errorText).toContain('not allowed to join');++ await p.hangup();});it('with an expired token', async () => {console.log('Joining a MUC with an expired token');- const p = await joinMuc(ctx.roomName, 'p1', t({ exp: '-1m' }));+ const p = await joinMuc('p1', t({ exp: '-1m' }));expect(Boolean(await p.isInMuc())).toBe(false);const errorText = await p.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TITLE_TEST_ID);expect(errorText).toContain('Token is expired');++ await p.hangup();});it('with a token using the wrong key ID', async () => {console.log('Joining a MUC with a token using the wrong key ID');- const p = await joinMuc(ctx.roomName, 'p1', t({ keyId: 'invalid-key-id' }));+ const p = await joinMuc('p1', t({ keyId: 'invalid-key-id' }));expect(Boolean(await p.isInMuc())).toBe(false);const errorText = await p.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TEST_ID);expect(errorText).toContain('not allowed to join');++ await p.hangup();});it('with a token for a different room', async () => {console.log('Joining a MUC with a token for a different room');- const p = await joinMuc(ctx.roomName, 'p1', t({ room: ctx.roomName + 'different' }));+ const p = await joinMuc('p1', t({ room: ctx.roomName + 'different' }));expect(Boolean(await p.isInMuc())).toBe(false);const errorText = await p.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TEST_ID);expect(errorText).toContain('not allowed to join');++ await p.hangup();});it('with a moderator token', async () => {console.log('Joining a MUC with a moderator token');- const p = await joinMuc(ctx.roomName, 'p1', t({ moderator: true }));+ const p = await joinMuc('p1', t({ moderator: true }));expect(await p.isInMuc()).toBe(true);expect(await p.isModerator()).toBe(true);++ await p.hangup();});// This is dependent on jaas account configuration. All tests under jaas/ expect that "unauthenticated access" is// disabled.it('without a token', async () => {console.log('Joining a MUC without a token');- const p = await joinMuc(ctx.roomName, 'p1');+ const p = await joinMuc('p1');expect(Boolean(await p.isInMuc())).toBe(false);const errorText = await p.getNotifications().getNotificationText(TOKEN_AUTH_FAILED_TEST_ID);expect(errorText).toContain('not allowed to join');++ await p.hangup();});// it('without sending a conference-request', async () => {diff --git a/tests/specs/jaas/maxOccupants.spec.ts b/tests/specs/jaas/maxOccupants.spec.tsindex 4bc90482ef..559ae77307 100644--- a/tests/specs/jaas/maxOccupants.spec.ts+++ b/tests/specs/jaas/maxOccupants.spec.ts@@ -13,19 +13,19 @@ describe('MaxOccupants limit enforcement', () => {maxOccupants: 2};- const p1 = await joinMuc(ctx.roomName, 'p1', t({ room: ctx.roomName }));- const p2 = await joinMuc(ctx.roomName, 'p2', t({ room: ctx.roomName }));+ const p1 = await joinMuc('p1', t({ room: ctx.roomName }));+ const p2 = await joinMuc('p2', t({ room: ctx.roomName }));expect(await p1.isInMuc()).toBe(true);expect(await p2.isInMuc()).toBe(true);// Third participant should be rejected (exceeding maxOccupants), even if it's a moderator- let p3 = await joinMuc(ctx.roomName, 'p3', t({ room: ctx.roomName, moderator: true }));+ let p3 = await joinMuc('p3', t({ room: ctx.roomName, moderator: true }));expect(Boolean(await p3.isInMuc())).toBe(false);await p1.hangup();- p3 = await joinMuc(ctx.roomName, 'p3', t({ room: ctx.roomName }));+ p3 = await joinMuc('p3', t({ room: ctx.roomName }));expect(await p3.isInMuc()).toBe(true);});});diff --git a/tests/specs/jaas/passcode.spec.ts b/tests/specs/jaas/passcode.spec.tsindex 73bd8eddef..78b894d926 100644--- a/tests/specs/jaas/passcode.spec.ts+++ b/tests/specs/jaas/passcode.spec.ts@@ -1,6 +1,6 @@import { setTestProperties } from '../../helpers/TestProperties';import { IToken } from '../../helpers/token';-import { joinMuc, loadPage, generateJaasToken as t } from '../helpers/jaas';+import { joinMuc, generateJaasToken as t } from '../helpers/jaas';setTestProperties(__filename, {useJaas: true,@@ -16,9 +16,9 @@ describe('Setting passcode through settings provisioning', () => {visitorsEnabled: true};- await joinWithPassword(ctx.roomName, 'p1', t({ room: ctx.roomName }));- await joinWithPassword(ctx.roomName, 'p1', t({ room: ctx.roomName, moderator: true }));- await joinWithPassword(ctx.roomName, 'p1', t({ room: ctx.roomName, visitor: true }));+ await joinWithPassword('p1', t({ room: ctx.roomName }));+ await joinWithPassword('p1', t({ room: ctx.roomName, moderator: true }));+ await joinWithPassword('p1', t({ room: ctx.roomName, visitor: true }));});it('With an invalid passcode', async () => {ctx.webhooksProxy.defaultMeetingSettings = {@@ -26,7 +26,7 @@ describe('Setting passcode through settings provisioning', () => {};const roomName = ctx.roomName + '-2';- const p = await joinMuc(roomName, 'p1', t({ room: roomName }));+ const p = await joinMuc('p1', t({ room: roomName }), roomName);// Setting the passcode should fail, resulting in the room being accessible without a passwordawait p.waitToJoinMUC();@@ -39,9 +39,9 @@ describe('Setting passcode through settings provisioning', () => {* Join a password-protected room. Assert that a password is required, that a wrong password does not work, and that* the correct password does work.*/-async function joinWithPassword(roomName: string, instanceId: string, token: IToken) {+async function joinWithPassword(instanceId: string, token: IToken) {// @ts-ignore- const p = await loadPage(roomName, instanceId, token);+ const p = await joinMuc(instanceId, token);await p.waitForMucJoinedOrError();expect(await p.isInMuc()).toBe(false);@@ -57,5 +57,7 @@ async function joinWithPassword(roomName: string, instanceId: string, token: IToexpect(await p.isInMuc()).toBe(true);expect(await p.getPasswordDialog().isOpen()).toBe(false);++ await p.hangup();}diff --git a/tests/specs/jaas/visitors/participantsSoftLimit.spec.ts b/tests/specs/jaas/visitors/participantsSoftLimit.spec.tsindex 41466c2854..fceb8f3ee6 100644--- a/tests/specs/jaas/visitors/participantsSoftLimit.spec.ts+++ b/tests/specs/jaas/visitors/participantsSoftLimit.spec.ts@@ -16,7 +16,6 @@ describe('Visitors triggered by reaching participantsSoftLimit', () => {/// XXX the "name" of the participant MUST match one of the "capabilities" defined in wdio. It's not a "participant", it's an instance configuration!const m = await joinMuc(- ctx.roomName,'p1',t({ room: ctx.roomName, displayName: 'Mo de Rator', moderator: true }));@@ -28,7 +27,6 @@ describe('Visitors triggered by reaching participantsSoftLimit', () => {// Joining with a participant token before participantSoftLimit has been reachedconst p = await joinMuc(- ctx.roomName,'p2',t({ room: ctx.roomName, displayName: 'Parti Cipant' }));@@ -40,7 +38,6 @@ describe('Visitors triggered by reaching participantsSoftLimit', () => {// Joining with a participant token after participantSoftLimit has been reachedconst v = await joinMuc(- ctx.roomName,'p3',t({ room: ctx.roomName, displayName: 'Visi Tor' }));diff --git a/tests/specs/jaas/visitors/visitorTokens.spec.ts b/tests/specs/jaas/visitors/visitorTokens.spec.tsindex 11d7129bf0..e52bd28ea8 100644--- a/tests/specs/jaas/visitors/visitorTokens.spec.ts+++ b/tests/specs/jaas/visitors/visitorTokens.spec.ts@@ -14,7 +14,6 @@ describe('Visitors triggered by visitor tokens', () => {};const m = await joinMuc(- ctx.roomName,'p1',t({ room: ctx.roomName, displayName: 'Mo de Rator', moderator: true }));@@ -26,7 +25,6 @@ describe('Visitors triggered by visitor tokens', () => {// Joining with a participant token before any visitorsconst p = await joinMuc(- ctx.roomName,'p2',t({ room: ctx.roomName, displayName: 'Parti Cipant' }));@@ -38,7 +36,6 @@ describe('Visitors triggered by visitor tokens', () => {// Joining with a visitor tokenconst v = await joinMuc(- ctx.roomName,'p3',t({ room: ctx.roomName, displayName: 'Visi Tor', visitor: true }));@@ -48,9 +45,10 @@ describe('Visitors triggered by visitor tokens', () => {expect(await v.isVisitor()).toBe(true);console.log('Visitor joined');+ await p.hangup();+// Joining with a participant token after visitors...:mindblown:const v2 = await joinMuc(- ctx.roomName,'p2',t({ room: ctx.roomName, displayName: 'Visi Tor 2' }));diff --git a/tests/wdio.conf.ts b/tests/wdio.conf.tsindex 6b0725e201..22d799d518 100644--- a/tests/wdio.conf.ts+++ b/tests/wdio.conf.ts@@ -124,6 +124,8 @@ const capabilities = generateCapabilitiesFromSpecs();const TEST_RESULTS_DIR = 'test-results';+const keepAlive: Array<any> = [];+export const config: WebdriverIO.MultiremoteConfig = {runner: 'local',@@ -206,7 +208,6 @@ export const config: WebdriverIO.MultiremoteConfig = {globalAny.ctx = {times: {}} as IContext;- globalAny.ctx.keepAlive = [];globalAny.ctx.testProperties = testProperties;await Promise.all(multiremotebrowser.instances.map(async (instance: string) => {@@ -216,7 +217,7 @@ export const config: WebdriverIO.MultiremoteConfig = {initLogger(bInstance, `${instance}-${cid}-${testName}`, TEST_RESULTS_DIR);// setup keepalive- globalAny.ctx.keepAlive.push(setInterval(async () => {+ keepAlive.push(setInterval(async () => {await bInstance.execute(() => console.log(`${new Date().toISOString()} keep-alive`));}, 20_000));@@ -239,18 +240,20 @@ export const config: WebdriverIO.MultiremoteConfig = {}globalAny.ctx.roomName = globalAny.ctx.roomName.toLowerCase();- globalAny.ctx.jwtPrivateKeyPath = process.env.JWT_PRIVATE_KEY_PATH;- globalAny.ctx.jwtKid = process.env.JWT_KID;globalAny.ctx.iFrameUsesJaas = process.env.JWT_PRIVATE_KEY_PATH&& process.env.JWT_KID?.startsWith('vpaas-magic-cookie-');+ const isJaasConfigured = process.env.JAAS_TENANT && process.env.JAAS_PRIVATE_KEY_PATH && process.env.JAAS_KID;+// If we are running the iFrameApi tests, we need to mark it as such and if needed to create the proxy// and connect to it.if (testProperties.useWebhookProxy) {if (!globalAny.ctx.webhooksProxy&& process.env.WEBHOOKS_PROXY_URL && process.env.WEBHOOKS_PROXY_SHARED_SECRET) {globalAny.ctx.webhooksProxy = new WebhookProxy(- `${process.env.WEBHOOKS_PROXY_URL}&room=${globalAny.ctx.roomName}`,+ `${process.env.WEBHOOKS_PROXY_URL}?tenant=${+ isJaasConfigured ? process.env.JAAS_TENANT : process.env.IFRAME_TENANT+ }&room=${globalAny.ctx.roomName}`,process.env.WEBHOOKS_PROXY_SHARED_SECRET,`${TEST_RESULTS_DIR}/webhooks-${cid}-${testName}.log`);globalAny.ctx.webhooksProxy.connect();@@ -262,12 +265,9 @@ export const config: WebdriverIO.MultiremoteConfig = {globalAny.ctx.skipSuiteTests = true;}- const isJaasConfigured = process.env.JAAS_DOMAIN && process.env.JAAS_TENANT- && process.env.JAAS_PRIVATE_KEY_PATH && process.env.JAAS_KID;-if (testProperties.useJaas && !isJaasConfigured) {console.warn(`JaaS is not configured, skipping ${testName}. `- + 'Set JAAS_DOMAIN, JAAS_TENANT, JAAS_KID, and JAAS_PRIVATE_KEY_PATH to enable.');+ + 'Set JAAS_TENANT, JAAS_KID, and JAAS_PRIVATE_KEY_PATH to enable.');globalAny.ctx.skipSuiteTests = true;}},@@ -276,7 +276,7 @@ export const config: WebdriverIO.MultiremoteConfig = {const { ctx }: any = global;ctx?.webhooksProxy?.disconnect();- ctx?.keepAlive?.forEach(clearInterval);+ keepAlive.forEach(clearInterval);},beforeSession(c, capabilities_, specs_, cid) {