|
@@ -0,0 +1,142 @@
|
|
1
|
+import type { Participant } from '../../helpers/Participant';
|
|
2
|
+import {
|
|
3
|
+ checkForScreensharingTile,
|
|
4
|
+ ensureOneParticipant,
|
|
5
|
+ ensureTwoParticipants,
|
|
6
|
+ joinSecondParticipant
|
|
7
|
+} from '../../helpers/participants';
|
|
8
|
+
|
|
9
|
+describe('Mute', () => {
|
|
10
|
+ it('joining the meeting', () => ensureTwoParticipants(ctx));
|
|
11
|
+
|
|
12
|
+ it('mute p1 and check', () => toggleMuteAndCheck(ctx.p1, ctx.p2, true));
|
|
13
|
+
|
|
14
|
+ it('unmute p1 and check', () => toggleMuteAndCheck(ctx.p1, ctx.p2, false));
|
|
15
|
+
|
|
16
|
+ it('mute p2 and check', () => toggleMuteAndCheck(ctx.p2, ctx.p1, true));
|
|
17
|
+
|
|
18
|
+ it('unmute p2 and check', () => toggleMuteAndCheck(ctx.p2, ctx.p1, false));
|
|
19
|
+
|
|
20
|
+ it('p1 mutes p2 and check', async () => {
|
|
21
|
+ const { p1, p2 } = ctx;
|
|
22
|
+
|
|
23
|
+ if (!await p1.isModerator()) {
|
|
24
|
+ return;
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ await p1.getFilmstrip().muteAudio(p2);
|
|
28
|
+
|
|
29
|
+ // and now check whether second participant is muted
|
|
30
|
+ await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p2);
|
|
31
|
+ });
|
|
32
|
+
|
|
33
|
+ it('p2 unmute after p1 mute and check', async () => {
|
|
34
|
+ const { p1, p2 } = ctx;
|
|
35
|
+
|
|
36
|
+ await p2.getToolbar().clickAudioUnmuteButton();
|
|
37
|
+
|
|
38
|
+ // and now check whether second participant is muted
|
|
39
|
+ await p1.getFilmstrip().assertAudioMuteIconIsDisplayed(p2, true);
|
|
40
|
+ });
|
|
41
|
+
|
|
42
|
+ it('p1 mutes before p2 joins', async () => {
|
|
43
|
+ await ctx.p2.hangup();
|
|
44
|
+
|
|
45
|
+ const { p1 } = ctx;
|
|
46
|
+
|
|
47
|
+ await p1.getToolbar().clickAudioMuteButton();
|
|
48
|
+
|
|
49
|
+ await ensureTwoParticipants(ctx);
|
|
50
|
+
|
|
51
|
+ const { p2 } = ctx;
|
|
52
|
+
|
|
53
|
+ await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p1);
|
|
54
|
+
|
|
55
|
+ await toggleMuteAndCheck(p1, p2, false);
|
|
56
|
+ });
|
|
57
|
+
|
|
58
|
+ it('mute before join and screen share after in p2p', () => muteP1BeforeP2JoinsAndScreenshare(true));
|
|
59
|
+
|
|
60
|
+ it('mute before join and screen share after with jvb', () => muteP1BeforeP2JoinsAndScreenshare(false));
|
|
61
|
+});
|
|
62
|
+
|
|
63
|
+/**
|
|
64
|
+ * Toggles the mute state of a specific Meet conference participant and
|
|
65
|
+ * verifies that a specific other Meet conference participants sees a
|
|
66
|
+ * specific mute state for the former.
|
|
67
|
+ * @param testee The participant whose mute state is to be toggled.
|
|
68
|
+ * @param observer The participant to verify the mute state of {@code testee}.
|
|
69
|
+ * @param muted the mute state of {@code testee} expected to be observed by {@code observer}.
|
|
70
|
+ */
|
|
71
|
+async function toggleMuteAndCheck(
|
|
72
|
+ testee: Participant,
|
|
73
|
+ observer: Participant,
|
|
74
|
+ muted: boolean) {
|
|
75
|
+ if (muted) {
|
|
76
|
+ await testee.getToolbar().clickAudioMuteButton();
|
|
77
|
+ } else {
|
|
78
|
+ await testee.getToolbar().clickAudioUnmuteButton();
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ await observer.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, !muted);
|
|
82
|
+ await testee.getFilmstrip().assertAudioMuteIconIsDisplayed(testee, !muted);
|
|
83
|
+}
|
|
84
|
+
|
|
85
|
+/**
|
|
86
|
+ * Video mutes participant1 before participant2 joins and checks if participant1 can share or unmute video
|
|
87
|
+ * and that media is being received on participant2 in both the cases.
|
|
88
|
+ *
|
|
89
|
+ * @param p2p whether to enable p2p or not.
|
|
90
|
+ */
|
|
91
|
+async function muteP1BeforeP2JoinsAndScreenshare(p2p: boolean) {
|
|
92
|
+ await Promise.all([ ctx.p1?.hangup(), ctx.p2?.hangup() ]);
|
|
93
|
+
|
|
94
|
+ await ensureOneParticipant(ctx, {
|
|
95
|
+ configOverwrite: {
|
|
96
|
+ p2p: {
|
|
97
|
+ enabled: p2p
|
|
98
|
+ }
|
|
99
|
+ }
|
|
100
|
+ });
|
|
101
|
+
|
|
102
|
+ const { p1 } = ctx;
|
|
103
|
+
|
|
104
|
+ await p1.getToolbar().clickVideoMuteButton();
|
|
105
|
+
|
|
106
|
+ await joinSecondParticipant(ctx, {
|
|
107
|
+ configOverwrite: {
|
|
108
|
+ p2p: {
|
|
109
|
+ enabled: p2p
|
|
110
|
+ }
|
|
111
|
+ }
|
|
112
|
+ });
|
|
113
|
+
|
|
114
|
+ const { p2 } = ctx;
|
|
115
|
+
|
|
116
|
+ if (p2p) {
|
|
117
|
+ await p2.waitForP2PIceConnected();
|
|
118
|
+ } else {
|
|
119
|
+ await p2.waitForIceConnected();
|
|
120
|
+ }
|
|
121
|
+
|
|
122
|
+ await p2.waitForSendReceiveData({ checkReceive: false });
|
|
123
|
+
|
|
124
|
+ // Check if p1 appears video muted on p2.
|
|
125
|
+ await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);
|
|
126
|
+
|
|
127
|
+ // Start desktop share.
|
|
128
|
+ await p1.getToolbar().clickDesktopSharingButton();
|
|
129
|
+
|
|
130
|
+ await checkForScreensharingTile(p1, p2);
|
|
131
|
+
|
|
132
|
+ // we need to pass the id of the fake participant we use for the screensharing
|
|
133
|
+ await p2.waitForRemoteVideo(`${await p1.getEndpointId()}-v1`);
|
|
134
|
+
|
|
135
|
+ // Stop desktop share and unmute video and check for video again.
|
|
136
|
+ await p1.getToolbar().clickStopDesktopSharingButton();
|
|
137
|
+
|
|
138
|
+ await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);
|
|
139
|
+ await p1.getToolbar().clickVideoUnmuteButton();
|
|
140
|
+ await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1, true);
|
|
141
|
+ await p2.waitForRemoteVideo(await p1.getEndpointId());
|
|
142
|
+}
|