feat(tests): Adds oneOnOne test.

This commit is contained in:
damencho
2025-02-13 15:10:27 -06:00
committed by Дамян Минков
parent ea7c5ccd58
commit c02ad56b6d
2 changed files with 106 additions and 4 deletions

View File

@@ -80,10 +80,12 @@ export default class Filmstrip extends BasePageObject {
* @param participant The participant.
*/
async pinParticipant(participant: Participant) {
const id = participant === this.participant
? 'localVideoContainer' : `participant_${await participant.getEndpointId()}`;
if (participant === this.participant) {
// when looking up the element and clicking it, it doesn't work if we do it twice in a row (oneOnOne.spec)
return this.participant.execute(() => document?.getElementById('localVideoContainer')?.click());
}
await this.participant.driver.$(`//span[@id="${id}"]`).click();
return this.participant.driver.$(`//span[@id="participant_${await participant.getEndpointId()}"]`).click();
}
/**
@@ -155,12 +157,19 @@ export default class Filmstrip extends BasePageObject {
return this.clickOnRemoteMenuLink(participantId, 'kicklink', true);
}
/**
* Hover over local video.
*/
hoverOverLocalVideo() {
return this.participant.driver.$(LOCAL_VIDEO_MENU_TRIGGER).moveTo();
}
/**
* Clicks on the hide self view button from local video.
*/
async hideSelfView() {
// open local video menu
await this.participant.driver.$(LOCAL_VIDEO_MENU_TRIGGER).moveTo();
await this.hoverOverLocalVideo();
await this.participant.driver.$(LOCAL_USER_CONTROLS).moveTo();
// click Hide self view button
@@ -215,4 +224,16 @@ export default class Filmstrip extends BasePageObject {
return (await this.participant.driver.$$('//div[@id="remoteVideos"]//span[contains(@class,"videocontainer")]')
.filter(thumbnail => thumbnail.isDisplayed())).length;
}
/**
* Check if remote videos in filmstrip are visible.
*
* @param isDisplayed whether or not filmstrip remote videos should be visible
*/
verifyRemoteVideosDisplay(isDisplayed: boolean) {
return this.participant.driver.$('//div[contains(@class, "remote-videos")]/div').waitForDisplayed({
timeout: 5_000,
reverse: !isDisplayed,
});
}
}