소스 검색

feat(tests): Adds visitors go live test.

j25
damencho 5 달 전
부모
커밋
0897db3efc

+ 3
- 0
react/features/base/connection/actions.native.ts 파일 보기

8
 import { JitsiConnectionErrors } from '../lib-jitsi-meet';
8
 import { JitsiConnectionErrors } from '../lib-jitsi-meet';
9
 
9
 
10
 import { _connectInternal } from './actions.native';
10
 import { _connectInternal } from './actions.native';
11
+import logger from './logger';
11
 
12
 
12
 export * from './actions.any';
13
 export * from './actions.any';
13
 
14
 
34
                     j && dispatch(setJWT(j));
35
                     j && dispatch(setJWT(j));
35
 
36
 
36
                     return dispatch(_connectInternal(id, password));
37
                     return dispatch(_connectInternal(id, password));
38
+                }).catch(e => {
39
+                    logger.error('Connection error', e);
37
                 });
40
                 });
38
         }
41
         }
39
 
42
 

+ 3
- 0
react/features/base/connection/actions.web.ts 파일 보기

11
 import { setJWT } from '../jwt/actions';
11
 import { setJWT } from '../jwt/actions';
12
 
12
 
13
 import { _connectInternal } from './actions.any';
13
 import { _connectInternal } from './actions.any';
14
+import logger from './logger';
14
 
15
 
15
 export * from './actions.any';
16
 export * from './actions.any';
16
 
17
 
38
                     j && dispatch(setJWT(j));
39
                     j && dispatch(setJWT(j));
39
 
40
 
40
                     return dispatch(_connectInternal(id, password));
41
                     return dispatch(_connectInternal(id, password));
42
+                }).catch(e => {
43
+                    logger.error('Connection error', e);
41
                 });
44
                 });
42
         }
45
         }
43
 
46
 

+ 3
- 1
react/features/visitors/components/web/VisitorsQueue.tsx 파일 보기

78
     const { classes } = useStyles();
78
     const { classes } = useStyles();
79
     const { t } = useTranslation();
79
     const { t } = useTranslation();
80
 
80
 
81
-    return (<div className = { classes.container }>
81
+    return (<div
82
+        className = { classes.container }
83
+        id = 'visitors-waiting-queue'>
82
         <div className = { classes.content }>
84
         <div className = { classes.content }>
83
             <div className = { classes.contentControls }>
85
             <div className = { classes.contentControls }>
84
                 <span className = { classes.roomName }>
86
                 <span className = { classes.roomName }>

+ 29
- 0
tests/pageobjects/Visitors.ts 파일 보기

31
 
31
 
32
         return this.participant.driver.$('#visitor-list-header').getText();
32
         return this.participant.driver.$('#visitor-list-header').getText();
33
     }
33
     }
34
+
35
+    /**
36
+     * Whether the visitors queue UI is shown.
37
+     */
38
+    isVisitorsQueueUIShown() {
39
+        return this.participant.driver.$('#visitors-waiting-queue').isDisplayed();
40
+    }
41
+
42
+    /**
43
+     * Returns the name of the knocking participant (the only one) that is displayed on the notification.
44
+     */
45
+    async getWaitingVisitorsInQueue() {
46
+        const goLiveNotification
47
+            = this.participant.driver.$('//div[@data-testid="notify.waitingVisitors"]');
48
+
49
+        await goLiveNotification.waitForDisplayed({
50
+            timeout: 3000,
51
+            timeoutMsg: 'Go live notification not displayed'
52
+        });
53
+
54
+        return await goLiveNotification.getText();
55
+    }
56
+
57
+    /**
58
+     * Clicks the go live button in the visitors notification.
59
+     */
60
+    async goLive() {
61
+        return this.participant.driver.$('//button[@data-testid="participantsPane.actions.goLive"]').click();
62
+    }
34
 }
63
 }

+ 76
- 0
tests/specs/2way/iFrameApiVisitorsLive.spec.ts 파일 보기

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
+});

Loading…
취소
저장