Skip to content

Commit

Permalink
fix(tests): AV moderation UI changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Feb 20, 2025
1 parent ed030e4 commit 6d824a5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/helpers/participants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
34 changes: 32 additions & 2 deletions tests/pageobjects/Notifications.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/pageobjects/ParticipantsPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/3way/audioVideoModeration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async function unmuteByModerator(
await moderatorParticipantsPane.allowVideo(participant);
await moderatorParticipantsPane.askToUnmute(participant, false);
await participant.getNotifications().waitForAskToUnmuteNotification();
await participant.getNotifications().closeAskToUnmuteNotification();
await participant.getNotifications().closeAskToUnmuteNotification(true);

await unmuteAudioAndCheck(participant, moderator);
await unmuteVideoAndCheck(participant, moderator);
Expand Down
2 changes: 1 addition & 1 deletion tests/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 6d824a5

Please sign in to comment.