fix(tests): Add missing helper function.

This commit is contained in:
Jaya Allamsetty
2025-11-04 09:54:47 -05:00
committed by Jaya Allamsetty
parent 81a7301a3e
commit 5453b615f5
2 changed files with 22 additions and 1 deletions

View File

@@ -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

View File

@@ -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();