Skip to content

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

fix(tests): Add missing helper function.

Jaya Allamsetty5453b615f51d
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<void>}
+ */
+ async waitForParticipantOnLargeVideo(
+ expectedEndpointId: string,
+ timeoutMsg?: string,
+ timeout: number = 30_000): Promise<void> {
+ 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();