-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
612 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Participant } from '../helpers/Participant'; | ||
|
||
const START_AUDIO_MODERATION = 'participants-pane-context-menu-start-audio-moderation'; | ||
const STOP_AUDIO_MODERATION = 'participants-pane-context-menu-stop-audio-moderation'; | ||
const START_VIDEO_MODERATION = 'participants-pane-context-menu-start-video-moderation'; | ||
const STOP_VIDEO_MODERATION = 'participants-pane-context-menu-stop-video-moderation'; | ||
|
||
/** | ||
* Represents the Audio Video Moderation menu in the participants pane. | ||
*/ | ||
export default class AVModerationMenu { | ||
private participant: Participant; | ||
|
||
/** | ||
* Represents the Audio Video Moderation menu in the participants pane. | ||
* @param participant | ||
*/ | ||
constructor(participant: Participant) { | ||
this.participant = participant; | ||
} | ||
|
||
/** | ||
* Clicks the start audio moderation menu item. | ||
*/ | ||
async clickStartAudioModeration() { | ||
await this.clickButton(START_AUDIO_MODERATION); | ||
} | ||
|
||
/** | ||
* Clicks the stop audio moderation menu item. | ||
*/ | ||
async clickStopAudioModeration() { | ||
await this.clickButton(STOP_AUDIO_MODERATION); | ||
} | ||
|
||
/** | ||
* Clicks the start video moderation menu item. | ||
*/ | ||
async clickStartVideoModeration() { | ||
await this.clickButton(START_VIDEO_MODERATION); | ||
} | ||
|
||
/** | ||
* Clicks the stop audio moderation menu item. | ||
*/ | ||
async clickStopVideoModeration() { | ||
await this.clickButton(STOP_VIDEO_MODERATION); | ||
} | ||
|
||
/** | ||
* Clicks a context menu button. | ||
* @param id | ||
* @private | ||
*/ | ||
private async clickButton(id: string) { | ||
const button = this.participant.driver.$(`#${id}`); | ||
|
||
await button.waitForDisplayed(); | ||
await button.click(); | ||
|
||
await button.moveTo({ | ||
xOffset: -40, | ||
yOffset: -40 | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Participant } from '../helpers/Participant'; | ||
|
||
const ASK_TO_UNMUTE_NOTIFICATION_ID = 'notify.hostAskedUnmute'; | ||
const JOIN_ONE_TEST_ID = 'notify.connectedOneMember'; | ||
const JOIN_TWO_TEST_ID = 'notify.connectedTwoMembers'; | ||
const JOIN_MULTIPLE_TEST_ID = 'notify.connectedThreePlusMembers'; | ||
const RAISE_HAND_NOTIFICATION_ID = 'notify.raisedHand'; | ||
|
||
/** | ||
* Gathers all notifications logic in the UI and obtaining those. | ||
*/ | ||
export default class Notifications { | ||
private participant: Participant; | ||
|
||
/** | ||
* Represents the Audio Video Moderation menu in the participants pane. | ||
* @param participant | ||
*/ | ||
constructor(participant: Participant) { | ||
this.participant = participant; | ||
} | ||
|
||
/** | ||
* Waits for the raised hand notification to be displayed. | ||
* The notification on moderators page when the participant tries to unmute. | ||
*/ | ||
async waitForRaisedHandNotification() { | ||
const displayNameEl | ||
= this.participant.driver.$(`div[data-testid="${RAISE_HAND_NOTIFICATION_ID}"]`); | ||
|
||
await displayNameEl.waitForExist({ timeout: 2000 }); | ||
await displayNameEl.waitForDisplayed(); | ||
} | ||
|
||
/** | ||
* The notification on participants page when the moderator asks to unmute. | ||
*/ | ||
async waitForAskToUnmuteNotification() { | ||
const displayNameEl | ||
= this.participant.driver.$(`div[data-testid="${ASK_TO_UNMUTE_NOTIFICATION_ID}"]`); | ||
|
||
await displayNameEl.waitForExist({ timeout: 2000 }); | ||
await displayNameEl.waitForDisplayed(); | ||
} | ||
|
||
/** | ||
* Dismisses any join notifications. | ||
*/ | ||
async dismissAnyJoinNotification() { | ||
await Promise.allSettled( | ||
[ `${JOIN_ONE_TEST_ID}-dismiss`, `${JOIN_TWO_TEST_ID}-dismiss`, `${JOIN_MULTIPLE_TEST_ID}-dismiss` ] | ||
.map(async id => this.participant.driver.$(`#${id}"]`).click())); | ||
} | ||
} |
Oops, something went wrong.