mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
fix(tests): Uses utility methods for mute/unmute.
This commit is contained in:
@@ -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}`
|
||||
});
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user