fix(tests): Uses utility methods for mute/unmute.

This commit is contained in:
damencho
2025-02-13 14:52:42 -06:00
committed by Дамян Минков
parent 7ec3eae72b
commit ea7c5ccd58
4 changed files with 13 additions and 24 deletions

View File

@@ -363,11 +363,9 @@ export class Participant {
*
* @returns {Promise<void>}
*/
async waitForP2PIceConnected(): Promise<void> {
const driver = this.driver;
return driver.waitUntil(() =>
driver.execute(() => APP?.conference?.getP2PConnectionState() === 'connected'), {
waitForP2PIceConnected(): Promise<void> {
return this.driver.waitUntil(() =>
this.execute(() => APP?.conference?.getP2PConnectionState() === 'connected'), {
timeout: 15_000,
timeoutMsg: `expected P2P ICE to be connected for 15s for ${this.name}`
});

View File

@@ -3,7 +3,10 @@ import {
checkForScreensharingTile,
ensureOneParticipant,
ensureTwoParticipants,
joinSecondParticipant
joinSecondParticipant,
muteAudioAndCheck,
unmuteAudioAndCheck,
unmuteVideoAndCheck
} from '../../helpers/participants';
describe('Mute', () => {
@@ -33,10 +36,7 @@ describe('Mute', () => {
it('p2 unmute after p1 mute and check', async () => {
const { p1, p2 } = ctx;
await p2.getToolbar().clickAudioUnmuteButton();
// and now check whether second participant is muted
await p1.getFilmstrip().assertAudioMuteIconIsDisplayed(p2, true);
await unmuteAudioAndCheck(p2, p1);
});
it('p1 mutes before p2 joins', async () => {
@@ -73,13 +73,10 @@ async function toggleMuteAndCheck(
observer: Participant,
muted: boolean) {
if (muted) {
await testee.getToolbar().clickAudioMuteButton();
await muteAudioAndCheck(testee, observer);
} else {
await testee.getToolbar().clickAudioUnmuteButton();
await unmuteAudioAndCheck(testee, observer);
}
await observer.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, !muted);
await testee.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, !muted);
}
/**
@@ -136,7 +133,6 @@ async function muteP1BeforeP2JoinsAndScreenshare(p2p: boolean) {
await p1.getToolbar().clickStopDesktopSharingButton();
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);
await p1.getToolbar().clickVideoUnmuteButton();
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);
await unmuteVideoAndCheck(p1, p2);
await p2.waitForRemoteVideo(await p1.getEndpointId());
}

View File

@@ -173,10 +173,7 @@ describe('Avatar', () => {
await p3.hangup();
// Unmute p1's and p2's videos
await p1.getToolbar().clickVideoUnmuteButton();
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);
await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);
await unmuteVideoAndCheck(p1, p2);
});
it('email persistence', async () => {

View File

@@ -234,10 +234,8 @@ describe('StartMuted', () => {
const { p3 } = ctx;
// Unmute p2 and check if its video is being received by p1 and p3.
await p2.getToolbar().clickVideoUnmuteButton();
await unmuteVideoAndCheck(p2, p3);
await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2, true);
await p3.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2, true);
// Mute p2's video just before p3 leaves.
await p2.getToolbar().clickVideoMuteButton();