Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Reorganize tests by feature, minor test updates (#16518)

bgrozev447be3f6a954
diff --git a/react/features/base/testing/functions.ts b/react/features/base/testing/functions.ts
index 2ef76d66c4..ffc18fb402 100644
--- a/react/features/base/testing/functions.ts
+++ b/react/features/base/testing/functions.ts
@@ -1,6 +1,5 @@
import { IReduxState, IStore } from '../../app/types';
import { isTrackStreamingStatusActive } from '../../connection-indicator/functions';
-import { VIDEO_CODEC } from '../../video-quality/constants';
import { MEDIA_TYPE, VIDEO_TYPE } from '../media/constants';
import { getParticipantById, isScreenShareParticipant } from '../participants/functions';
import {
@@ -57,75 +56,12 @@ export function isLargeVideoReceived({ getState }: IStore): boolean {
}
/**
- * Returns whether the local video track is encoded in AV1.
+ * Returns the local video track's codec.
*
- * @param {IStore} store - The redux store.
- * @returns {boolean}
- */
-export function isLocalCameraEncodingAv1({ getState }: IStore): boolean {
- const state = getState();
- const tracks = state['features/base/tracks'];
- const localtrack = getLocalVideoTrack(tracks);
-
- if (localtrack?.codec?.toLowerCase() === VIDEO_CODEC.AV1) {
- return true;
- }
-
- return false;
-}
-
-/**
- * Returns whether the local video track is encoded in H.264.
- *
- * @param {IStore} store - The redux store.
- * @returns {boolean}
+ * @returns {string?} The local video track's codec.
*/
-export function isLocalCameraEncodingH264({ getState }: IStore): boolean {
- const state = getState();
- const tracks = state['features/base/tracks'];
- const localtrack = getLocalVideoTrack(tracks);
-
- if (localtrack?.codec?.toLowerCase() === VIDEO_CODEC.H264) {
- return true;
- }
-
- return false;
-}
-
-/**
- * Returns whether the local video track is encoded in VP8.
- *
- * @param {IStore} store - The redux store.
- * @returns {boolean}
- */
-export function isLocalCameraEncodingVp8({ getState }: IStore): boolean {
- const state = getState();
- const tracks = state['features/base/tracks'];
- const localtrack = getLocalVideoTrack(tracks);
-
- if (localtrack?.codec?.toLowerCase() === VIDEO_CODEC.VP8) {
- return true;
- }
-
- return false;
-}
-
-/**
- * Returns whether the local video track is encoded in VP9.
- *
- * @param {IStore} store - The redux store.
- * @returns {boolean}
- */
-export function isLocalCameraEncodingVp9({ getState }: IStore): boolean {
- const state = getState();
- const tracks = state['features/base/tracks'];
- const localtrack = getLocalVideoTrack(tracks);
-
- if (localtrack?.codec?.toLowerCase() === VIDEO_CODEC.VP9) {
- return true;
- }
-
- return false;
+export function getLocalCameraEncoding({ getState }: IStore): string | undefined {
+ return getLocalVideoTrack(getState()['features/base/tracks'])?.codec?.toLowerCase();
}
/**
diff --git a/react/features/base/testing/middleware.ts b/react/features/base/testing/middleware.ts
index e772420a61..bbece60550 100644
--- a/react/features/base/testing/middleware.ts
+++ b/react/features/base/testing/middleware.ts
@@ -8,12 +8,9 @@ import { getJitsiMeetGlobalNS } from '../util/helpers';
import { setConnectionState } from './actions';
import {
+ getLocalCameraEncoding,
getRemoteVideoType,
isLargeVideoReceived,
- isLocalCameraEncodingAv1,
- isLocalCameraEncodingH264,
- isLocalCameraEncodingVp8,
- isLocalCameraEncodingVp9,
isRemoteVideoReceived,
isTestModeEnabled
} from './functions';
@@ -90,10 +87,7 @@ function _bindTortureHelpers(store: IStore) {
getJitsiMeetGlobalNS().testing = {
getRemoteVideoType: getRemoteVideoType.bind(null, store),
isLargeVideoReceived: isLargeVideoReceived.bind(null, store),
- isLocalCameraEncodingAv1: isLocalCameraEncodingAv1.bind(null, store),
- isLocalCameraEncodingH264: isLocalCameraEncodingH264.bind(null, store),
- isLocalCameraEncodingVp8: isLocalCameraEncodingVp8.bind(null, store),
- isLocalCameraEncodingVp9: isLocalCameraEncodingVp9.bind(null, store),
+ getLocalCameraEncoding: getLocalCameraEncoding.bind(null, store),
isRemoteVideoReceived: isRemoteVideoReceived.bind(null, store)
};
}
diff --git a/tests/helpers/TestProperties.ts b/tests/helpers/TestProperties.ts
index dba6a9d010..98f95836cf 100644
--- a/tests/helpers/TestProperties.ts
+++ b/tests/helpers/TestProperties.ts
@@ -10,40 +10,15 @@ export type ITestProperties = {
useJaas: boolean;
/** The test requires the webhook proxy. */
useWebhookProxy: boolean;
- usesBrowsers?: string[];
+ usesBrowsers: string[];
};
const defaultProperties: ITestProperties = {
useWebhookProxy: false,
useJaas: false,
- usesBrowsers: [ 'p1', 'p2', 'p3', 'p4' ]
+ usesBrowsers: [ 'p1' ]
};
-function getDefaultProperties(filename: string): ITestProperties {
- const properties = { ...defaultProperties };
-
- properties.usesBrowsers = getDefaultBrowsers(filename);
-
- return properties;
-}
-
-function getDefaultBrowsers(filename: string): string[] {
- if (filename.includes('/alone/')) {
- return [ 'p1' ];
- }
- if (filename.includes('/2way/')) {
- return [ 'p1', 'p2' ];
- }
- if (filename.includes('/3way/')) {
- return [ 'p1', 'p2', 'p3' ];
- }
- if (filename.includes('/4way/')) {
- return [ 'p1', 'p2', 'p3', 'p4' ];
- }
-
- // Tests outside /alone/, /2way/, /3way/, /4way/ will default to p1 only.
- return [ 'p1' ];
-}
/**
* Maps a test filename to its registered properties.
@@ -63,7 +38,7 @@ export function setTestProperties(filename: string, properties: Partial<ITestPro
console.warn(`Test properties for ${filename} are already set. Overwriting.`);
}
- testProperties[filename] = { ...getDefaultProperties(filename), ...properties };
+ testProperties[filename] = { ...defaultProperties, ...properties };
}
let testFilesLoaded = false;
@@ -101,7 +76,7 @@ export function loadTestFiles(files: string[]): void {
require(file);
if (!testProperties[file]) {
// If no properties were set, apply defaults
- setTestProperties(file, getDefaultProperties(file));
+ setTestProperties(file, { ...defaultProperties });
}
} catch (error) {
console.warn(`Warning: Could not analyze ${file}:`, (error as Error).message);
@@ -130,5 +105,5 @@ export function loadTestFiles(files: string[]): void {
* @returns Promise<ITestProperties> - The test properties with defaults applied
*/
export async function getTestProperties(testFilePath: string): Promise<ITestProperties> {
- return testProperties[testFilePath] || getDefaultProperties(testFilePath);
+ return testProperties[testFilePath] || { ...defaultProperties };
}
diff --git a/tests/helpers/expectations.ts b/tests/helpers/expectations.ts
index f837a88aa9..f907964bbd 100644
--- a/tests/helpers/expectations.ts
+++ b/tests/helpers/expectations.ts
@@ -27,8 +27,13 @@ const defaultExpectations = {
// The first to join is a moderator.
firstModerator: true,
// The grantOwner function is available.
- grantModerator: true
- }
+ grantModerator: true,
+ // Whether the ability to set a password is available (there's a backend options which makes moderators unable
+ // to set a room password unless they also happen to have a token (any valid token?))
+ setPasswordAvailable: true
+ },
+ // We can create conferences under any tenant.
+ useTenant: true
};
let overrides: any = {};
@@ -47,4 +52,6 @@ if (config.expectationsFile) {
export const expectations = merge(defaultExpectations, overrides);
-console.log('Expectations:', expectations);
+if (!process.env.WDIO_WORKER_ID) {
+ console.log('Expectations:', expectations);
+}
diff --git a/tests/helpers/joinMuc.ts b/tests/helpers/joinMuc.ts
index 0d8843eaac..17cb0c866a 100644
--- a/tests/helpers/joinMuc.ts
+++ b/tests/helpers/joinMuc.ts
@@ -38,3 +38,13 @@ export async function joinMuc(
roomName: joinOptions?.roomName || ctx.roomName,
});
}
+
+/**
+ * Wait until all participants have ICE connected and have sent and received data (their PC stats are ready).
+ * @param participants
+ */
+export async function waitForMedia(participants: Participant[]) {
+ await Promise.all(participants.map(p =>
+ p.waitForIceConnected().then(() => p.waitForSendReceiveData())
+ ));
+}
diff --git a/tests/specs/2way/fakeDialInAudio.spec.ts b/tests/specs/2way/fakeDialInAudio.spec.ts
deleted file mode 100644
index 26748a514b..0000000000
--- a/tests/specs/2way/fakeDialInAudio.spec.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import process from 'node:process';
-
-import { expectations } from '../../helpers/expectations';
-import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/participants';
-import { cleanup, isDialInEnabled, waitForAudioFromDialInParticipant } from '../helpers/DialIn';
-
-describe('Fake Dial-In', () => {
- it('join participant', async () => {
- // we execute fake dial in only if the real dial in is not enabled
-
- // check rest url is not configured
- if (process.env.DIAL_IN_REST_URL) {
- ctx.skipSuiteTests = 'DIAL_IN_REST_URL is not set';
-
- return;
- }
-
- await ensureOneParticipant();
-
- const configEnabled = await isDialInEnabled(ctx.p1);
-
- if (expectations.dialIn.enabled !== null) {
- expect(configEnabled).toBe(expectations.dialIn.enabled);
- }
-
- // check dial-in is enabled, so skip
- if (configEnabled) {
- ctx.skipSuiteTests = 'DIAL_IN_REST_URL is not set.';
- }
- });
-
- it('open invite dialog', async () => {
- await ctx.p1.getInviteDialog().open();
-
- await ctx.p1.getInviteDialog().clickCloseButton();
- });
-
- it('invite second participant', async () => {
- if (!await ctx.p1.isInMuc()) {
- // local participant did not join abort
- return;
- }
-
- await ensureTwoParticipants();
- });
-
- it('wait for audio from second participant', async () => {
- const { p1 } = ctx;
-
- if (!await p1.isInMuc()) {
- // local participant did not join abort
- return;
- }
-
- await waitForAudioFromDialInParticipant(p1);
-
- await cleanup(p1);
- });
-});
diff --git a/tests/specs/2way/singlePort.spec.ts b/tests/specs/2way/singlePort.spec.ts
deleted file mode 100644
index 8c6f6e5d7a..0000000000
--- a/tests/specs/2way/singlePort.spec.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { Participant } from '../../helpers/Participant';
-import { ensureTwoParticipants } from '../../helpers/participants';
-
-describe('Single port', () => {
- it('joining the meeting', () => ensureTwoParticipants());
-
- it('test', async () => {
- const { p1, p2 } = ctx;
-
- const port1 = await getRemotePort(p1);
- const port2 = await getRemotePort(p2);
-
- expect(Number.isInteger(port1)).toBe(true);
- expect(Number.isInteger(port2)).toBe(true);
- expect(port1).toBe(port2);
- });
-});
-
-/**
- * Get the remote port of the participant.
- * @param participant
- */
-async function getRemotePort(participant: Participant) {
- const data = await participant.execute(() => APP?.conference?.getStats()?.transport[0]?.ip);
-
- const parts = data.split(':');
-
- return parts.length > 1 ? parseInt(parts[1], 10) : '';
-}
diff --git a/tests/specs/2way/subject.spec.ts b/tests/specs/2way/subject.spec.ts
deleted file mode 100644
index dc99b8fce4..0000000000
--- a/tests/specs/2way/subject.spec.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import type { Participant } from '../../helpers/Participant';
-import { ensureTwoParticipants } from '../../helpers/participants';
-
-const MY_TEST_SUBJECT = 'My Test Subject';
-const SUBJECT_XPATH = '//div[starts-with(@class, "subject-text")]';
-
-describe('Subject', () => {
- it('joining the meeting', () => ensureTwoParticipants({
- configOverwrite: {
- subject: MY_TEST_SUBJECT
- }
- }));
-
- it('check', async () => {
- await checkSubject(ctx.p1, MY_TEST_SUBJECT);
- await checkSubject(ctx.p2, MY_TEST_SUBJECT);
- });
-});
-
-/**
- * Check was subject set.
- *
- * @param participant
- * @param subject
- */
-async function checkSubject(participant: Participant, subject: string) {
- const localTile = participant.driver.$(SUBJECT_XPATH);
-
- await localTile.moveTo();
-
- expect(await localTile.getText()).toBe(subject);
-}
diff --git a/tests/specs/2way/udp.spec.ts b/tests/specs/2way/udp.spec.ts
deleted file mode 100644
index 6884597408..0000000000
--- a/tests/specs/2way/udp.spec.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { Participant } from '../../helpers/Participant';
-import { ensureTwoParticipants } from '../../helpers/participants';
-
-describe('UDP', () => {
- it('joining the meeting', () => ensureTwoParticipants());
-
- it('check', async () => {
- const { p1, p2 } = ctx;
-
- // just in case wait 1500, this is the interval we use for `config.pcStatsInterval`
- await p1.driver.pause(1500);
-
- expect(await getProtocol(p1)).toBe('udp');
- expect(await getProtocol(p2)).toBe('udp');
- });
-});
-
-/**
- * Get the remote port of the participant.
- * @param participant
- */
-async function getProtocol(participant: Participant) {
- const data = await participant.execute(() => APP?.conference?.getStats()?.transport[0]?.type);
-
- return data.toLowerCase();
-}
diff --git a/tests/specs/alone/dialInAudio.spec.ts b/tests/specs/alone/dialInAudio.spec.ts
deleted file mode 100644
index e68b449ca8..0000000000
--- a/tests/specs/alone/dialInAudio.spec.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import process from 'node:process';
-
-import { config as testsConfig } from '../../helpers/TestsConfig';
-import { expectations } from '../../helpers/expectations';
-import { ensureOneParticipant } from '../../helpers/participants';
-import { cleanup, dialIn, isDialInEnabled, waitForAudioFromDialInParticipant } from '../helpers/DialIn';
-
-describe('Dial-In', () => {
- it('join participant', async () => {
- // check rest url is configured
- if (!process.env.DIAL_IN_REST_URL) {
- ctx.skipSuiteTests = 'DIAL_IN_REST_URL is not set.';
-
- return;
- }
-
- // This is a temporary hack to avoid failing when running against a jaas env. The same cases are covered in
- // jaas/dial/dialin.spec.ts.
- if (testsConfig.jaas.enabled) {
- ctx.skipSuiteTests = 'JaaS is configured.';
-
- return;
- }
-
- await ensureOneParticipant();
-
- expect(await ctx.p1.isInMuc()).toBe(true);
-
- const configEnabled = await isDialInEnabled(ctx.p1);
-
- if (expectations.dialIn.enabled !== null) {
- expect(configEnabled).toBe(expectations.dialIn.enabled);
- }
-
- if (!configEnabled) {
- ctx.skipSuiteTests = 'The environment does not support dial-in, and no expectation has been set.';
- }
- });
-
- it('retrieve pin', async () => {
- let dialInPin: string;
-
- try {
- dialInPin = await ctx.p1.getDialInPin();
- } catch (e) {
- console.error('dial-in.test.no-pin');
- ctx.skipSuiteTests = 'No dial-in pin is available.';
- throw e;
- }
-
- if (dialInPin.length === 0) {
- console.error('dial-in.test.no-pin');
- ctx.skipSuiteTests = 'The dial-in pin is empty.';
- throw new Error('no pin');
- }
-
- expect(dialInPin.length >= 8).toBe(true);
- });
-
- it('invite dial-in participant', async () => {
- await dialIn(await ctx.p1.getDialInPin());
- });
-
- it('wait for audio from dial-in participant', async () => {
- const { p1 } = ctx;
-
- if (!await p1.isInMuc()) {
- // local participant did not join abort
- return;
- }
-
- await waitForAudioFromDialInParticipant(p1);
-
- await cleanup(p1);
- });
-});
diff --git a/tests/specs/alone/invite.spec.ts b/tests/specs/alone/invite.spec.ts
deleted file mode 100644
index b1059d2362..0000000000
--- a/tests/specs/alone/invite.spec.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Participant } from '../../helpers/Participant';
-import { config as testsConfig } from '../../helpers/TestsConfig';
-import { expectations } from '../../helpers/expectations';
-import { ensureOneParticipant } from '../../helpers/participants';
-import { assertDialInDisplayed, assertUrlDisplayed, isDialInEnabled, verifyMoreNumbersPage } from '../helpers/DialIn';
-
-describe('Invite', () => {
- let p1: Participant;
-
- it('setup', async () => {
- // This is a temporary hack to avoid failing when running against a jaas env. The same cases are covered in
- // jaas/dial/dialin.spec.ts.
- if (testsConfig.jaas.enabled) {
- ctx.skipSuiteTests = 'JaaS is configured.';
-
- return;
- }
-
- await ensureOneParticipant();
-
- p1 = ctx.p1;
-
- });
-
- // The URL should always be displayed.
- it('url displayed', () => assertUrlDisplayed(p1));
-
- it('config values', async () => {
- const dialInEnabled = await isDialInEnabled(p1);
-
- if (expectations.dialIn.enabled !== null) {
- expect(dialInEnabled).toBe(expectations.dialIn.enabled);
- }
- });
-
- it('dial-in displayed', async () => {
- if (expectations.dialIn.enabled !== null) {
- await assertDialInDisplayed(p1, expectations.dialIn.enabled);
- }
- });
-
- it('view more numbers page', async () => {
- if (expectations.dialIn.enabled === true) {
- // TODO: assert the page is NOT shown when the expectation is false.
- await verifyMoreNumbersPage(p1);
- }
- });
-});
diff --git a/tests/specs/alone/lockRoomDigitsOnly.spec.ts b/tests/specs/alone/lockRoomDigitsOnly.spec.ts
deleted file mode 100644
index cd50be6ca3..0000000000
--- a/tests/specs/alone/lockRoomDigitsOnly.spec.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { ensureOneParticipant } from '../../helpers/participants';
-
-/**
- * Tests that the digits only password feature works.
- *
- * 1. Lock the room with a string (shouldn't work)
- * 2. Lock the room with a valid numeric password (should work)
- */
-describe('Lock Room with Digits only', () => {
- it('join participant', () => ensureOneParticipant({
- configOverwrite: {
- roomPasswordNumberOfDigits: 5
- }
- }));
-
- it('lock room with digits only', async () => {
- const { p1 } = ctx;
-
- expect(await p1.execute(
- () => APP.store.getState()['features/base/config'].roomPasswordNumberOfDigits === 5)).toBe(true);
-
- const p1SecurityDialog = p1.getSecurityDialog();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- expect(await p1SecurityDialog.isLocked()).toBe(false);
-
- // Set a non-numeric password.
- await p1SecurityDialog.addPassword('AAAAA');
-
- expect(await p1SecurityDialog.isLocked()).toBe(false);
- await p1SecurityDialog.clickCloseButton();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- await p1SecurityDialog.addPassword('12345');
- await p1SecurityDialog.clickCloseButton();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- expect(await p1SecurityDialog.isLocked()).toBe(true);
- });
-});
diff --git a/tests/specs/iframe/chat.spec.ts b/tests/specs/iframe/chat.spec.ts
index 96871f37cb..2d4540925e 100644
--- a/tests/specs/iframe/chat.spec.ts
+++ b/tests/specs/iframe/chat.spec.ts
@@ -9,7 +9,7 @@ setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
-describe('iFrame API for Chat', () => {
+describe('Chat', () => {
let p1: Participant, p2: Participant;
it('setup', async () => {
diff --git a/tests/specs/jaas/joinMuc.spec.ts b/tests/specs/jaas/joinMuc.spec.ts
index cb3a660a2c..46652cfdf3 100644
--- a/tests/specs/jaas/joinMuc.spec.ts
+++ b/tests/specs/jaas/joinMuc.spec.ts
@@ -7,7 +7,7 @@ setTestProperties(__filename, {
useJaas: true
});
-describe('XMPP login and MUC join test', () => {
+describe('XMPP login and MUC join', () => {
it('with a valid token (wildcard room)', async () => {
console.log('Joining a MUC with a valid token (wildcard room)');
const p = await joinJaasMuc({ token: t({ room: '*' }) });
diff --git a/tests/specs/jaas/maxOccupants.spec.ts b/tests/specs/jaas/maxOccupants.spec.ts
index 377932045c..1b0287b890 100644
--- a/tests/specs/jaas/maxOccupants.spec.ts
+++ b/tests/specs/jaas/maxOccupants.spec.ts
@@ -7,7 +7,7 @@ setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2', 'p3' ]
});
-describe('MaxOccupants limit enforcement', () => {
+describe('MaxOccupants', () => {
it('test maxOccupants limit', async () => {
ctx.webhooksProxy.defaultMeetingSettings = {
maxOccupants: 2
diff --git a/tests/specs/jaas/passcodeInvalid.spec.ts b/tests/specs/jaas/passcodeInvalid.spec.ts
index 3219fb0096..6179b82e76 100644
--- a/tests/specs/jaas/passcodeInvalid.spec.ts
+++ b/tests/specs/jaas/passcodeInvalid.spec.ts
@@ -8,7 +8,7 @@ setTestProperties(__filename, {
// This test is separate from passcode.spec.ts, because it needs to use a different room name, and webhooksProxy is only
// setup for the default room name.
-describe('Setting passcode through settings provisioning', () => {
+describe('Setting invalid passcode through settings provisioning', () => {
it('With an invalid passcode', async () => {
ctx.webhooksProxy.defaultMeetingSettings = {
passcode: 'passcode-must-be-digits-only'
diff --git a/tests/specs/jaas/recording.spec.ts b/tests/specs/jaas/recording.spec.ts
index c2645524e8..396729f9c3 100644
--- a/tests/specs/jaas/recording.spec.ts
+++ b/tests/specs/jaas/recording.spec.ts
@@ -15,7 +15,7 @@ setTestProperties(__filename, {
* TODO: read flags from config.
* TODO: also assert "this meeting is being recorder" notificaitons are show/played?
*/
-describe('Recording and Live Streaming', () => {
+describe('Recording and live-streaming', () => {
const tenant = testsConfig.jaas.tenant;
const customerId = tenant?.replace('vpaas-magic-cookie-', '');
// TODO: read from config
diff --git a/tests/specs/jaas/transcriptions.spec.ts b/tests/specs/jaas/transcriptions.spec.ts
index 4e1860e8e9..6096dfc0c6 100644
--- a/tests/specs/jaas/transcriptions.spec.ts
+++ b/tests/specs/jaas/transcriptions.spec.ts
@@ -11,7 +11,7 @@ setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
-describe('Transcriptions', () => {
+describe('Transcription', () => {
let p1: Participant, p2: Participant;
let webhooksProxy: WebhookProxy;
diff --git a/tests/specs/jaas/visitors/visitorsLive.spec.ts b/tests/specs/jaas/visitors/visitorsLive.spec.ts
index 98d4c67b8a..5d782c84cf 100644
--- a/tests/specs/jaas/visitors/visitorsLive.spec.ts
+++ b/tests/specs/jaas/visitors/visitorsLive.spec.ts
@@ -10,7 +10,7 @@ setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
-describe('Visitors', () => {
+describe('Visitors live', () => {
let visitor: Participant, moderator: Participant;
it('setup', async () => {
diff --git a/tests/specs/3way/activeSpeaker.spec.ts b/tests/specs/media/activeSpeaker.spec.ts
similarity index 95%
rename from tests/specs/3way/activeSpeaker.spec.ts
rename to tests/specs/media/activeSpeaker.spec.ts
index 57ef6c8950..d70946ff3f 100644
--- a/tests/specs/3way/activeSpeaker.spec.ts
+++ b/tests/specs/media/activeSpeaker.spec.ts
@@ -1,8 +1,13 @@
import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureThreeParticipants } from '../../helpers/participants';
import { muteAudioAndCheck } from '../helpers/mute';
-describe('ActiveSpeaker', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
+describe('Active speaker', () => {
it('testActiveSpeaker', async () => {
await ensureThreeParticipants();
diff --git a/tests/specs/2way/audioOnly.spec.ts b/tests/specs/media/audioOnly.spec.ts
similarity index 94%
rename from tests/specs/2way/audioOnly.spec.ts
rename to tests/specs/media/audioOnly.spec.ts
index 8e1a6c6773..caa58e83ed 100644
--- a/tests/specs/2way/audioOnly.spec.ts
+++ b/tests/specs/media/audioOnly.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
-describe('Audio only', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Audio-only mode', () => {
it('joining the meeting', () => ensureTwoParticipants());
/**
diff --git a/tests/specs/3way/audioVideoModeration.spec.ts b/tests/specs/media/audioVideoModeration.spec.ts
similarity index 98%
rename from tests/specs/3way/audioVideoModeration.spec.ts
rename to tests/specs/media/audioVideoModeration.spec.ts
index 4b0e4bd1b7..85aae63263 100644
--- a/tests/specs/3way/audioVideoModeration.spec.ts
+++ b/tests/specs/media/audioVideoModeration.spec.ts
@@ -1,4 +1,5 @@
import { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import { expectations } from '../../helpers/expectations';
import {
ensureOneParticipant,
@@ -7,14 +8,18 @@ import {
} from '../../helpers/participants';
import { unmuteAudioAndCheck, unmuteVideoAndCheck } from '../helpers/mute';
-describe('AVModeration', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
- it('check for moderators', async () => {
- // if all 3 participants are moderators, skip this test
+describe('Audio/video moderation', () => {
+
+ it('setup', async () => {
await ensureThreeParticipants();
const { p1, p2, p3 } = ctx;
+ // if all 3 participants are moderators, skip this test
if (!await p1.isModerator()
|| (await p1.isModerator() && await p2.isModerator() && await p3.isModerator())) {
ctx.skipSuiteTests = `Unsupported moderator configuration: p1=${await p1.isModerator()},\
diff --git a/tests/specs/3way/codecSelection.spec.ts b/tests/specs/media/codecSelection.spec.ts
similarity index 67%
rename from tests/specs/3way/codecSelection.spec.ts
rename to tests/specs/media/codecSelection.spec.ts
index 5cd1ff9d7e..f12a1cad42 100644
--- a/tests/specs/3way/codecSelection.spec.ts
+++ b/tests/specs/media/codecSelection.spec.ts
@@ -1,9 +1,16 @@
+import { VIDEO_CODEC } from '../../../react/features/video-quality/constants';
+import { setTestProperties } from '../../helpers/TestProperties';
import {
ensureOneParticipant,
ensureThreeParticipants,
ensureTwoParticipants,
hangupAllParticipants
} from '../../helpers/participants';
+const { VP8, VP9, AV1 } = VIDEO_CODEC;
+
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
describe('Codec selection', () => {
it('asymmetric codecs', async () => {
@@ -30,13 +37,10 @@ describe('Codec selection', () => {
// Check if p1 is sending VP9 and p2 is sending VP8 as per their codec preferences.
// Except on Firefox because it doesn't support VP9 encode.
- if (p1.driver.isFirefox) {
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- } else {
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
- }
+ const p1ExpectedCodec = p1.driver.isFirefox ? VP8 : VP9;
- expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(p1ExpectedCodec);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP8);
});
it('asymmetric codecs with AV1', async () => {
@@ -57,19 +61,16 @@ describe('Codec selection', () => {
// Check if p1 is encoding in VP9, p2 in VP8 and p3 in AV1 as per their codec preferences.
// Except on Firefox because it doesn't support VP9 encode.
- if (p1.driver.isFirefox) {
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- } else {
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
- }
+ const p1ExpectedCodec = p1.driver.isFirefox ? VP8 : VP9;
- expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(p1ExpectedCodec);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP8);
// If there is a Firefox ep in the call, all other eps will switch to VP9.
if (p1.driver.isFirefox && majorVersion < 136) {
- expect(await p3.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP9);
} else {
- expect(await p3.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingAv1())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(AV1);
}
});
@@ -91,8 +92,8 @@ describe('Codec selection', () => {
}
// Check if p1 and p2 are encoding in VP9 which is the default codec.
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
- expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP9);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP9);
await ensureThreeParticipants({
configOverwrite: {
@@ -105,25 +106,25 @@ describe('Codec selection', () => {
const { p3 } = ctx;
// Check if all three participants are encoding in VP8 now.
- expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- expect(await p3.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP8);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP8);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.getLocalCameraEncoding())).toBe(VP8);
await p3.hangup();
// Check of p1 and p2 have switched to VP9.
await p1.driver.waitUntil(
- () => p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
+ () => p1.execute(c => JitsiMeetJS.app.testing.getLocalCameraEncoding() === c, VP9),
{
timeout: 10000,
timeoutMsg: 'p1 did not switch back to VP9'
}
);
await p2.driver.waitUntil(
- () => p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
+ () => p2.execute(c => JitsiMeetJS.app.testing.getLocalCameraEncoding() === c, VP9),
{
timeout: 10000,
- timeoutMsg: 'p1 did not switch back to VP9'
+ timeoutMsg: 'p2 did not switch back to VP9'
}
);
});
diff --git a/tests/specs/4way/desktopSharing.spec.ts b/tests/specs/media/desktopSharing.spec.ts
similarity index 98%
rename from tests/specs/4way/desktopSharing.spec.ts
rename to tests/specs/media/desktopSharing.spec.ts
index dae64483a2..0b47bb16cf 100644
--- a/tests/specs/4way/desktopSharing.spec.ts
+++ b/tests/specs/media/desktopSharing.spec.ts
@@ -1,4 +1,5 @@
import { SET_AUDIO_ONLY } from '../../../react/features/base/audio-only/actionTypes';
+import { setTestProperties } from '../../helpers/TestProperties';
import {
checkForScreensharingTile,
ensureFourParticipants,
@@ -8,6 +9,10 @@ import {
hangupAllParticipants
} from '../../helpers/participants';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3', 'p4' ]
+});
+
describe('Desktop sharing', () => {
it('start', async () => {
await ensureTwoParticipants({
diff --git a/tests/specs/4way/lastN.spec.ts b/tests/specs/media/lastN.spec.ts
similarity index 93%
rename from tests/specs/4way/lastN.spec.ts
rename to tests/specs/media/lastN.spec.ts
index 5188068c13..c06c291d4d 100644
--- a/tests/specs/4way/lastN.spec.ts
+++ b/tests/specs/media/lastN.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureFourParticipants, ensureThreeParticipants, ensureTwoParticipants } from '../../helpers/participants';
-describe('lastN', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3', 'p4' ]
+});
+
+describe('LastN', () => {
it('joining the meeting', async () => {
await ensureTwoParticipants({
configOverwrite: {
diff --git a/tests/specs/2way/mute.spec.ts b/tests/specs/media/mute.spec.ts
similarity index 96%
rename from tests/specs/2way/mute.spec.ts
rename to tests/specs/media/mute.spec.ts
index 919d50d24b..8d2cb626e2 100644
--- a/tests/specs/2way/mute.spec.ts
+++ b/tests/specs/media/mute.spec.ts
@@ -1,4 +1,5 @@
import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import {
checkForScreensharingTile,
ensureOneParticipant,
@@ -11,6 +12,10 @@ import {
unmuteVideoAndCheck
} from '../helpers/mute';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
describe('Mute', () => {
it('joining the meeting', () => ensureTwoParticipants());
diff --git a/tests/specs/2way/switchVideo.spec.ts b/tests/specs/media/pinning.spec.ts
similarity index 86%
rename from tests/specs/2way/switchVideo.spec.ts
rename to tests/specs/media/pinning.spec.ts
index f9514eb44a..3d88d68fac 100644
--- a/tests/specs/2way/switchVideo.spec.ts
+++ b/tests/specs/media/pinning.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
-describe('SwitchVideo', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Pinning', () => {
it('joining the meeting', () => ensureTwoParticipants());
it('p1 click on local', () => ctx.p1.getFilmstrip().pinParticipant(ctx.p1));
diff --git a/tests/specs/3way/startMuted.spec.ts b/tests/specs/media/startMuted.spec.ts
similarity index 98%
rename from tests/specs/3way/startMuted.spec.ts
rename to tests/specs/media/startMuted.spec.ts
index af68c24c2c..c267339463 100644
--- a/tests/specs/3way/startMuted.spec.ts
+++ b/tests/specs/media/startMuted.spec.ts
@@ -1,3 +1,4 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import {
checkForScreensharingTile,
ensureOneParticipant,
@@ -8,7 +9,11 @@ import {
} from '../../helpers/participants';
import { unmuteVideoAndCheck } from '../helpers/mute';
-describe('StartMuted', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
+describe('Start muted', () => {
it('checkboxes test', async () => {
const options = {
configOverwrite: {
diff --git a/tests/specs/2way/stopVideo.spec.ts b/tests/specs/media/stopVideo.spec.ts
similarity index 91%
rename from tests/specs/2way/stopVideo.spec.ts
rename to tests/specs/media/stopVideo.spec.ts
index 3c78b6de81..25764c98bd 100644
--- a/tests/specs/2way/stopVideo.spec.ts
+++ b/tests/specs/media/stopVideo.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
import { muteVideoAndCheck, unmuteVideoAndCheck } from '../helpers/mute';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
describe('Stop video', () => {
it('joining the meeting', () => ensureTwoParticipants());
diff --git a/tests/specs/3way/avatars.spec.ts b/tests/specs/misc/avatars.spec.ts
similarity index 98%
rename from tests/specs/3way/avatars.spec.ts
rename to tests/specs/misc/avatars.spec.ts
index 534e32cbe3..490d820041 100644
--- a/tests/specs/3way/avatars.spec.ts
+++ b/tests/specs/misc/avatars.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureThreeParticipants, ensureTwoParticipants } from '../../helpers/participants';
import { unmuteVideoAndCheck } from '../helpers/mute';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
const EMAIL = '[email protected]';
const HASH = '38f014e4b7dde0f64f8157d26a8c812e';
diff --git a/tests/specs/3way/breakoutRooms.spec.ts b/tests/specs/misc/breakoutRooms.spec.ts
similarity index 98%
rename from tests/specs/3way/breakoutRooms.spec.ts
rename to tests/specs/misc/breakoutRooms.spec.ts
index f3379598c2..22628fe014 100644
--- a/tests/specs/3way/breakoutRooms.spec.ts
+++ b/tests/specs/misc/breakoutRooms.spec.ts
@@ -1,6 +1,7 @@
import type { ChainablePromiseElement } from 'webdriverio';
import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import {
checkSubject,
ensureThreeParticipants,
@@ -8,11 +9,15 @@ import {
hangupAllParticipants
} from '../../helpers/participants';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
const MAIN_ROOM_NAME = 'Main room';
const BREAKOUT_ROOMS_LIST_ID = 'breakout-rooms-list';
const LIST_ITEM_CONTAINER = 'list-item-container';
-describe('BreakoutRooms', () => {
+describe('Breakout rooms', () => {
it('check support', async () => {
await ensureTwoParticipants();
diff --git a/tests/specs/misc/connectivity.spec.ts b/tests/specs/misc/connectivity.spec.ts
new file mode 100644
index 0000000000..e1da593251
--- /dev/null
+++ b/tests/specs/misc/connectivity.spec.ts
@@ -0,0 +1,54 @@
+import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
+import { config as testsConfig } from '../../helpers/TestsConfig';
+import { joinMuc, waitForMedia } from '../../helpers/joinMuc';
+
+setTestProperties(__filename, {
+ description: 'This test asserts that the connection to JVB is over UDP and using the same remote port. ',
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Connectivity', () => {
+ let p1: Participant, p2: Participant;
+
+ it('setup', async () => {
+ p1 = await joinMuc({ name: 'p1', token: testsConfig.jwt.preconfiguredToken });
+ p2 = await joinMuc({ name: 'p2', token: testsConfig.jwt.preconfiguredToken });
+ await waitForMedia([ p1, p2 ]);
+ });
+
+ it('protocol', async () => {
+ expect(await getProtocol(p1)).toBe('udp');
+ expect(await getProtocol(p2)).toBe('udp');
+ });
+
+ it('port', async () => {
+ const port1 = await getRemotePort(p1);
+ const port2 = await getRemotePort(p2);
+
+ expect(Number.isInteger(port1)).toBe(true);
+ expect(Number.isInteger(port2)).toBe(true);
+ expect(port1).toBe(port2);
+ });
+});
+
+/**
+ * Get the remote port of the participant.
+ * @param participant
+ */
+async function getRemotePort(participant: Participant) {
+ const data = await participant.execute(() => APP?.conference?.getStats()?.transport[0]?.ip);
+ const parts = data.split(':');
+
+ return parts.length > 1 ? parseInt(parts[1], 10) : '';
+}
+
+/**
+ * Get the remote port of the participant.
+ * @param participant
+ */
+async function getProtocol(participant: Participant) {
+ const data = await participant.execute(() => APP?.conference?.getStats()?.transport[0]?.type);
+
+ return data.toLowerCase();
+}
diff --git a/tests/specs/misc/dialIn.spec.ts b/tests/specs/misc/dialIn.spec.ts
new file mode 100644
index 0000000000..28f1ae5746
--- /dev/null
+++ b/tests/specs/misc/dialIn.spec.ts
@@ -0,0 +1,119 @@
+import process from 'node:process';
+
+import { setTestProperties } from '../../helpers/TestProperties';
+import { config as testsConfig } from '../../helpers/TestsConfig';
+import { expectations } from '../../helpers/expectations';
+import { ensureOneParticipant } from '../../helpers/participants';
+import {
+ assertDialInDisplayed,
+ assertUrlDisplayed,
+ cleanup,
+ dialIn,
+ isDialInEnabled, verifyMoreNumbersPage,
+ waitForAudioFromDialInParticipant
+} from '../helpers/DialIn';
+
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1' ]
+});
+
+/**
+ * This test is configured with two options:
+ * 1. The dialIn.enabled expectation. If set to true we assert the config.js settings for dial-in are set, the dial-in
+ * panel (including the PIN number) is displayed in the UI, and the "more numbers" page is displayed. If it's set to
+ * false we assert the config.js settings are not set, and the PIN is not displayed.
+ * 2. The DIAL_IN_REST_URL environment variable. If this is set and the environment supports dial-in, we invite a
+ * dial-in participant via this URL and assert that it joins the conference and sends media.
+ */
+describe('Dial-in', () => {
+ it('join participant', async () => {
+ // The same cases are covered for JaaS in jaas/dial/dialin.spec.ts.
+ if (testsConfig.jaas.enabled) {
+ ctx.skipSuiteTests = 'JaaS is configured.';
+
+ return;
+ }
+
+ await ensureOneParticipant();
+ expect(await ctx.p1.isInMuc()).toBe(true);
+ });
+
+ it('dial in config.js values', async function() {
+ if (expectations.dialIn.enabled === true) {
+ expect(await isDialInEnabled(ctx.p1)).toBe(expectations.dialIn.enabled);
+ } else {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
+ }
+ });
+
+ it('open/close invite dialog', async () => {
+ await ctx.p1.getInviteDialog().open();
+ await ctx.p1.getInviteDialog().clickCloseButton();
+ });
+
+ it('dial-in displayed', async function() {
+ if (expectations.dialIn.enabled !== null) {
+ await assertDialInDisplayed(ctx.p1, expectations.dialIn.enabled);
+ } else {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
+ }
+ });
+
+ it('skip the rest if dial-in is not expected', async () => {
+ if (!expectations.dialIn.enabled) {
+ ctx.skipSuiteTests = 'Dial-in is not expected';
+ }
+ });
+
+ it('url displayed', () => assertUrlDisplayed(ctx.p1));
+
+
+ it('view more numbers page', async () => {
+ await verifyMoreNumbersPage(ctx.p1);
+ });
+
+ it('retrieve pin', async () => {
+ let dialInPin: string;
+
+ try {
+ dialInPin = await ctx.p1.getDialInPin();
+ } catch (e) {
+ console.error('dial-in.test.no-pin');
+ ctx.skipSuiteTests = 'No dial-in pin is available.';
+ throw e;
+ }
+
+ if (dialInPin.length === 0) {
+ console.error('dial-in.test.no-pin');
+ ctx.skipSuiteTests = 'The dial-in pin is empty.';
+ throw new Error('no pin');
+ }
+
+ expect(dialInPin.length >= 8).toBe(true);
+ });
+
+ it('skip the rest if a dial-in URL is not configured', async () => {
+ if (!process.env.DIAL_IN_REST_URL) {
+ ctx.skipSuiteTests = 'DIAL_IN_REST_URL is not set.';
+ }
+ });
+
+ it('invite dial-in participant', async () => {
+ await dialIn(await ctx.p1.getDialInPin());
+ });
+
+ it('wait for audio from dial-in participant', async () => {
+ const { p1 } = ctx;
+
+ if (!await p1.isInMuc()) {
+ // local participant did not join abort
+ return;
+ }
+
+ await waitForAudioFromDialInParticipant(p1);
+
+ await cleanup(p1);
+ });
+});
diff --git a/tests/specs/3way/followMe.spec.ts b/tests/specs/misc/followMe.spec.ts
similarity index 94%
rename from tests/specs/3way/followMe.spec.ts
rename to tests/specs/misc/followMe.spec.ts
index dc80191796..cf2cd14d98 100644
--- a/tests/specs/3way/followMe.spec.ts
+++ b/tests/specs/misc/followMe.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureThreeParticipants, ensureTwoParticipants } from '../../helpers/participants';
-describe('Follow Me', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
+describe('Follow me', () => {
it('joining the meeting', async () => {
await ensureTwoParticipants();
diff --git a/tests/specs/2way/polls.spec.ts b/tests/specs/misc/polls.spec.ts
similarity index 96%
rename from tests/specs/2way/polls.spec.ts
rename to tests/specs/misc/polls.spec.ts
index efefca242b..2bfb910bb1 100644
--- a/tests/specs/2way/polls.spec.ts
+++ b/tests/specs/misc/polls.spec.ts
@@ -1,5 +1,10 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
describe('Polls', () => {
it('joining the meeting', async () => {
await ensureTwoParticipants();
diff --git a/tests/specs/misc/subject.spec.ts b/tests/specs/misc/subject.spec.ts
new file mode 100644
index 0000000000..3c8fb88164
--- /dev/null
+++ b/tests/specs/misc/subject.spec.ts
@@ -0,0 +1,37 @@
+import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
+import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/participants';
+
+const MY_TEST_SUBJECT = 'My Test Subject';
+const SUBJECT_XPATH = '//div[starts-with(@class, "subject-text")]';
+
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Subject', () => {
+ it('setup', async () => {
+ await ensureOneParticipant({
+ configOverwrite: {
+ subject: MY_TEST_SUBJECT
+ }
+ });
+ await ensureTwoParticipants();
+ });
+ it('subject set locally', async () => await checkSubject(ctx.p1, MY_TEST_SUBJECT));
+ it('subject set remotely', async () => await checkSubject(ctx.p2, MY_TEST_SUBJECT));
+});
+
+/**
+ * Check was subject set.
+ *
+ * @param participant
+ * @param subject
+ */
+async function checkSubject(participant: Participant, subject: string) {
+ const localTile = participant.driver.$(SUBJECT_XPATH);
+
+ await localTile.moveTo();
+
+ expect(await localTile.getText()).toBe(subject);
+}
diff --git a/tests/specs/misc/urlNormalisation.spec.ts b/tests/specs/misc/urlNormalisation.spec.ts
index 28fe05f493..1e17175f9f 100644
--- a/tests/specs/misc/urlNormalisation.spec.ts
+++ b/tests/specs/misc/urlNormalisation.spec.ts
@@ -1,12 +1,16 @@
import { setTestProperties } from '../../helpers/TestProperties';
import { config as testsConfig } from '../../helpers/TestsConfig';
+import { expectations } from '../../helpers/expectations';
import { joinMuc } from '../../helpers/joinMuc';
setTestProperties(__filename, {
usesBrowsers: [ 'p1' ]
});
-describe('URL Normalisation', () => {
+describe('URL normalisation', () => {
+ // If we're not able to create conferences with a custom tenant, we'll only test the room name.
+ const useTenant = expectations.useTenant;
+
const tests = [
{
hint: '@ sign and .',
@@ -47,12 +51,13 @@ describe('URL Normalisation', () => {
it(test.hint, async () => {
const fullRoom = `${test.room}${ctx.roomName}`;
const fullRoomUrl = `${test.roomUrl}${ctx.roomName}`;
+ const tenant = useTenant ? test.tenant : undefined;
const p = await joinMuc({
name: 'p1',
token: testsConfig.jwt.preconfiguredToken,
}, {
- tenant: test.tenant,
+ tenant: tenant,
roomName: fullRoom
});
@@ -61,7 +66,9 @@ describe('URL Normalisation', () => {
const path = currentUrl.pathname;
const parts = path.split('/');
- expect(parts[1]).toBe(test.tenantUrl);
+ if (useTenant) {
+ expect(parts[1]).toBe(test.tenantUrl);
+ }
expect(parts[2]).toBe(fullRoomUrl);
const mucJid = (await p.execute(() => APP.conference._room.room.roomjid)).split('@');
@@ -69,7 +76,9 @@ describe('URL Normalisation', () => {
const domain = mucJid[1];
expect(roomJid).toBe(`${test.roomJid}${ctx.roomName}`);
- expect(domain.startsWith(`conference.${test.tenantJid}.`)).toBe(true);
+ if (useTenant) {
+ expect(domain.startsWith(`conference.${test.tenantJid}.`)).toBe(true);
+ }
});
}
});
diff --git a/tests/specs/3way/lobby.spec.ts b/tests/specs/moderation/lobby.spec.ts
similarity index 99%
rename from tests/specs/3way/lobby.spec.ts
rename to tests/specs/moderation/lobby.spec.ts
index ae89adf357..f3bec3bb7e 100644
--- a/tests/specs/3way/lobby.spec.ts
+++ b/tests/specs/moderation/lobby.spec.ts
@@ -1,4 +1,5 @@
import { P1, P3, Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import { expectations } from '../../helpers/expectations';
import {
ensureOneParticipant,
@@ -9,6 +10,10 @@ import {
import type { IJoinOptions } from '../../helpers/types';
import type PreMeetingScreen from '../../pageobjects/PreMeetingScreen';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
describe('Lobby', () => {
it('joining the meeting', async () => {
await ensureOneParticipant();
diff --git a/tests/specs/2way/lockRoom.spec.ts b/tests/specs/moderation/lockRoom.spec.ts
similarity index 54%
rename from tests/specs/2way/lockRoom.spec.ts
rename to tests/specs/moderation/lockRoom.spec.ts
index 6b48ef322f..32e120f31b 100644
--- a/tests/specs/2way/lockRoom.spec.ts
+++ b/tests/specs/moderation/lockRoom.spec.ts
@@ -1,41 +1,56 @@
+import { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
+import { expectations } from '../../helpers/expectations';
import { ensureOneParticipant, ensureTwoParticipants, joinSecondParticipant } from '../../helpers/participants';
import type SecurityDialog from '../../pageobjects/SecurityDialog';
-let roomKey: string;
+setTestProperties(__filename, {
+ description: '1. Set a room password (assert the image changes to locked). \
+ 2. Join with a second participant. \
+ 3. Assert password is required (and padlock is locked). \
+ 4. Assert wrong password fails. \
+ 5. Unlock the room (assert the padlock is unlocked) \
+ 6. Assert room is unlocked and the padlock is unlocked.',
+ usesBrowsers: [ 'p1', 'p2' ]
+});
-/**
- * 1. Lock the room (make sure the image changes to locked)
- * 2. Join with a second browser/tab
- * 3. Make sure we are required to enter a password.
- * (Also make sure the padlock is locked)
- * 4. Enter wrong password, make sure we are not joined in the room
- * 5. Unlock the room (Make sure the padlock is unlocked)
- * 6. Join again and make sure we are not asked for a password and that
- * the padlock is unlocked.
- */
-describe('Lock Room', () => {
- it('joining the meeting', () => ensureOneParticipant());
- it('locks the room', () => participant1LockRoom());
+describe('Lock room', () => {
+ let p1: Participant, p2: Participant;
+ let roomKey: string;
+
+ it('setup', async () => {
+ if (!expectations.moderation.setPasswordAvailable) {
+ ctx.skipSuiteTests = 'setPasswordAvailable is not expected to be available';
+
+ return;
+ }
+
+ await ensureOneParticipant();
+ p1 = ctx.p1;
+ roomKey = `${Math.trunc(Math.random() * 1_000_000)}`;
+ await setPassword(p1, roomKey);
+ });
it('enter participant in locked room', async () => {
// first enter wrong pin then correct one
await joinSecondParticipant({
skipWaitToJoin: true
});
- const { p2 } = ctx;
+ p2 = ctx.p2;
- // wait for password prompt
const p2PasswordDialog = p2.getPasswordDialog();
+ // Submit a wrong password
await p2PasswordDialog.waitForDialog();
await p2PasswordDialog.submitPassword(`${roomKey}1234`);
- // give sometime to the password prompt to disappear and send the password
+ // give some time to the password prompt to disappear and send the password
+ // TODO: wait until the dialog is not displayed? Assert the room is not joined?
await p2.driver.pause(500);
- // wait for password prompt
+ // Submit the correct password
await p2PasswordDialog.waitForDialog();
await p2PasswordDialog.submitPassword(roomKey);
@@ -50,57 +65,51 @@ describe('Lock Room', () => {
});
it('unlock room', async () => {
- // Unlock room. Check whether room is still locked. Click remove and check whether it is unlocked.
- await ctx.p2.hangup();
+ await p2.hangup();
- await participant1UnlockRoom();
+ await removePassword(p1);
});
- it('enter participant in unlocked room', async () => {
+ it('join the unlocked room', async () => {
// 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();
+ p2 = ctx.p2;
- const { p2 } = ctx;
const p2SecurityDialog = p2.getSecurityDialog();
await p2.getToolbar().clickSecurityButton();
await p2SecurityDialog.waitForDisplay();
await waitForRoomLockState(p2SecurityDialog, false);
-
await p2SecurityDialog.clickCloseButton();
});
- it('update locked state while participants in room', async () => {
+ it('set password while participants are in the room', async () => {
// Both participants are in unlocked room, lock it and see whether the
// change is reflected on the second participant icon.
- await participant1LockRoom();
+ roomKey = `${Math.trunc(Math.random() * 1_000_000)}`;
+ await setPassword(p1, roomKey);
- const { p2 } = ctx;
const p2SecurityDialog = p2.getSecurityDialog();
await p2.getToolbar().clickSecurityButton();
await p2SecurityDialog.waitForDisplay();
await waitForRoomLockState(p2SecurityDialog, true);
-
- await participant1UnlockRoom();
-
+ await removePassword(p1);
await waitForRoomLockState(p2SecurityDialog, false);
});
it('unlock after participant enter wrong password', async () => {
// P1 locks the room. Participant tries to enter using wrong password.
// P1 unlocks the room and Participant submits the password prompt with no password entered and
// should enter of unlocked room.
- await ctx.p2.hangup();
- await participant1LockRoom();
+ await p2.hangup();
+ roomKey = `${Math.trunc(Math.random() * 1_000_000)}`;
+ await setPassword(p1, roomKey);
await joinSecondParticipant({
skipWaitToJoin: true
});
-
- const { p2 } = ctx;
+ p2 = ctx.p2;
// wait for password prompt
const p2PasswordDialog = p2.getPasswordDialog();
@@ -114,7 +123,7 @@ describe('Lock Room', () => {
// wait for password prompt
await p2PasswordDialog.waitForDialog();
- await participant1UnlockRoom();
+ await removePassword(p1);
await p2PasswordDialog.clickOkButton();
await p2.waitToJoinMUC();
@@ -129,46 +138,33 @@ describe('Lock Room', () => {
});
/**
- * Participant1 locks the room.
+ * Set a room password via the UI.
*/
-async function participant1LockRoom() {
- roomKey = `${Math.trunc(Math.random() * 1_000_000)}`;
-
- const { p1 } = ctx;
- const p1SecurityDialog = p1.getSecurityDialog();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- await waitForRoomLockState(p1SecurityDialog, false);
-
- await p1SecurityDialog.addPassword(roomKey);
-
- await p1SecurityDialog.clickCloseButton();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- await waitForRoomLockState(p1SecurityDialog, true);
-
- await p1SecurityDialog.clickCloseButton();
+async function setPassword(p: Participant, password: string) {
+ const securityDialog = p.getSecurityDialog();
+
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+ await waitForRoomLockState(securityDialog, false);
+ await securityDialog.addPassword(password);
+ await securityDialog.clickCloseButton();
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+ await waitForRoomLockState(securityDialog, true);
+ await securityDialog.clickCloseButton();
}
/**
- * Participant1 unlocks the room.
+ * Remove the room password via the UI.
*/
-async function participant1UnlockRoom() {
- const { p1 } = ctx;
- const p1SecurityDialog = p1.getSecurityDialog();
-
- await p1.getToolbar().clickSecurityButton();
- await p1SecurityDialog.waitForDisplay();
-
- await p1SecurityDialog.removePassword();
-
- await waitForRoomLockState(p1SecurityDialog, false);
-
- await p1SecurityDialog.clickCloseButton();
+async function removePassword(p: Participant) {
+ const securityDialog = p.getSecurityDialog();
+
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+ await securityDialog.removePassword();
+ await waitForRoomLockState(securityDialog, false);
+ await securityDialog.clickCloseButton();
}
/**
diff --git a/tests/specs/alone/chatPanel.spec.ts b/tests/specs/ui/chatPanel.spec.ts
similarity index 97%
rename from tests/specs/alone/chatPanel.spec.ts
rename to tests/specs/ui/chatPanel.spec.ts
index f7bcdab714..78949abba2 100644
--- a/tests/specs/alone/chatPanel.spec.ts
+++ b/tests/specs/ui/chatPanel.spec.ts
@@ -1,6 +1,6 @@
import { ensureOneParticipant } from '../../helpers/participants';
-describe('Chat Panel', () => {
+describe('Chat panel', () => {
it('join participant', () => ensureOneParticipant());
it('start closed', async () => {
diff --git a/tests/specs/2way/displayName.spec.ts b/tests/specs/ui/displayName.spec.ts
similarity index 90%
rename from tests/specs/2way/displayName.spec.ts
rename to tests/specs/ui/displayName.spec.ts
index 106a0c2ca4..80b6fd90bb 100644
--- a/tests/specs/2way/displayName.spec.ts
+++ b/tests/specs/ui/displayName.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
-describe('DisplayName', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Display name', () => {
it('joining the meeting', () => ensureTwoParticipants({ skipDisplayName: true }));
it('check change', async () => {
diff --git a/tests/specs/2way/endConference.spec.ts b/tests/specs/ui/endConference.spec.ts
similarity index 77%
rename from tests/specs/2way/endConference.spec.ts
rename to tests/specs/ui/endConference.spec.ts
index ba0061b4f9..eeccacd3fe 100644
--- a/tests/specs/2way/endConference.spec.ts
+++ b/tests/specs/ui/endConference.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
-describe('End Conference', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Hangup', () => {
it('joining the meeting', () => ensureTwoParticipants());
it('hangup call and check', async () => {
diff --git a/tests/specs/ui/lockRoomDigitsOnly.spec.ts b/tests/specs/ui/lockRoomDigitsOnly.spec.ts
new file mode 100644
index 0000000000..5b359c028b
--- /dev/null
+++ b/tests/specs/ui/lockRoomDigitsOnly.spec.ts
@@ -0,0 +1,63 @@
+import { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
+import { config as testsConfig } from '../../helpers/TestsConfig';
+import { expectations } from '../../helpers/expectations';
+import { joinMuc } from '../../helpers/joinMuc';
+
+setTestProperties(__filename, {
+ description: ' Tests that the digits only password feature works. When the roomPasswordNumberOfDigits config \
+ option is set, the UI should only allow setting the password to a string of digits (with the given length).'
+});
+describe('Lock room with digits only', () => {
+ let p: Participant;
+
+ it('setup', async () => {
+ if (!expectations.moderation.setPasswordAvailable) {
+ ctx.skipSuiteTests = 'setPasswordAvailable is not expected to be available';
+
+ return;
+ }
+
+ p = await joinMuc({
+ name: 'p1',
+ token: testsConfig.jwt.preconfiguredToken
+ }, {
+ configOverwrite: {
+ roomPasswordNumberOfDigits: 5
+ }
+ });
+ });
+
+ it('config value', async () => {
+ expect(await p.execute(
+ () => APP.store.getState()['features/base/config'].roomPasswordNumberOfDigits)).toBe(5);
+ });
+ it('set an invalid password', async () => {
+ const securityDialog = p.getSecurityDialog();
+
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+
+ expect(await securityDialog.isLocked()).toBe(false);
+
+ // Set a non-numeric password.
+ await securityDialog.addPassword('AAAAA');
+
+ expect(await securityDialog.isLocked()).toBe(false);
+ await securityDialog.clickCloseButton();
+ });
+ it('set a valid password', async () => {
+ const securityDialog = p.getSecurityDialog();
+
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+
+ await securityDialog.addPassword('12345');
+ await securityDialog.clickCloseButton();
+
+ await p.getToolbar().clickSecurityButton();
+ await securityDialog.waitForDisplay();
+
+ expect(await securityDialog.isLocked()).toBe(true);
+ });
+});
diff --git a/tests/specs/3way/oneOnOne.spec.ts b/tests/specs/ui/oneOnOne.spec.ts
similarity index 92%
rename from tests/specs/3way/oneOnOne.spec.ts
rename to tests/specs/ui/oneOnOne.spec.ts
index d77a1545dd..0a51f4a536 100644
--- a/tests/specs/3way/oneOnOne.spec.ts
+++ b/tests/specs/ui/oneOnOne.spec.ts
@@ -1,9 +1,14 @@
import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import {
ensureThreeParticipants,
ensureTwoParticipants
} from '../../helpers/participants';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2', 'p3' ]
+});
+
const ONE_ON_ONE_CONFIG_OVERRIDES = {
configOverwrite: {
disable1On1Mode: false,
@@ -14,7 +19,7 @@ const ONE_ON_ONE_CONFIG_OVERRIDES = {
}
};
-describe('OneOnOne', () => {
+describe('One-on-one (1on1) mode', () => {
it('filmstrip hidden in 1on1', async () => {
await ensureTwoParticipants(ONE_ON_ONE_CONFIG_OVERRIDES);
diff --git a/tests/specs/2way/preJoin.spec.ts b/tests/specs/ui/preJoin.spec.ts
similarity index 94%
rename from tests/specs/2way/preJoin.spec.ts
rename to tests/specs/ui/preJoin.spec.ts
index c22a6581c1..dfb1d55a0a 100644
--- a/tests/specs/2way/preJoin.spec.ts
+++ b/tests/specs/ui/preJoin.spec.ts
@@ -1,6 +1,11 @@
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureOneParticipant, joinFirstParticipant, joinSecondParticipant } from '../../helpers/participants';
-describe('PreJoin', () => {
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
+describe('Pre-join screen', () => {
it('display name required', async () => {
await joinFirstParticipant({
configOverwrite: {
diff --git a/tests/specs/2way/selfView.spec.ts b/tests/specs/ui/selfView.spec.ts
similarity index 93%
rename from tests/specs/2way/selfView.spec.ts
rename to tests/specs/ui/selfView.spec.ts
index 991074eb4f..62c51b7730 100644
--- a/tests/specs/2way/selfView.spec.ts
+++ b/tests/specs/ui/selfView.spec.ts
@@ -1,6 +1,11 @@
import type { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
import { ensureTwoParticipants } from '../../helpers/participants';
+setTestProperties(__filename, {
+ usesBrowsers: [ 'p1', 'p2' ]
+});
+
describe('Self view', () => {
it('joining the meeting', () => ensureTwoParticipants());
diff --git a/tests/specs/tileView.spec.ts b/tests/specs/ui/tileView.spec.ts
similarity index 88%
rename from tests/specs/tileView.spec.ts
rename to tests/specs/ui/tileView.spec.ts
index de7ec77340..e7f27984cb 100644
--- a/tests/specs/tileView.spec.ts
+++ b/tests/specs/ui/tileView.spec.ts
@@ -1,7 +1,7 @@
-import { Participant } from '../helpers/Participant';
-import { setTestProperties } from '../helpers/TestProperties';
-import { config as testsConfig } from '../helpers/TestsConfig';
-import { joinMuc } from '../helpers/joinMuc';
+import { Participant } from '../../helpers/Participant';
+import { setTestProperties } from '../../helpers/TestProperties';
+import { config as testsConfig } from '../../helpers/TestsConfig';
+import { joinMuc } from '../../helpers/joinMuc';
/**
* The CSS selector for local video when outside of tile view. It should
@@ -20,7 +20,7 @@ setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
-describe('TileView', () => {
+describe('Tile view', () => {
let p1: Participant, p2: Participant;
before('join the meeting', async () => {
diff --git a/tests/specs/alone/videoLayout.spec.ts b/tests/specs/ui/videoLayout.spec.ts
similarity index 96%
rename from tests/specs/alone/videoLayout.spec.ts
rename to tests/specs/ui/videoLayout.spec.ts
index a6cf14a117..ac518b4eb0 100644
--- a/tests/specs/alone/videoLayout.spec.ts
+++ b/tests/specs/ui/videoLayout.spec.ts
@@ -1,6 +1,6 @@
import { ensureOneParticipant } from '../../helpers/participants';
-describe('Video Layout', () => {
+describe('Video layout', () => {
it('join participant', () => ensureOneParticipant());
it('check', async () => {
diff --git a/tests/wdio.firefox.conf.ts b/tests/wdio.firefox.conf.ts
index e421c3d1fb..b03bd759c4 100644
--- a/tests/wdio.firefox.conf.ts
+++ b/tests/wdio.firefox.conf.ts
@@ -24,15 +24,15 @@ const mergedConfig = merge(defaultConfig, {
'specs/iframe/*.spec.ts', // FF does not support uploading files (uploadFile)
// FF does not support setting a file as mic input, no dominant speaker events
- 'specs/3way/activeSpeaker.spec.ts',
- 'specs/3way/startMuted.spec.ts', // bad audio levels
- 'specs/4way/desktopSharing.spec.ts',
- 'specs/4way/lastN.spec.ts',
+ 'specs/media/activeSpeaker.spec.ts',
+ 'specs/media/startMuted.spec.ts', // bad audio levels
+ 'specs/media/desktopSharing.spec.ts',
+ 'specs/media/lastN.spec.ts',
// when unmuting a participant, we see the presence in debug logs immediately,
// but for 15 seconds it is not received/processed by the client
// (also the menu disappears after clicking one of the moderation options, does not happen manually)
- 'specs/3way/audioVideoModeration.spec.ts'
+ 'specs/media/audioVideoModeration.spec.ts'
],
capabilities: {
p1: {