|
@@ -0,0 +1,76 @@
|
|
1
|
+import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/participants';
|
|
2
|
+import { expect } from '@wdio/globals';
|
|
3
|
+
|
|
4
|
+describe('Visitors', () => {
|
|
5
|
+ it('joining the meeting', async () => {
|
|
6
|
+ const { webhooksProxy } = ctx;
|
|
7
|
+
|
|
8
|
+ if (webhooksProxy) {
|
|
9
|
+ webhooksProxy.defaultMeetingSettings = {
|
|
10
|
+ visitorsEnabled: true,
|
|
11
|
+ visitorsLive: false
|
|
12
|
+ };
|
|
13
|
+ }
|
|
14
|
+
|
|
15
|
+ await ensureOneParticipant(ctx);
|
|
16
|
+
|
|
17
|
+ const { p1 } = ctx;
|
|
18
|
+
|
|
19
|
+ if (await p1.execute(() => config.disableIframeAPI)) {
|
|
20
|
+ // skip the test if iframeAPI is disabled or visitors are not supported
|
|
21
|
+ ctx.skipSuiteTests = true;
|
|
22
|
+
|
|
23
|
+ return;
|
|
24
|
+ }
|
|
25
|
+
|
|
26
|
+ await p1.driver.waitUntil(() => p1.execute(() => APP.conference._room.isVisitorsSupported()), {
|
|
27
|
+ timeout: 2000
|
|
28
|
+ }).then(async () => {
|
|
29
|
+ await p1.switchToAPI();
|
|
30
|
+ }).catch(() => {
|
|
31
|
+ ctx.skipSuiteTests = true;
|
|
32
|
+ });
|
|
33
|
+ });
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+ it('go live', async () => {
|
|
37
|
+ await ensureTwoParticipants(ctx, {
|
|
38
|
+ preferGenerateToken: true,
|
|
39
|
+ visitor: true,
|
|
40
|
+ skipWaitToJoin: true,
|
|
41
|
+ skipInMeetingChecks: true
|
|
42
|
+ });
|
|
43
|
+
|
|
44
|
+ const { p1, p2 } = ctx;
|
|
45
|
+ const p2Visitors = p2.getVisitors();
|
|
46
|
+ const p1Visitors = p1.getVisitors();
|
|
47
|
+
|
|
48
|
+ await p2.driver.waitUntil(async () => p2Visitors.isVisitorsQueueUIShown(), {
|
|
49
|
+ timeout: 5000,
|
|
50
|
+ timeoutMsg: 'Missing visitors queue UI'
|
|
51
|
+ });
|
|
52
|
+
|
|
53
|
+ await p1.driver.waitUntil(async () => await p1Visitors.getWaitingVisitorsInQueue()
|
|
54
|
+ === 'Viewers waiting in queue: 1', {
|
|
55
|
+ timeout: 15000,
|
|
56
|
+ timeoutMsg: 'Missing visitors queue count in UI'
|
|
57
|
+ });
|
|
58
|
+
|
|
59
|
+ await p1Visitors.goLive();
|
|
60
|
+
|
|
61
|
+ await p2.waitToJoinMUC();
|
|
62
|
+
|
|
63
|
+ await p2.waitForSendReceiveData({
|
|
64
|
+ checkSend: false,
|
|
65
|
+ msg: 'Visitor is not receiving media'
|
|
66
|
+ }).then(() => p2.waitForRemoteStreams(1));
|
|
67
|
+
|
|
68
|
+ await p2.driver.waitUntil(() => p2Visitors.hasVisitorsDialog(), {
|
|
69
|
+ timeout: 5000,
|
|
70
|
+ timeoutMsg: 'Missing visitors dialog'
|
|
71
|
+ });
|
|
72
|
+
|
|
73
|
+ expect((await p1Visitors.getVisitorsCount()).trim()).toBe('1');
|
|
74
|
+ expect((await p1Visitors.getVisitorsHeaderFromParticipantsPane()).trim()).toBe('Viewers 1');
|
|
75
|
+ });
|
|
76
|
+});
|