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): Fixes a problem with two notifications.

damenchoe45df58cfb4b
diff --git a/react/features/av-moderation/middleware.ts b/react/features/av-moderation/middleware.ts
index 7d88e7549c..d6761517b5 100644
--- a/react/features/av-moderation/middleware.ts
+++ b/react/features/av-moderation/middleware.ts
@@ -81,7 +81,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
break;
}
case LOCAL_PARTICIPANT_MODERATION_NOTIFICATION: {
- let descriptionKey;
let titleKey;
let uid = '';
const localParticipant = getLocalParticipant(getState);
@@ -111,8 +110,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
!raisedHand && dispatch(raiseHand(true));
dispatch(hideNotification(uid));
}) ],
- descriptionKey,
- sticky: true,
titleKey,
uid
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
@@ -271,7 +268,6 @@ StateListenerRegistry.register(
dispatch(showNotification({
titleKey: 'notify.hostAskedUnmute',
- sticky: true,
customActionNameKey,
customActionHandler,
uid: ASKED_TO_UNMUTE_NOTIFICATION_ID
diff --git a/react/features/notifications/types.ts b/react/features/notifications/types.ts
index 224077da0d..aa852f0ca9 100644
--- a/react/features/notifications/types.ts
+++ b/react/features/notifications/types.ts
@@ -13,7 +13,6 @@ export interface INotificationProps {
hideErrorSupportLink?: boolean;
icon?: string;
maxLines?: number;
- sticky?: boolean;
title?: string;
titleArguments?: {
[key: string]: string | number;
diff --git a/tests/pageobjects/Notifications.ts b/tests/pageobjects/Notifications.ts
index e0049beedb..eb04e60394 100644
--- a/tests/pageobjects/Notifications.ts
+++ b/tests/pageobjects/Notifications.ts
@@ -2,6 +2,7 @@ import BasePageObject from './BasePageObject';
const ASK_TO_UNMUTE_NOTIFICATION_ID = 'notify.hostAskedUnmute';
const AV_MODERATION_MUTED_NOTIFICATION_ID = 'notify.moderationInEffectTitle';
+const AV_MODERATION_VIDEO_MUTED_NOTIFICATION_ID = 'notify.moderationInEffectVideoTitle';
const JOIN_MULTIPLE_TEST_ID = 'notify.connectedThreePlusMembers';
const JOIN_ONE_TEST_ID = 'notify.connectedOneMember';
const JOIN_TWO_TEST_ID = 'notify.connectedTwoMembers';
@@ -57,6 +58,13 @@ export default class Notifications extends BasePageObject {
return this.closeNotification(AV_MODERATION_MUTED_NOTIFICATION_ID, skipNonExisting);
}
+ /**
+ * Closes the video muted notification.
+ */
+ async closeAVModerationVideoMutedNotification(skipNonExisting = false) {
+ return this.closeNotification(AV_MODERATION_VIDEO_MUTED_NOTIFICATION_ID, skipNonExisting);
+ }
+
/**
* Closes the ask to unmute notification.
*/
@@ -106,14 +114,22 @@ export default class Notifications extends BasePageObject {
* @private
*/
private async closeNotification(testId: string, skipNonExisting = false) {
- const closeButton = this.participant.driver.$('[data-testid="${testId}"] #close-notification');
+ const closeButton = this.participant.driver.$(`[data-testid="${testId}"] #close-notification`);
- if (skipNonExisting && !await closeButton.isExisting()) {
- return Promise.resolve();
- }
+ try {
+ if (skipNonExisting && !await closeButton.isExisting()) {
+ return Promise.resolve();
+ }
- await closeButton.moveTo();
- await closeButton.click();
+ await closeButton.moveTo();
+ await closeButton.click();
+ } catch (e) {
+ console.error(`Error closing notification ${testId}`, e);
+
+ if (!skipNonExisting) {
+ throw e;
+ }
+ }
}
/**
diff --git a/tests/specs/helpers/mute.ts b/tests/specs/helpers/mute.ts
index d1bb67b14b..8519882979 100644
--- a/tests/specs/helpers/mute.ts
+++ b/tests/specs/helpers/mute.ts
@@ -45,6 +45,8 @@ export async function unmuteAudioAndCheck(testee: Participant, observer: Partici
* @param observer
*/
export async function unmuteVideoAndCheck(testee: Participant, observer: Participant): Promise<void> {
+ await testee.getNotifications().closeAskToUnmuteNotification(true);
+ await testee.getNotifications().closeAVModerationVideoMutedNotification(true);
await testee.getToolbar().clickVideoUnmuteButton();
await testee.getParticipantsPane().assertVideoMuteIconIsDisplayed(testee, true);
diff --git a/tests/specs/media/audioVideoModeration.spec.ts b/tests/specs/media/audioVideoModeration.spec.ts
index 85aae63263..359683ee8d 100644
--- a/tests/specs/media/audioVideoModeration.spec.ts
+++ b/tests/specs/media/audioVideoModeration.spec.ts
@@ -122,12 +122,12 @@ describe('Audio/video moderation', () => {
await moderatorParticipantsPane.assertVideoMuteIconIsDisplayed(moderator);
await nonModeratorParticipantsPane.assertVideoMuteIconIsDisplayed(nonModerator);
- await moderatorParticipantsPane.allowVideo(nonModerator);
await moderatorParticipantsPane.askToUnmute(nonModerator, false);
-
await nonModerator.getNotifications().waitForAskToUnmuteNotification();
-
await unmuteAudioAndCheck(nonModerator, p1);
+
+ await moderatorParticipantsPane.allowVideo(nonModerator);
+ await nonModerator.getNotifications().waitForAskToUnmuteNotification();
await unmuteVideoAndCheck(nonModerator, p1);
await moderatorParticipantsPane.clickContextMenuButton();
@@ -190,6 +190,10 @@ describe('Audio/video moderation', () => {
// stop video and check
await p1.getFilmstrip().muteVideo(p2);
+ // close and open participants pane to make sure the context menu disappears
+ await p1.getParticipantsPane().close();
+ await p1.getParticipantsPane().open();
+
await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);
@@ -256,11 +260,12 @@ async function unmuteByModerator(
await moderator.getNotifications().waitForRaisedHandNotification();
// ask participant to unmute
- await moderatorParticipantsPane.allowVideo(participant);
await moderatorParticipantsPane.askToUnmute(participant, false);
await participant.getNotifications().waitForAskToUnmuteNotification();
-
await unmuteAudioAndCheck(participant, moderator);
+
+ await moderatorParticipantsPane.allowVideo(participant);
+ await participant.getNotifications().waitForAskToUnmuteNotification();
await unmuteVideoAndCheck(participant, moderator);
if (stopModeration) {