Skip to content

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

feat(tests): Print error on execute failure.

Hristo Terezovedf7d1830844
diff --git a/tests/helpers/Participant.ts b/tests/helpers/Participant.ts
index eea8e0603a..f445379842 100644
--- a/tests/helpers/Participant.ts
+++ b/tests/helpers/Participant.ts
@@ -93,6 +93,24 @@ export class Participant {
this._jwt = jwt;
}
+ /**
+ * A wrapper for <tt>this.driver.execute</tt> that would catch errors, print them and throw them again.
+ *
+ * @param {string | ((...innerArgs: InnerArguments) => ReturnValue)} script - The script that will be executed.
+ * @param {any[]} args - The rest of the arguments.
+ * @returns {ReturnValue} - The result of the script.
+ */
+ async execute<ReturnValue, InnerArguments extends any[]>(
+ script: string | ((...innerArgs: InnerArguments) => ReturnValue),
+ ...args: InnerArguments): Promise<ReturnValue> {
+ try {
+ return await this.driver.execute(script, ...args);
+ } catch (error) {
+ console.error('An error occured while trying to execute a script: ', error);
+ throw error;
+ }
+ }
+
/**
* Returns participant endpoint ID.
*
@@ -100,7 +118,7 @@ export class Participant {
*/
async getEndpointId(): Promise<string> {
if (!this._endpointId) {
- this._endpointId = await this.driver.execute(() => { // eslint-disable-line arrow-body-style
+ this._endpointId = await this.execute(() => { // eslint-disable-line arrow-body-style
return APP?.conference?.getMyUserId();
});
}
@@ -218,7 +236,7 @@ export class Participant {
const parallel = [];
- parallel.push(driver.execute((name, sessionId, prefix) => {
+ parallel.push(this.execute((name, sessionId, prefix) => {
APP?.UI?.dockToolbar(true);
// disable keyframe animations (.fadeIn and .fadeOut classes)
@@ -262,7 +280,7 @@ export class Participant {
*/
async waitForPageToLoad(): Promise<void> {
return this.driver.waitUntil(
- () => this.driver.execute(() => document.readyState === 'complete'),
+ () => this.execute(() => document.readyState === 'complete'),
{
timeout: 30_000, // 30 seconds
timeoutMsg: `Timeout waiting for Page Load Request to complete for ${this.name}.`
@@ -285,14 +303,14 @@ export class Participant {
* Checks if the participant is in the meeting.
*/
isInMuc() {
- return this.driver.execute(() => typeof APP !== 'undefined' && APP.conference?.isJoined());
+ return this.execute(() => typeof APP !== 'undefined' && APP.conference?.isJoined());
}
/**
* Checks if the participant is a moderator in the meeting.
*/
async isModerator() {
- return await this.driver.execute(() => typeof APP !== 'undefined'
+ return await this.execute(() => typeof APP !== 'undefined'
&& APP.store?.getState()['features/base/participants']?.local?.role === 'moderator');
}
@@ -300,7 +318,7 @@ export class Participant {
* Checks if the meeting supports breakout rooms.
*/
async isBreakoutRoomsSupported() {
- return await this.driver.execute(() => typeof APP !== 'undefined'
+ return await this.execute(() => typeof APP !== 'undefined'
&& APP.store?.getState()['features/base/conference'].conference?.getBreakoutRooms()?.isSupported());
}
@@ -308,7 +326,7 @@ export class Participant {
* Checks if the participant is in breakout room.
*/
async isInBreakoutRoom() {
- return await this.driver.execute(() => typeof APP !== 'undefined'
+ return await this.execute(() => typeof APP !== 'undefined'
&& APP.store?.getState()['features/base/conference'].conference?.getBreakoutRooms()?.isBreakoutRoom());
}
@@ -332,11 +350,9 @@ export class Participant {
*
* @returns {Promise<void>}
*/
- async waitForIceConnected(): Promise<void> {
- const driver = this.driver;
-
- return driver.waitUntil(() =>
- driver.execute(() => APP?.conference?.getConnectionState() === 'connected'), {
+ waitForIceConnected(): Promise<void> {
+ return this.driver.waitUntil(() =>
+ this.execute(() => APP?.conference?.getConnectionState() === 'connected'), {
timeout: 15_000,
timeoutMsg: `expected ICE to be connected for 15s for ${this.name}`
});
@@ -377,7 +393,7 @@ export class Participant {
const lMsg = msg ?? `expected to ${
checkSend && checkReceive ? 'receive/send' : checkSend ? 'send' : 'receive'} data in 15s for ${this.name}`;
- return this.driver.waitUntil(() => this.driver.execute((pCheckSend: boolean, pCheckReceive: boolean) => {
+ return this.driver.waitUntil(() => this.execute((pCheckSend: boolean, pCheckReceive: boolean) => {
const stats = APP?.conference?.getStats();
const bitrateMap = stats?.bitrate || {};
const rtpStats = {
@@ -392,17 +408,18 @@ export class Participant {
});
}
+
/**
* Waits for remote streams.
*
* @param {number} number - The number of remote streams to wait for.
* @returns {Promise<void>}
*/
- waitForRemoteStreams(number: number): Promise<void> {
- const driver = this.driver;
-
- return driver.waitUntil(() =>
- driver.execute(count => (APP?.conference?.getNumberOfParticipantsWithTracks() ?? -1) >= count, number), {
+ async waitForRemoteStreams(number: number): Promise<void> {
+ return await this.driver.waitUntil(async () => await this.execute(
+ count => (APP?.conference?.getNumberOfParticipantsWithTracks() ?? -1) >= count,
+ number
+ ), {
timeout: 15_000,
timeoutMsg: `expected number of remote streams:${number} in 15s for ${this.name}`
});
@@ -416,10 +433,8 @@ export class Participant {
* @returns {Promise<void>}
*/
waitForParticipants(number: number, msg?: string): Promise<void> {
- const driver = this.driver;
-
- return driver.waitUntil(
- () => driver.execute(count => (APP?.conference?.listMembers()?.length ?? -1) === count, number),
+ return this.driver.waitUntil(
+ () => this.execute(count => (APP?.conference?.listMembers()?.length ?? -1) === count, number),
{
timeout: 15_000,
timeoutMsg: msg || `not the expected participants ${number} in 15s for ${this.name}`
@@ -577,7 +592,7 @@ export class Participant {
}
// do a hangup, to make sure unavailable presence is sent
- await this.driver.execute(() => typeof APP !== 'undefined' && APP.conference?.hangup());
+ await this.execute(() => typeof APP !== 'undefined' && APP.conference?.hangup());
// let's give it some time to leave the muc, we redirect after hangup so we should wait for the
// change of url
@@ -718,7 +733,7 @@ export class Participant {
async getRemoteAudioLevel(p: Participant) {
const jid = await p.getEndpointId();
- return await this.driver.execute(id => {
+ return await this.execute(id => {
const level = APP?.conference?.getPeerSSRCAudioLevel(id);
return level ? level.toFixed(2) : null;
@@ -793,7 +808,7 @@ export class Participant {
*/
async waitForRemoteVideo(endpointId: string) {
await this.driver.waitUntil(async () =>
- await this.driver.execute(epId => JitsiMeetJS.app.testing.isRemoteVideoReceived(`${epId}`),
+ await this.execute(epId => JitsiMeetJS.app.testing.isRemoteVideoReceived(`${epId}`),
endpointId) && await this.driver.$(
`//span[@id="participant_${endpointId}" and contains(@class, "display-video")]`).isExisting(), {
timeout: 15_000,
diff --git a/tests/pageobjects/Filmstrip.ts b/tests/pageobjects/Filmstrip.ts
index 49bbd35e20..9a752b0dde 100644
--- a/tests/pageobjects/Filmstrip.ts
+++ b/tests/pageobjects/Filmstrip.ts
@@ -62,7 +62,7 @@ export default class Filmstrip extends BasePageObject {
await remoteDisplayName.moveTo();
- return await this.participant.driver.execute(eId =>
+ return await this.participant.execute(eId =>
document.evaluate(`//span[@id="participant_${eId}"]//video`,
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue?.srcObject?.id, endpointId);
}
@@ -71,7 +71,7 @@ export default class Filmstrip extends BasePageObject {
* Returns the local video id.
*/
getLocalVideoId() {
- return this.participant.driver.execute(
+ return this.participant.execute(
'return document.getElementById("localVideo_container").srcObject.id');
}
diff --git a/tests/pageobjects/IframeAPI.ts b/tests/pageobjects/IframeAPI.ts
index d30c79f108..5e965ca77c 100644
--- a/tests/pageobjects/IframeAPI.ts
+++ b/tests/pageobjects/IframeAPI.ts
@@ -11,7 +11,7 @@ export default class IframeAPI extends BasePageObject {
* @param event
*/
getEventResult(event: string): Promise<any> {
- return this.participant.driver.execute(
+ return this.participant.execute(
eventName => {
const result = window.jitsiAPI.test[eventName];
@@ -28,7 +28,7 @@ export default class IframeAPI extends BasePageObject {
* @param eventName The event name.
*/
addEventListener(eventName: string) {
- return this.participant.driver.execute(
+ return this.participant.execute(
(event, prefix) => {
console.log(`${new Date().toISOString()} ${prefix} Adding listener for event: ${event}`);
window.jitsiAPI.addListener(event, evt => {
@@ -43,14 +43,14 @@ export default class IframeAPI extends BasePageObject {
* Returns an array of available rooms and details of it.
*/
getRoomsInfo() {
- return this.participant.driver.execute(() => window.jitsiAPI.getRoomsInfo());
+ return this.participant.execute(() => window.jitsiAPI.getRoomsInfo());
}
/**
* Returns the number of participants in the conference.
*/
getNumberOfParticipants() {
- return this.participant.driver.execute(() => window.jitsiAPI.getNumberOfParticipants());
+ return this.participant.execute(() => window.jitsiAPI.getNumberOfParticipants());
}
/**
@@ -59,7 +59,7 @@ export default class IframeAPI extends BasePageObject {
* @param args The arguments.
*/
executeCommand(command: string, ...args: any[]) {
- return this.participant.driver.execute(
+ return this.participant.execute(
(commandName, commandArgs) =>
window.jitsiAPI.executeCommand(commandName, ...commandArgs)
, command, args);
@@ -69,13 +69,13 @@ export default class IframeAPI extends BasePageObject {
* Returns the current state of the participant's pane.
*/
isParticipantsPaneOpen() {
- return this.participant.driver.execute(() => window.jitsiAPI.isParticipantsPaneOpen());
+ return this.participant.execute(() => window.jitsiAPI.isParticipantsPaneOpen());
}
/**
* Removes the embedded Jitsi Meet conference.
*/
dispose() {
- return this.participant.driver.execute(() => window.jitsiAPI.dispose());
+ return this.participant.execute(() => window.jitsiAPI.dispose());
}
}
diff --git a/tests/pageobjects/LargeVideo.ts b/tests/pageobjects/LargeVideo.ts
index b74f0fd47a..db63dc8b8b 100644
--- a/tests/pageobjects/LargeVideo.ts
+++ b/tests/pageobjects/LargeVideo.ts
@@ -39,14 +39,14 @@ export default class LargeVideo extends BasePageObject {
* Returns resource part of the JID of the user who is currently displayed in the large video area.
*/
getResource() {
- return this.participant.driver.execute(() => APP.UI.getLargeVideoID());
+ return this.participant.execute(() => APP?.UI?.getLargeVideoID());
}
/**
* Returns the source of the large video currently shown.
*/
getId() {
- return this.participant.driver.execute('return document.getElementById("largeVideo").srcObject.id');
+ return this.participant.execute('return document.getElementById("largeVideo").srcObject.id');
}
diff --git a/tests/pageobjects/PreMeetingScreen.ts b/tests/pageobjects/PreMeetingScreen.ts
index 3793bafdf1..f388a550c6 100644
--- a/tests/pageobjects/PreMeetingScreen.ts
+++ b/tests/pageobjects/PreMeetingScreen.ts
@@ -54,7 +54,7 @@ export default abstract class PreMeetingScreen extends BasePageObject {
* Checks internally whether lobby room is joined.
*/
isLobbyRoomJoined() {
- return this.participant.driver.execute(
+ return this.participant.execute(
() => APP?.conference?._room?.room?.getLobby()?.lobbyRoom?.joined === true);
}
diff --git a/tests/specs/2way/displayName.spec.ts b/tests/specs/2way/displayName.spec.ts
index 8216d3564b..aaa85a94f0 100644
--- a/tests/specs/2way/displayName.spec.ts
+++ b/tests/specs/2way/displayName.spec.ts
@@ -7,7 +7,7 @@ describe('DisplayName', () => {
const { p1, p2 } = ctx;
// default remote display name
- const defaultDisplayName = await p1.driver.execute(() => config.defaultRemoteDisplayName);
+ const defaultDisplayName = await p1.execute(() => config.defaultRemoteDisplayName);
const p1EndpointId = await p1.getEndpointId();
const p2EndpointId = await p2.getEndpointId();
diff --git a/tests/specs/2way/grantModerator.spec.ts b/tests/specs/2way/grantModerator.spec.ts
index 785aeb7929..5b914f771c 100644
--- a/tests/specs/2way/grantModerator.spec.ts
+++ b/tests/specs/2way/grantModerator.spec.ts
@@ -4,7 +4,7 @@ describe('Grant moderator', () => {
it('joining the meeting', async () => {
await ensureOneParticipant(ctx);
- if (await ctx.p1.driver.execute(() => typeof APP.conference._room.grantOwner !== 'function')) {
+ if (await ctx.p1.execute(() => typeof APP.conference._room.grantOwner !== 'function')) {
ctx.skipSuiteTests = true;
return;
diff --git a/tests/specs/3way/codecSelection.spec.ts b/tests/specs/3way/codecSelection.spec.ts
index 0db392a432..f994f91217 100644
--- a/tests/specs/3way/codecSelection.spec.ts
+++ b/tests/specs/3way/codecSelection.spec.ts
@@ -20,18 +20,18 @@ describe('Codec selection', () => {
const { p1, p2 } = ctx;
// Check if media is playing on both endpoints.
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
// 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.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
} else {
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
}
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
});
it('asymmetric codecs with AV1', async () => {
@@ -45,23 +45,23 @@ describe('Codec selection', () => {
const { p1, p2, p3 } = ctx;
// Check if media is playing on p3.
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
// 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 AV1/VP9 encode and AV1 decode.
if (p1.driver.isFirefox) {
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
} else {
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
}
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
// If there is a Firefox ep in the call, all other eps will switch to VP9.
if (p1.driver.isFirefox) {
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
} else {
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingAv1())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingAv1())).toBe(true);
}
});
@@ -83,8 +83,8 @@ describe('Codec selection', () => {
}
// Check if p1 and p2 are encoding in VP9 which is the default codec.
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9())).toBe(true);
await ensureThreeParticipants(ctx, {
configOverwrite: {
@@ -96,22 +96,22 @@ describe('Codec selection', () => {
const { p3 } = ctx;
// Check if all three participants are encoding in VP8 now.
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp8())).toBe(true);
+ 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);
await p3.hangup();
// Check of p1 and p2 have switched to VP9.
await p1.driver.waitUntil(
- () => p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
+ () => p1.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
{
timeout: 10000,
timeoutMsg: 'p1 did not switch back to VP9'
}
);
await p2.driver.waitUntil(
- () => p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
+ () => p2.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
{
timeout: 10000,
timeoutMsg: 'p1 did not switch back to VP9'
diff --git a/tests/specs/3way/lobby.spec.ts b/tests/specs/3way/lobby.spec.ts
index b20eaa55f0..4cbcd08bb4 100644
--- a/tests/specs/3way/lobby.spec.ts
+++ b/tests/specs/3way/lobby.spec.ts
@@ -7,7 +7,7 @@ describe('Lobby', () => {
it('joining the meeting', async () => {
await ensureOneParticipant(ctx);
- if (!await ctx.p1.driver.execute(() => APP.conference._room.isLobbySupported())) {
+ if (!await ctx.p1.execute(() => APP.conference._room.isLobbySupported())) {
ctx.skipSuiteTests = true;
}
});
diff --git a/tests/specs/3way/startMuted.spec.ts b/tests/specs/3way/startMuted.spec.ts
index f9ed27ca47..f201c507ae 100644
--- a/tests/specs/3way/startMuted.spec.ts
+++ b/tests/specs/3way/startMuted.spec.ts
@@ -38,7 +38,6 @@ describe('StartMuted', () => {
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);
await p1.waitForAudioMuted(p2, true);
-
await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p1, true);
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);
@@ -145,7 +144,6 @@ describe('StartMuted', () => {
const { p1, p2 } = ctx;
-
await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);
@@ -155,7 +153,6 @@ describe('StartMuted', () => {
]);
await unmuteVideoAndCheck(p2, p1);
-
await p1.getLargeVideo().assertPlaying();
});
diff --git a/tests/specs/4way/desktopSharing.spec.ts b/tests/specs/4way/desktopSharing.spec.ts
index b6358c5e39..60a4cc8ef8 100644
--- a/tests/specs/4way/desktopSharing.spec.ts
+++ b/tests/specs/4way/desktopSharing.spec.ts
@@ -26,7 +26,7 @@ describe('Desktop sharing', () => {
// Check if a local screen share tile is created on p2.
await checkForScreensharingTile(p2, p2);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
});
it('stop', async () => {
@@ -55,7 +55,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p2, p2);
await checkForScreensharingTile(p2, p2);
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
});
/**
@@ -71,7 +71,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p2, p2);
// The video should be playing.
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
// Start desktop share on p1.
await p1.getToolbar().clickDesktopSharingButton();
@@ -86,7 +86,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p2, p3);
// The large video should be playing on p3.
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
});
/**
@@ -117,7 +117,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p2, p3);
// The large video should be playing on p3.
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
});
/**
@@ -155,22 +155,22 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p1, p2);
await checkForScreensharingTile(p1, p3);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
- expect(await p3.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p3.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
// p3 leaves the call.
await p3.hangup();
// Make sure p2 see's p1's share after the call switches back to p2p.
await checkForScreensharingTile(p1, p2);
- expect(await p2.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p2.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
// p2 starts share when in p2p.
await p2.getToolbar().clickDesktopSharingButton();
// Makes sure p2's share is visible on p1.
await checkForScreensharingTile(p2, p1);
- expect(await p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p1.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
});
/**
@@ -184,12 +184,12 @@ describe('Desktop sharing', () => {
const { p1 } = ctx;
// a workaround to directly set audio only mode without going through the rest of the settings in the UI
- await p1.driver.execute(type => {
- APP.store.dispatch({
+ await p1.execute(type => {
+ APP?.store?.dispatch({
type,
audioOnly: true
});
- APP.conference.onToggleAudioOnly();
+ APP?.conference?.onToggleAudioOnly();
}, SET_AUDIO_ONLY);
await p1.getToolbar().clickAudioMuteButton();
@@ -203,7 +203,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p3, p2);
// the video should be playing
- await p1.driver.waitUntil(() => p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
+ await p1.driver.waitUntil(() => p1.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
timeout: 5_000,
timeoutMsg: 'expected remote screen share to be on large'
});
@@ -226,12 +226,12 @@ describe('Desktop sharing', () => {
const { p1 } = ctx;
// a workaround to directly set audio only mode without going through the rest of the settings in the UI
- await p1.driver.execute(type => {
- APP.store.dispatch({
+ await p1.execute(type => {
+ APP?.store?.dispatch({
type,
audioOnly: true
});
- APP.conference.onToggleAudioOnly();
+ APP?.conference?.onToggleAudioOnly();
}, SET_AUDIO_ONLY);
await ensureTwoParticipants(ctx, {
@@ -254,7 +254,7 @@ describe('Desktop sharing', () => {
expect(await p1.getLargeVideo().getResource()).toBe(`${await p3.getEndpointId()}-v1`);
// the video should be playing
- await p1.driver.waitUntil(() => p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
+ await p1.driver.waitUntil(() => p1.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
timeout: 5_000,
timeoutMsg: 'expected remote screen share to be on large'
});
@@ -291,7 +291,7 @@ describe('Desktop sharing', () => {
await checkForScreensharingTile(p3, p4);
// And the video should be playing
- expect(await p4.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
+ expect(await p4.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived())).toBe(true);
const p1EndpointId = await p1.getEndpointId();
const p2EndpointId = await p2.getEndpointId();
diff --git a/tests/specs/alone/lockRoomDigitsOnly.spec.ts b/tests/specs/alone/lockRoomDigitsOnly.spec.ts
index f9be1fe4ed..3d362c487c 100644
--- a/tests/specs/alone/lockRoomDigitsOnly.spec.ts
+++ b/tests/specs/alone/lockRoomDigitsOnly.spec.ts
@@ -16,8 +16,8 @@ describe('Lock Room with Digits only', () => {
it('lock room with digits only', async () => {
const { p1 } = ctx;
- expect(await p1.driver.execute(() => APP.store.getState()['features/base/config']
- .roomPasswordNumberOfDigits === 5)).toBe(true);
+ expect(await p1.execute(
+ () => APP.store.getState()['features/base/config'].roomPasswordNumberOfDigits === 5)).toBe(true);
const p1SecurityDialog = p1.getSecurityDialog();
diff --git a/tests/specs/helpers/DialIn.ts b/tests/specs/helpers/DialIn.ts
index c55c010bbd..afbfc06d61 100644
--- a/tests/specs/helpers/DialIn.ts
+++ b/tests/specs/helpers/DialIn.ts
@@ -35,7 +35,7 @@ export async function waitForAudioFromDialInParticipant(participant: Participant
export async function cleanup(participant: Participant) {
// cleanup
if (await participant.isModerator()) {
- const jigasiEndpointId = await participant.driver.execute(() => APP.conference.listMembers()[0].getId());
+ const jigasiEndpointId = await participant.execute(() => APP?.conference?.listMembers()[0].getId());
await participant.getFilmstrip().kickParticipant(jigasiEndpointId);
}
@@ -46,6 +46,6 @@ export async function cleanup(participant: Participant) {
* @param participant
*/
export async function isDialInEnabled(participant: Participant) {
- return await participant.driver.execute(() => Boolean(
+ return await participant.execute(() => Boolean(
config.dialInConfCodeUrl && config.dialInNumbersUrl && config.hosts?.muc));
}