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): AV moderation UI changes.

damencho4d7136b7a7d5
diff --git a/tests/helpers/participants.ts b/tests/helpers/participants.ts
index 8616e03f89..519bff380a 100644
--- a/tests/helpers/participants.ts
+++ b/tests/helpers/participants.ts
@@ -253,7 +253,8 @@ export async function muteAudioAndCheck(testee: Participant, observer: Participa
* @param observer
*/
export async function unmuteAudioAndCheck(testee: Participant, observer: Participant) {
- await testee.getNotifications().closeAskToUnmuteNotification();
+ await testee.getNotifications().closeAskToUnmuteNotification(true);
+ await testee.getNotifications().closeAVModerationMutedNotification(true);
await testee.getToolbar().clickAudioUnmuteButton();
await testee.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, true);
await observer.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, true);
diff --git a/tests/pageobjects/Notifications.ts b/tests/pageobjects/Notifications.ts
index 47f079dcb9..02fa703198 100644
--- a/tests/pageobjects/Notifications.ts
+++ b/tests/pageobjects/Notifications.ts
@@ -1,5 +1,6 @@
import BasePageObject from './BasePageObject';
+const AV_MODERATION_MUTED_NOTIFICATION_ID = 'notify.moderationInEffectTitle';
const ASK_TO_UNMUTE_NOTIFICATION_ID = 'notify.hostAskedUnmute';
const JOIN_ONE_TEST_ID = 'notify.connectedOneMember';
const JOIN_TWO_TEST_ID = 'notify.connectedTwoMembers';
@@ -47,8 +48,15 @@ export default class Notifications extends BasePageObject {
/**
* Closes the ask to unmute notification.
*/
- async closeAskToUnmuteNotification() {
- return this.closeLobbyNotification(ASK_TO_UNMUTE_NOTIFICATION_ID);
+ async closeAVModerationMutedNotification(skipNonExisting = false) {
+ return this.closeNotification(AV_MODERATION_MUTED_NOTIFICATION_ID, skipNonExisting);
+ }
+
+ /**
+ * Closes the ask to unmute notification.
+ */
+ async closeAskToUnmuteNotification(skipNonExisting = false) {
+ return this.closeNotification(ASK_TO_UNMUTE_NOTIFICATION_ID, skipNonExisting);
}
/**
@@ -86,6 +94,28 @@ export default class Notifications extends BasePageObject {
return this.getNotificationText(LOBBY_ENABLED_TEST_ID);
}
+ /**
+ * Closes a specific lobby notification.
+ * @param testId
+ * @param skipNonExisting
+ * @private
+ */
+ private async closeNotification(testId: string, skipNonExisting = false) {
+ const notification = this.participant.driver.$(`[data-testid="${testId}"]`);
+
+ if (skipNonExisting && !await notification.isExisting()) {
+ return Promise.resolve();
+ }
+
+ await notification.waitForExist();
+ await notification.waitForStable();
+
+ const closeButton = notification.$('#close-notification');
+
+ await closeButton.moveTo();
+ await closeButton.click();
+ }
+
/**
* Closes a specific lobby notification.
* @param testId
diff --git a/tests/pageobjects/ParticipantsPane.ts b/tests/pageobjects/ParticipantsPane.ts
index c36b66233a..a2df211e6c 100644
--- a/tests/pageobjects/ParticipantsPane.ts
+++ b/tests/pageobjects/ParticipantsPane.ts
@@ -112,7 +112,7 @@ export default class ParticipantsPane extends BasePageObject {
await this.openParticipantContextMenu(participantToUnmute);
const unmuteButton = this.participant.driver
- .$(`button[data-testid="unmute-video-${participantId}"]`);
+ .$(`[data-testid="unmute-video-${participantId}"]`);
await unmuteButton.waitForExist();
await unmuteButton.click();
diff --git a/tests/specs/3way/audioVideoModeration.spec.ts b/tests/specs/3way/audioVideoModeration.spec.ts
index 5320fbfc30..efdf1106ce 100644
--- a/tests/specs/3way/audioVideoModeration.spec.ts
+++ b/tests/specs/3way/audioVideoModeration.spec.ts
@@ -70,8 +70,10 @@ describe('AVModeration', () => {
// participant3 was unmuted by unmuteByModerator
await unmuteAudioAndCheck(p2, p1);
await unmuteVideoAndCheck(p2, p1);
- await unmuteAudioAndCheck(p1, p2);
- await unmuteVideoAndCheck(p1, p2);
+
+ // make sure p1 is not muted after turning on and then off the AV moderation
+ await p1.getFilmstrip().assertAudioMuteIconIsDisplayed(p1, true);
+ await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p2, true);
});
it('hangup and change moderator', async () => {
@@ -244,7 +246,6 @@ async function unmuteByModerator(
await moderatorParticipantsPane.allowVideo(participant);
await moderatorParticipantsPane.askToUnmute(participant, false);
await participant.getNotifications().waitForAskToUnmuteNotification();
- await participant.getNotifications().closeAskToUnmuteNotification();
await unmuteAudioAndCheck(participant, moderator);
await unmuteVideoAndCheck(participant, moderator);
diff --git a/tests/wdio.conf.ts b/tests/wdio.conf.ts
index cd07867a29..fd2cafce83 100644
--- a/tests/wdio.conf.ts
+++ b/tests/wdio.conf.ts
@@ -44,7 +44,7 @@ if (process.env.ALLOW_INSECURE_CERTS === 'true') {
}
if (process.env.HEADLESS === 'true') {
chromeArgs.push('--headless');
- chromeArgs.push('--window-size=1280,720');
+ chromeArgs.push('--window-size=1280,1024');
}
if (process.env.VIDEO_CAPTURE_FILE) {
chromeArgs.push(`--use-file-for-fake-video-capture=${process.env.VIDEO_CAPTURE_FILE}`);