@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/common/browser-detection.js +1 -0
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -5
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -5
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -6
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -5
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -5
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -5
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -4
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -5
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -5
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +11 -8
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +2 -1
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +2 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js.map +1 -1
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +1 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +118 -89
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +1 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +25 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +8 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +5 -5
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +2 -2
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +48 -48
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +251 -250
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +2 -2
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +14 -14
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +31 -31
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +43 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +23 -20
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/multistreamMedia.js +2 -1
- package/dist/multistream/multistreamMedia.js.map +1 -1
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +2 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +8 -8
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +7 -7
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +3 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +4 -4
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +5 -5
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +4 -1
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +18 -18
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +11 -11
- package/src/constants.ts +1 -1
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +34 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +25 -34
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +4 -4
- package/src/locus-info/parser.ts +45 -68
- package/src/locus-info/selfUtils.ts +106 -57
- package/src/media/index.ts +123 -135
- package/src/media/internal-media-core-wrapper.ts +2 -2
- package/src/media/properties.ts +30 -20
- package/src/media/util.ts +1 -1
- package/src/mediaQualityMetrics/config.ts +46 -46
- package/src/meeting/effectsState.ts +35 -35
- package/src/meeting/in-meeting-actions.ts +7 -3
- package/src/meeting/index.ts +1576 -1291
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +174 -113
- package/src/meeting/request.type.ts +11 -0
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +101 -70
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +106 -108
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +59 -53
- package/src/meetings/collection.ts +1 -1
- package/src/meetings/index.ts +512 -440
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +29 -29
- package/src/member/index.ts +55 -49
- package/src/member/util.ts +26 -13
- package/src/members/collection.ts +0 -1
- package/src/members/index.ts +182 -126
- package/src/members/request.ts +46 -14
- package/src/members/util.ts +44 -42
- package/src/metrics/config.ts +254 -81
- package/src/metrics/constants.ts +0 -2
- package/src/metrics/index.ts +84 -71
- package/src/multistream/multistreamMedia.ts +1 -0
- package/src/multistream/receiveSlot.ts +1 -0
- package/src/multistream/receiveSlotManager.ts +1 -0
- package/src/multistream/remoteMedia.ts +1 -1
- package/src/multistream/remoteMediaGroup.ts +2 -1
- package/src/multistream/remoteMediaManager.ts +3 -0
- package/src/networkQualityMonitor/index.ts +20 -23
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +61 -59
- package/src/reachability/request.ts +36 -32
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +4 -3
- package/src/reconnection-manager/index.ts +139 -84
- package/src/roap/index.ts +46 -38
- package/src/roap/request.ts +44 -31
- package/src/roap/turnDiscovery.ts +59 -30
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +432 -175
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +663 -462
- package/test/integration/spec/space-meeting.js +318 -203
- package/test/integration/spec/transcription.js +6 -7
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +5 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +26 -33
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +72 -103
- package/test/unit/spec/locus-info/selfUtils.js +21 -12
- package/test/unit/spec/meeting/effectsState.js +36 -46
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1342 -684
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +75 -45
- package/test/unit/spec/meeting/utils.js +78 -53
- package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +110 -74
- package/test/unit/spec/meetings/collection.js +1 -1
- package/test/unit/spec/meetings/index.js +438 -257
- package/test/unit/spec/meetings/utils.js +14 -12
- package/test/unit/spec/member/index.js +0 -1
- package/test/unit/spec/member/util.js +5 -6
- package/test/unit/spec/members/index.js +104 -54
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- package/test/unit/spec/metrics/index.js +16 -21
- package/test/unit/spec/networkQualityMonitor/index.js +21 -15
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +9 -11
- package/test/unit/spec/reconnection-manager/index.js +16 -18
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/stats-analyzer/index.js +25 -20
- package/test/utils/cmr.js +44 -42
- package/test/utils/testUtils.js +83 -74
- package/test/utils/webex-config.js +18 -18
- package/test/utils/webex-test-users.js +53 -50
package/test/utils/cmr.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import uuid from 'uuid';
|
|
3
2
|
import retry from '@webex/test-helper-retry';
|
|
4
3
|
|
|
@@ -23,16 +22,16 @@ CMR.reserve = (webex, claimed) => {
|
|
|
23
22
|
authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
|
|
24
23
|
'cisco-no-http-redirect': null,
|
|
25
24
|
'spark-user-agent': null,
|
|
26
|
-
trackingid: `ITCLIENT_${uuid.v4()}_0_imi:true
|
|
25
|
+
trackingid: `ITCLIENT_${uuid.v4()}_0_imi:true`,
|
|
27
26
|
},
|
|
28
27
|
body: {
|
|
29
28
|
resourceType,
|
|
30
29
|
requestMetaData: {
|
|
31
30
|
emailAddress: `test${uuid.v4()}@wx2.example.com`,
|
|
32
|
-
loginType: 'loginGuest'
|
|
31
|
+
loginType: 'loginGuest',
|
|
33
32
|
},
|
|
34
|
-
reservedBy: 'Webex JavaScript SDK Test Suite'
|
|
35
|
-
}
|
|
33
|
+
reservedBy: 'Webex JavaScript SDK Test Suite',
|
|
34
|
+
},
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
if (claimed) {
|
|
@@ -40,7 +39,8 @@ CMR.reserve = (webex, claimed) => {
|
|
|
40
39
|
}
|
|
41
40
|
console.log('USER ID ', webex.internal.device.userId);
|
|
42
41
|
|
|
43
|
-
return webex
|
|
42
|
+
return webex
|
|
43
|
+
.request(requestBody)
|
|
44
44
|
.then((response) => {
|
|
45
45
|
const cmr = response.body;
|
|
46
46
|
|
|
@@ -56,47 +56,49 @@ CMR.reserve = (webex, claimed) => {
|
|
|
56
56
|
CMR.release = (webex, reservationUrl) => {
|
|
57
57
|
console.log('releasing cmr');
|
|
58
58
|
|
|
59
|
-
return webex
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
return webex
|
|
60
|
+
.request({
|
|
61
|
+
method: 'DELETE',
|
|
62
|
+
uri: reservationUrl,
|
|
63
|
+
headers: {
|
|
64
|
+
authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
|
|
65
|
+
'cisco-no-http-redirect': null,
|
|
66
|
+
'spark-user-agent': null,
|
|
67
|
+
},
|
|
68
|
+
})
|
|
68
69
|
.then(() => console.log('released cmr'));
|
|
69
70
|
};
|
|
70
71
|
|
|
71
|
-
CMR.waitForHostToJoin = (webex, resourceUrl) =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
CMR.waitForHostToJoin = (webex, resourceUrl) =>
|
|
73
|
+
retry(() => {
|
|
74
|
+
console.log('checking if the host has joined');
|
|
75
|
+
|
|
76
|
+
return webex
|
|
77
|
+
.request({
|
|
78
|
+
method: 'GET',
|
|
79
|
+
uri: resourceUrl,
|
|
80
|
+
headers: {
|
|
81
|
+
authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
|
|
82
|
+
'cisco-no-http-redirect': null,
|
|
83
|
+
'spark-user-agent': null,
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
.then((res) => {
|
|
87
|
+
if (res.body && res.body.meeting.hostPresent) {
|
|
88
|
+
console.log('the host has joined');
|
|
89
|
+
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
console.log('the host has not joined');
|
|
94
|
+
throw new Error('Meeting host has not yet joined');
|
|
95
|
+
});
|
|
82
96
|
})
|
|
83
|
-
.then((
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
.then(() => true)
|
|
98
|
+
.catch((reason) => {
|
|
99
|
+
console.warn(reason);
|
|
86
100
|
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
console.log('the host has not joined');
|
|
91
|
-
throw new Error('Meeting host has not yet joined');
|
|
101
|
+
return false;
|
|
92
102
|
});
|
|
93
|
-
})
|
|
94
|
-
.then(() => true)
|
|
95
|
-
.catch((reason) => {
|
|
96
|
-
console.warn(reason);
|
|
97
|
-
|
|
98
|
-
return false;
|
|
99
|
-
});
|
|
100
|
-
|
|
101
103
|
|
|
102
104
|
export default CMR;
|
package/test/utils/testUtils.js
CHANGED
|
@@ -19,7 +19,7 @@ const waitForSpy = (spy, event) => {
|
|
|
19
19
|
resolve(spy.args[0][0]);
|
|
20
20
|
}
|
|
21
21
|
}, 1000);
|
|
22
|
-
})
|
|
22
|
+
}),
|
|
23
23
|
]);
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -40,7 +40,7 @@ const waitForStateChange = (meeting, state) => {
|
|
|
40
40
|
resolve(meeting.locusInfo.parsedLocus.states);
|
|
41
41
|
}
|
|
42
42
|
}, 1000);
|
|
43
|
-
})
|
|
43
|
+
}),
|
|
44
44
|
]);
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -59,44 +59,46 @@ const waitForCallEnded = (user, email) => {
|
|
|
59
59
|
clearTimeout(timer);
|
|
60
60
|
clearInterval(interval);
|
|
61
61
|
resolve();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
62
|
+
} else {
|
|
64
63
|
console.log('MEETING STILL EXISTS!', user.webex.meetings.getAllMeetings());
|
|
65
64
|
}
|
|
66
65
|
}, 3000);
|
|
67
|
-
})
|
|
66
|
+
}),
|
|
68
67
|
]);
|
|
69
68
|
};
|
|
70
69
|
|
|
71
|
-
const syncAndEndMeeting = (user) =>
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
const syncAndEndMeeting = (user) =>
|
|
71
|
+
user.webex.meetings
|
|
72
|
+
.syncMeetings()
|
|
73
|
+
.then(() => {
|
|
74
|
+
const promise = [];
|
|
75
|
+
const meetings = user.webex.meetings.getAllMeetings();
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.forEach((key) => {
|
|
77
|
+
if (Object.keys(meetings).length === 0) {
|
|
78
|
+
return Promise.resolve();
|
|
79
|
+
}
|
|
80
|
+
Object.keys(meetings).forEach((key) => {
|
|
81
81
|
promise.push(meetings[key].leave());
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
return Promise.all(promise);
|
|
85
|
+
})
|
|
86
|
+
.then(
|
|
87
|
+
() =>
|
|
88
|
+
new Promise((resolve) => {
|
|
89
|
+
const interval = setInterval(() => {
|
|
90
|
+
if (Object.keys(user.webex.meetings.getAllMeetings()).length === 0) {
|
|
91
|
+
clearInterval(interval);
|
|
92
|
+
resolve();
|
|
93
|
+
} else {
|
|
94
|
+
console.log('End Meetings before test failed');
|
|
95
|
+
}
|
|
96
|
+
}, 3000);
|
|
97
|
+
})
|
|
98
|
+
)
|
|
99
|
+
.catch((e) => {
|
|
100
|
+
console.log('ERROR on syncMeeting', e);
|
|
101
|
+
});
|
|
100
102
|
|
|
101
103
|
//
|
|
102
104
|
const waitForEvents = (scopeEvents, timeout = max) => {
|
|
@@ -125,11 +127,12 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
125
127
|
obj.user.memberId = value.meeting.locusInfo.parsedLocus.selfId;
|
|
126
128
|
}
|
|
127
129
|
if (obj.event === 'meeting:removed') {
|
|
128
|
-
console.log(
|
|
130
|
+
console.log(
|
|
131
|
+
`MEETING:REMOVED ${obj.user.name} ID ${obj.user.meeting.id} correlationID ${obj.user.meeting.correlationId}`
|
|
132
|
+
);
|
|
129
133
|
if (obj.user.meeting.id === value.meetingId) {
|
|
130
134
|
obj.user.meeting = null;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
135
|
+
} else {
|
|
133
136
|
console.log('MEETING EXISTING ', obj.user.webex.meetings.getAllMeetings());
|
|
134
137
|
reject(new Error(`Different Meeting Object ${value}`));
|
|
135
138
|
}
|
|
@@ -142,8 +145,7 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
142
145
|
|
|
143
146
|
resolve(result);
|
|
144
147
|
}
|
|
145
|
-
}
|
|
146
|
-
else if (result.length === scopeEvents.length) {
|
|
148
|
+
} else if (result.length === scopeEvents.length) {
|
|
147
149
|
resolve(result);
|
|
148
150
|
obj.scope.off(obj.event, handler);
|
|
149
151
|
clearTimeout(timer);
|
|
@@ -152,12 +154,11 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
152
154
|
|
|
153
155
|
obj.scope.on(obj.event, handler);
|
|
154
156
|
});
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
+
} catch (e) {
|
|
157
158
|
console.error('waitForEvents', e);
|
|
158
159
|
reject(e);
|
|
159
160
|
}
|
|
160
|
-
})
|
|
161
|
+
}),
|
|
161
162
|
]);
|
|
162
163
|
};
|
|
163
164
|
|
|
@@ -172,25 +173,27 @@ const delayedPromise = (promise) => {
|
|
|
172
173
|
}),
|
|
173
174
|
new Promise((resolve, reject) => {
|
|
174
175
|
setTimeout(() => {
|
|
175
|
-
promise
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
promise
|
|
177
|
+
.then((res) => {
|
|
178
|
+
resolve(res);
|
|
179
|
+
clearTimeout(timer);
|
|
180
|
+
})
|
|
179
181
|
.catch((e) => {
|
|
180
182
|
console.error('delayedPromise', e);
|
|
181
183
|
reject(e);
|
|
182
184
|
});
|
|
183
185
|
}, 2000);
|
|
184
|
-
})
|
|
186
|
+
}),
|
|
185
187
|
]);
|
|
186
188
|
};
|
|
187
189
|
|
|
188
|
-
const delayedTest = (callback, timeout) =>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
});
|
|
190
|
+
const delayedTest = (callback, timeout) =>
|
|
191
|
+
new Promise((resolve) => {
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
callback();
|
|
194
|
+
resolve();
|
|
195
|
+
}, timeout);
|
|
196
|
+
});
|
|
194
197
|
|
|
195
198
|
const addMedia = (user) => {
|
|
196
199
|
const mediaReadyPromises = {
|
|
@@ -209,23 +212,26 @@ const addMedia = (user) => {
|
|
|
209
212
|
|
|
210
213
|
user.meeting.on('media:ready', mediaReady);
|
|
211
214
|
|
|
212
|
-
return user.meeting
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
return user.meeting
|
|
216
|
+
.getMediaStreams({
|
|
217
|
+
sendAudio: true,
|
|
218
|
+
sendVideo: true,
|
|
219
|
+
sendShare: false,
|
|
220
|
+
})
|
|
221
|
+
.then(([localStream, localShare]) =>
|
|
222
|
+
user.meeting.addMedia({
|
|
223
|
+
mediaSettings: {
|
|
224
|
+
sendAudio: true,
|
|
225
|
+
sendVideo: true,
|
|
226
|
+
sendShare: false,
|
|
227
|
+
receiveShare: true,
|
|
228
|
+
receiveAudio: true,
|
|
229
|
+
receiveVideo: true,
|
|
230
|
+
},
|
|
231
|
+
localShare,
|
|
232
|
+
localStream,
|
|
233
|
+
})
|
|
234
|
+
)
|
|
229
235
|
.then(() => Promise.all(Object.values(mediaReadyPromises).map((defer) => defer.promise)))
|
|
230
236
|
.then(() => {
|
|
231
237
|
assert.exists(user.meeting.mediaProperties.audioTrack, 'audioTrack not present');
|
|
@@ -233,11 +239,12 @@ const addMedia = (user) => {
|
|
|
233
239
|
});
|
|
234
240
|
};
|
|
235
241
|
|
|
236
|
-
const waitUntil = (waitTime) =>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
});
|
|
242
|
+
const waitUntil = (waitTime) =>
|
|
243
|
+
new Promise((resolve) => {
|
|
244
|
+
setTimeout(() => {
|
|
245
|
+
resolve();
|
|
246
|
+
}, waitTime);
|
|
247
|
+
});
|
|
241
248
|
|
|
242
249
|
const flushPromises = () => new Promise(setImmediate);
|
|
243
250
|
|
|
@@ -259,7 +266,10 @@ const getCircularReplacer = () => {
|
|
|
259
266
|
|
|
260
267
|
// this function is meant to be used as the "match" callback with waitForEvents()
|
|
261
268
|
// when you want to wait for a particular users's status to reach a certain value
|
|
262
|
-
const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) =>
|
|
269
|
+
const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) =>
|
|
270
|
+
!!event.delta.updated.find(
|
|
271
|
+
(member) => user.meeting.members.selfId === member.id && member.status === expectedStatus
|
|
272
|
+
);
|
|
263
273
|
|
|
264
274
|
export default {
|
|
265
275
|
waitForSpy,
|
|
@@ -273,6 +283,5 @@ export default {
|
|
|
273
283
|
waitUntil,
|
|
274
284
|
delayedTest,
|
|
275
285
|
flushPromises,
|
|
276
|
-
getCircularReplacer
|
|
286
|
+
getCircularReplacer,
|
|
277
287
|
};
|
|
278
|
-
|
|
@@ -8,29 +8,29 @@ const SCOPE = [
|
|
|
8
8
|
'spark:memberships_read',
|
|
9
9
|
'spark:memberships_write',
|
|
10
10
|
'spark:messages_read',
|
|
11
|
-
'spark:messages_write'
|
|
11
|
+
'spark:messages_write',
|
|
12
12
|
].join(' ');
|
|
13
13
|
|
|
14
14
|
const Config = {
|
|
15
|
-
version: (
|
|
16
|
-
appType: (
|
|
15
|
+
version: () => process.env.BUILD_VERSION || -1,
|
|
16
|
+
appType: () => {
|
|
17
17
|
const type = 'Web';
|
|
18
18
|
|
|
19
19
|
return type;
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
21
|
clientId: process.env.WEBEX_CLIENT_ID,
|
|
22
|
-
clientSecret: process.env.WEBEX_CLIENT_SECRET
|
|
22
|
+
clientSecret: process.env.WEBEX_CLIENT_SECRET,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
Config.allowedOutboundTags = {
|
|
26
|
-
'webex-mention': ['data-object-type', 'data-object-id', 'data-group-type', 'data-object-url']
|
|
26
|
+
'webex-mention': ['data-object-type', 'data-object-id', 'data-group-type', 'data-object-url'],
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
Config.webex = {
|
|
30
30
|
maxReconnectAttempts: 5,
|
|
31
31
|
conversation: {
|
|
32
32
|
allowedInboundTags: Config.allowedInboundTags,
|
|
33
|
-
allowedOutboundTags: Config.allowedOutboundTags
|
|
33
|
+
allowedOutboundTags: Config.allowedOutboundTags,
|
|
34
34
|
},
|
|
35
35
|
credentials: {
|
|
36
36
|
clientType: 'confidential',
|
|
@@ -39,39 +39,39 @@ Config.webex = {
|
|
|
39
39
|
client_id: Config.clientId,
|
|
40
40
|
client_secret: Config.clientSecret,
|
|
41
41
|
redirect_uri: process.env.LAUNCH_URL,
|
|
42
|
-
scope: SCOPE
|
|
43
|
-
}
|
|
42
|
+
scope: SCOPE,
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
45
|
encryption: {
|
|
46
|
-
decryptionFailureMessage: 'This message cannot be decrypted'
|
|
46
|
+
decryptionFailureMessage: 'This message cannot be decrypted',
|
|
47
47
|
},
|
|
48
48
|
logger: {
|
|
49
|
-
level: process.env.NODE_ENV === 'test' ? 'error' : 'error'
|
|
49
|
+
level: process.env.NODE_ENV === 'test' ? 'error' : 'error',
|
|
50
50
|
},
|
|
51
51
|
meetings: {
|
|
52
52
|
metrics: {
|
|
53
|
-
autoSendMQA: true
|
|
53
|
+
autoSendMQA: true,
|
|
54
54
|
},
|
|
55
55
|
autoUploadLogs: false,
|
|
56
56
|
reconnection: {
|
|
57
|
-
enabled: true
|
|
57
|
+
enabled: true,
|
|
58
58
|
},
|
|
59
|
-
enableRtx: true
|
|
59
|
+
enableRtx: true,
|
|
60
60
|
},
|
|
61
61
|
people: {
|
|
62
|
-
showAllTypes: true
|
|
62
|
+
showAllTypes: true,
|
|
63
63
|
},
|
|
64
64
|
metrics: {
|
|
65
65
|
appVersion: Config.version,
|
|
66
|
-
appType: Config.appType
|
|
66
|
+
appType: Config.appType,
|
|
67
67
|
},
|
|
68
68
|
support: {
|
|
69
69
|
appVersion: Config.version,
|
|
70
70
|
appType: Config.appType,
|
|
71
|
-
languageCode: 'en'
|
|
71
|
+
languageCode: 'en',
|
|
72
72
|
},
|
|
73
73
|
trackingIdPrefix: 'ITCLIENT',
|
|
74
|
-
trackingIdSuffix: 'imu:false_imi:true'
|
|
74
|
+
trackingIdSuffix: 'imu:false_imi:true',
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
module.exports = Config;
|
|
@@ -16,64 +16,67 @@ require('@webex/plugin-people');
|
|
|
16
16
|
require('@webex/plugin-rooms');
|
|
17
17
|
require('@webex/plugin-meetings');
|
|
18
18
|
|
|
19
|
-
const generateTestUsers = (options) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const generateTestUsers = (options) =>
|
|
20
|
+
testUser
|
|
21
|
+
.create({count: options.count})
|
|
22
|
+
.then(async (userSet) => {
|
|
23
|
+
if (userSet.length !== options.count) {
|
|
24
|
+
return Promise.reject(new Error('Test users not created'));
|
|
25
|
+
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
// Pause for 5 seconds for CI
|
|
28
|
+
await new Promise((done) => setTimeout(done, 5000));
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
const userRegisterPromises = [];
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
userSet.forEach((user) => {
|
|
33
|
+
// eslint-disable-next-line no-param-reassign
|
|
34
|
+
user.webex = new WebexCore({
|
|
35
|
+
config: config.webex,
|
|
36
|
+
credentials: {
|
|
37
|
+
authorization: user.token,
|
|
38
|
+
},
|
|
39
|
+
meetings: {
|
|
40
|
+
autoUploadLogs: false,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
user.webex.internal.support.submitLogs = sinon.stub().returns(Promise.resolve());
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
userRegisterPromises.push(user.webex.meetings.register());
|
|
47
|
+
});
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
49
|
+
return Promise.all(userRegisterPromises).then(() => userSet);
|
|
50
|
+
})
|
|
51
|
+
.catch((error) => {
|
|
52
|
+
console.error('#generateTestUsers=>ERROR', error);
|
|
53
|
+
});
|
|
53
54
|
|
|
54
|
-
const reserveCMR = (user) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
55
|
+
const reserveCMR = (user) =>
|
|
56
|
+
user.webex
|
|
57
|
+
.request({
|
|
58
|
+
method: 'POST',
|
|
59
|
+
uri: 'https://whistler-prod.allnint.ciscospark.com/api/v1/reservations',
|
|
60
|
+
headers: {
|
|
61
|
+
authorization: `Bearer ${user.webex.credentials.supertoken.access_token}`,
|
|
62
|
+
'cisco-no-http-redirect': null,
|
|
63
|
+
'spark-user-agent': null,
|
|
64
|
+
trackingid: `ITCLIENT_ ${user.id} _0_imi:true`,
|
|
65
|
+
},
|
|
66
|
+
body: {
|
|
67
|
+
resourceType: 'CMR_3',
|
|
68
|
+
reservedBy: 'SDK_TEST_USER',
|
|
69
|
+
requestMetaData: {
|
|
70
|
+
emailAddress: user.emailAddress,
|
|
71
|
+
loginType: 'loginGuest',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
.then((res) => {
|
|
76
|
+
console.log('SUCCESS ', res);
|
|
77
|
+
});
|
|
75
78
|
|
|
76
79
|
module.exports = {
|
|
77
80
|
generateTestUsers,
|
|
78
|
-
reserveCMR
|
|
81
|
+
reserveCMR,
|
|
79
82
|
};
|