From 5453b615f51d453deaf68c9e09fde4a2cf20103d Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Tue, 4 Nov 2025 09:54:47 -0500 Subject: [PATCH] fix(tests): Add missing helper function. --- tests/helpers/Participant.ts | 20 ++++++++++++++++++++ tests/specs/media/desktopSharing.spec.ts | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/helpers/Participant.ts b/tests/helpers/Participant.ts index f09a7e0393..008b60a3f3 100644 --- a/tests/helpers/Participant.ts +++ b/tests/helpers/Participant.ts @@ -927,6 +927,26 @@ export class Participant { return await this.isRemoteVideoReceived(endpointId) && await this.isRemoteVideoDisplayed(endpointId); } + /** + * Waits for a specific participant to be displayed on large video. + * + * @param {string} expectedEndpointId - The endpoint ID of the participant expected on large video. + * @param {string} timeoutMsg - Optional custom timeout message. + * @param {number} timeout - Optional timeout in milliseconds (default: 30000). + * @returns {Promise} + */ + async waitForParticipantOnLargeVideo( + expectedEndpointId: string, + timeoutMsg?: string, + timeout: number = 30_000): Promise { + await this.driver.waitUntil( + async () => await this.getLargeVideo().getResource() === expectedEndpointId, + { + timeout, + timeoutMsg: timeoutMsg || `Expected ${expectedEndpointId} on large video for ${this.name}` + }); + } + /** * Waits for remote video state - receiving and displayed. * @param endpointId diff --git a/tests/specs/media/desktopSharing.spec.ts b/tests/specs/media/desktopSharing.spec.ts index 1691df3791..a879882071 100644 --- a/tests/specs/media/desktopSharing.spec.ts +++ b/tests/specs/media/desktopSharing.spec.ts @@ -63,11 +63,12 @@ describe('Desktop sharing', () => { } }); const { p1, p2, p3 } = ctx; + const p2EndpointId = await p2.getEndpointId(); // Check if a remote screen share tile is created on all participants. await checkForScreensharingTile(p2, p1); await checkForScreensharingTile(p2, p2); - await checkForScreensharingTile(p2, p2); + await checkForScreensharingTile(p2, p3); await p1.getFilmstrip().assertNoGapsInFilmstrip(); await p3.getFilmstrip().assertNoGapsInFilmstrip();