瀏覽代碼

fix(tests): Simplifies await async.

factor2
damencho 4 月之前
父節點
當前提交
2c92ea57f0

+ 27
- 30
tests/helpers/Participant.ts 查看文件

@@ -252,7 +252,7 @@ export class Participant {
252 252
      */
253 253
     async waitForPageToLoad(): Promise<void> {
254 254
         return this.driver.waitUntil(
255
-            async () => await this.driver.execute(() => document.readyState === 'complete'),
255
+            () => this.driver.execute(() => document.readyState === 'complete'),
256 256
             {
257 257
                 timeout: 30_000, // 30 seconds
258 258
                 timeoutMsg: `Timeout waiting for Page Load Request to complete for ${this.name}.`
@@ -325,8 +325,8 @@ export class Participant {
325 325
     async waitForIceConnected(): Promise<void> {
326 326
         const driver = this.driver;
327 327
 
328
-        return driver.waitUntil(async () =>
329
-            await driver.execute(() => APP.conference.getConnectionState() === 'connected'), {
328
+        return driver.waitUntil(() =>
329
+            driver.execute(() => APP.conference.getConnectionState() === 'connected'), {
330 330
             timeout: 15_000,
331 331
             timeoutMsg: `expected ICE to be connected for 15s for ${this.name}`
332 332
         });
@@ -341,17 +341,16 @@ export class Participant {
341 341
             timeout = 15_000, msg = `expected to receive/send data in 15s for ${this.name}`): Promise<void> {
342 342
         const driver = this.driver;
343 343
 
344
-        return driver.waitUntil(async () =>
345
-            await driver.execute(() => {
346
-                const stats = APP.conference.getStats();
347
-                const bitrateMap = stats?.bitrate || {};
348
-                const rtpStats = {
349
-                    uploadBitrate: bitrateMap.upload || 0,
350
-                    downloadBitrate: bitrateMap.download || 0
351
-                };
352
-
353
-                return rtpStats.uploadBitrate > 0 && rtpStats.downloadBitrate > 0;
354
-            }), {
344
+        return driver.waitUntil(() => driver.execute(() => {
345
+            const stats = APP.conference.getStats();
346
+            const bitrateMap = stats?.bitrate || {};
347
+            const rtpStats = {
348
+                uploadBitrate: bitrateMap.upload || 0,
349
+                downloadBitrate: bitrateMap.download || 0
350
+            };
351
+
352
+            return rtpStats.uploadBitrate > 0 && rtpStats.downloadBitrate > 0;
353
+        }), {
355 354
             timeout,
356 355
             timeoutMsg: msg
357 356
         });
@@ -366,16 +365,15 @@ export class Participant {
366 365
             timeout = 15_000, msg = `expected to send data in 15s for ${this.name}`): Promise<void> {
367 366
         const driver = this.driver;
368 367
 
369
-        return driver.waitUntil(async () =>
370
-            await driver.execute(() => {
371
-                const stats = APP.conference.getStats();
372
-                const bitrateMap = stats?.bitrate || {};
373
-                const rtpStats = {
374
-                    uploadBitrate: bitrateMap.upload || 0
375
-                };
368
+        return driver.waitUntil(() => driver.execute(() => {
369
+            const stats = APP.conference.getStats();
370
+            const bitrateMap = stats?.bitrate || {};
371
+            const rtpStats = {
372
+                uploadBitrate: bitrateMap.upload || 0
373
+            };
376 374
 
377
-                return rtpStats.uploadBitrate > 0;
378
-            }), {
375
+            return rtpStats.uploadBitrate > 0;
376
+        }), {
379 377
             timeout,
380 378
             timeoutMsg: msg
381 379
         });
@@ -390,8 +388,8 @@ export class Participant {
390 388
     waitForRemoteStreams(number: number): Promise<void> {
391 389
         const driver = this.driver;
392 390
 
393
-        return driver.waitUntil(async () =>
394
-            await driver.execute(count => APP.conference.getNumberOfParticipantsWithTracks() >= count, number), {
391
+        return driver.waitUntil(() =>
392
+            driver.execute(count => APP.conference.getNumberOfParticipantsWithTracks() >= count, number), {
395 393
             timeout: 15_000,
396 394
             timeoutMsg: `expected number of remote streams:${number} in 15s for ${this.name}`
397 395
         });
@@ -407,8 +405,7 @@ export class Participant {
407 405
     waitForParticipants(number: number, msg?: string): Promise<void> {
408 406
         const driver = this.driver;
409 407
 
410
-        return driver.waitUntil(async () =>
411
-            await driver.execute(count => APP.conference.listMembers().length === count, number), {
408
+        return driver.waitUntil(() => driver.execute(count => APP.conference.listMembers().length === count, number), {
412 409
             timeout: 15_000,
413 410
             timeoutMsg: msg || `not the expected participants ${number} in 15s for ${this.name}`
414 411
         });
@@ -580,7 +577,7 @@ export class Participant {
580 577
      * Returns the local display name.
581 578
      */
582 579
     async getLocalDisplayName() {
583
-        return await (await this.getLocalDisplayNameElement()).getText();
580
+        return (await this.getLocalDisplayNameElement()).getText();
584 581
     }
585 582
 
586 583
     /**
@@ -631,7 +628,7 @@ export class Participant {
631 628
      * Returns the source of the large video currently shown.
632 629
      */
633 630
     async getLargeVideoId() {
634
-        return await this.driver.execute('return document.getElementById("largeVideo").srcObject.id');
631
+        return this.driver.execute('return document.getElementById("largeVideo").srcObject.id');
635 632
     }
636 633
 
637 634
     /**
@@ -700,7 +697,7 @@ export class Participant {
700 697
      * Checks if the leave reason dialog is open.
701 698
      */
702 699
     async isLeaveReasonDialogOpen() {
703
-        return await this.driver.$('div[data-testid="dialog.leaveReason"]').isDisplayed();
700
+        return this.driver.$('div[data-testid="dialog.leaveReason"]').isDisplayed();
704 701
     }
705 702
 
706 703
     /**

+ 8
- 8
tests/pageobjects/AVModerationMenu.ts 查看文件

@@ -12,29 +12,29 @@ export default class AVModerationMenu extends BasePageObject {
12 12
     /**
13 13
      * Clicks the start audio moderation menu item.
14 14
      */
15
-    async clickStartAudioModeration() {
16
-        await this.clickButton(START_AUDIO_MODERATION);
15
+    clickStartAudioModeration() {
16
+        return this.clickButton(START_AUDIO_MODERATION);
17 17
     }
18 18
 
19 19
     /**
20 20
      * Clicks the stop audio moderation menu item.
21 21
      */
22
-    async clickStopAudioModeration() {
23
-        await this.clickButton(STOP_AUDIO_MODERATION);
22
+    clickStopAudioModeration() {
23
+        return this.clickButton(STOP_AUDIO_MODERATION);
24 24
     }
25 25
 
26 26
     /**
27 27
      * Clicks the start video moderation menu item.
28 28
      */
29
-    async clickStartVideoModeration() {
30
-        await this.clickButton(START_VIDEO_MODERATION);
29
+    clickStartVideoModeration() {
30
+        return this.clickButton(START_VIDEO_MODERATION);
31 31
     }
32 32
 
33 33
     /**
34 34
      * Clicks the stop audio moderation menu item.
35 35
      */
36
-    async clickStopVideoModeration() {
37
-        await this.clickButton(STOP_VIDEO_MODERATION);
36
+    clickStopVideoModeration() {
37
+        return this.clickButton(STOP_VIDEO_MODERATION);
38 38
     }
39 39
 
40 40
     /**

+ 4
- 4
tests/pageobjects/BaseDialog.ts 查看文件

@@ -10,14 +10,14 @@ export default class BaseDialog extends BasePageObject {
10 10
     /**
11 11
      *  Clicks on the X (close) button.
12 12
      */
13
-    async clickCloseButton(): Promise<void> {
14
-        await this.participant.driver.$(`#${CLOSE_BUTTON}`).click();
13
+    clickCloseButton(): Promise<void> {
14
+        return this.participant.driver.$(`#${CLOSE_BUTTON}`).click();
15 15
     }
16 16
 
17 17
     /**
18 18
      *  Clicks on the ok button.
19 19
      */
20
-    async clickOkButton(): Promise<void> {
21
-        await this.participant.driver.$(`#${OK_BUTTON}`).click();
20
+    clickOkButton(): Promise<void> {
21
+        return this.participant.driver.$(`#${OK_BUTTON}`).click();
22 22
     }
23 23
 }

+ 2
- 19
tests/pageobjects/BreakoutRooms.ts 查看文件

@@ -50,11 +50,11 @@ class BreakoutRoom extends BasePageObject {
50 50
     /**
51 51
      * Collapses the breakout room.
52 52
      */
53
-    async collapse() {
53
+    collapse() {
54 54
         const collapseElem = this.participant.driver.$(
55 55
             `div[data-testid="${this.id}"]`);
56 56
 
57
-        await collapseElem.click();
57
+        return collapseElem.click();
58 58
     }
59 59
 
60 60
     /**
@@ -209,21 +209,4 @@ export default class BreakoutRooms extends BasePageObject {
209 209
         await sendButton.waitForClickable();
210 210
         await sendButton.click();
211 211
     }
212
-
213
-    // /**
214
-    //  * Open context menu for given participant.
215
-    //  */
216
-    // async openParticipantContextMenu(participant: Participant) {
217
-    //     const listItem = this.participant.driver.$(
218
-    //         `div[@id="participant-item-${await participant.getEndpointId()}"]`);
219
-    //
220
-    //     await listItem.waitForDisplayed();
221
-    //     await listItem.moveTo();
222
-    //
223
-    //     const button = listItem.$(`aria/${PARTICIPANT_MORE_LABEL}`);
224
-    //
225
-    //     await button.waitForClickable();
226
-    //     await button.click();
227
-    // }
228 212
 }
229
-

+ 2
- 2
tests/pageobjects/ChatPanel.ts 查看文件

@@ -7,8 +7,8 @@ export default class ChatPanel extends BasePageObject {
7 7
     /**
8 8
      * Is chat panel open.
9 9
      */
10
-    async isOpen() {
11
-        return await this.participant.driver.$('#sideToolbarContainer').isExisting();
10
+    isOpen() {
11
+        return this.participant.driver.$('#sideToolbarContainer').isExisting();
12 12
     }
13 13
 
14 14
     /**

+ 9
- 9
tests/pageobjects/Filmstrip.ts 查看文件

@@ -70,8 +70,8 @@ export default class Filmstrip extends BasePageObject {
70 70
     /**
71 71
      * Returns the local video id.
72 72
      */
73
-    async getLocalVideoId() {
74
-        return await this.participant.driver.execute(
73
+    getLocalVideoId() {
74
+        return this.participant.driver.execute(
75 75
             'return document.getElementById("localVideo_container").srcObject.id');
76 76
     }
77 77
 
@@ -94,7 +94,7 @@ export default class Filmstrip extends BasePageObject {
94 94
         const elem = this.participant.driver.$(
95 95
             `//span[@id='participant_${endpointId}']//img[contains(@class,'userAvatar')]`);
96 96
 
97
-        return await elem.isExisting() ? elem.getAttribute('src') : null;
97
+        return await elem.isExisting() ? await elem.getAttribute('src') : null;
98 98
     }
99 99
 
100 100
     /**
@@ -154,8 +154,8 @@ export default class Filmstrip extends BasePageObject {
154 154
      * Kicks a participant.
155 155
      * @param participantId
156 156
      */
157
-    async kickParticipant(participantId: string) {
158
-        await this.clickOnRemoteMenuLink(participantId, 'kicklink', true);
157
+    kickParticipant(participantId: string) {
158
+        return this.clickOnRemoteMenuLink(participantId, 'kicklink', true);
159 159
     }
160 160
 
161 161
     /**
@@ -177,8 +177,8 @@ export default class Filmstrip extends BasePageObject {
177 177
     /**
178 178
      * Checks whether the local self view is displayed or not.
179 179
      */
180
-    async assertSelfViewIsHidden(hidden: boolean) {
181
-        await this.participant.driver.$(LOCAL_VIDEO_XPATH).waitForDisplayed({
180
+    assertSelfViewIsHidden(hidden: boolean) {
181
+        return this.participant.driver.$(LOCAL_VIDEO_XPATH).waitForDisplayed({
182 182
             reverse: hidden,
183 183
             timeout: 5000,
184 184
             timeoutMsg: `Local video thumbnail is${hidden ? '' : ' not'} displayed for ${this.participant.name}`
@@ -200,8 +200,8 @@ export default class Filmstrip extends BasePageObject {
200 200
      * Asserts that the remote videos are hidden or not.
201 201
      * @param reverse
202 202
      */
203
-    async assertRemoteVideosHidden(reverse = false) {
204
-        await this.participant.driver.waitUntil(
203
+    assertRemoteVideosHidden(reverse = false) {
204
+        return this.participant.driver.waitUntil(
205 205
             async () =>
206 206
                 await this.participant.driver.$$('//div[@id="remoteVideos" and contains(@class, "hidden")]').length > 0,
207 207
             {

+ 14
- 15
tests/pageobjects/IframeAPI.ts 查看文件

@@ -10,8 +10,8 @@ export default class IframeAPI extends BasePageObject {
10 10
      * Returns the json object from the iframeAPI helper.
11 11
      * @param event
12 12
      */
13
-    async getEventResult(event: string): Promise<any> {
14
-        return await this.participant.driver.execute(
13
+    getEventResult(event: string): Promise<any> {
14
+        return this.participant.driver.execute(
15 15
             eventName => {
16 16
                 const result = window.jitsiAPI.test[eventName];
17 17
 
@@ -27,8 +27,8 @@ export default class IframeAPI extends BasePageObject {
27 27
      * Adds an event listener to the iframeAPI.
28 28
      * @param eventName The event name.
29 29
      */
30
-    async addEventListener(eventName: string) {
31
-        return await this.participant.driver.execute(
30
+    addEventListener(eventName: string) {
31
+        return this.participant.driver.execute(
32 32
             (event, prefix) => {
33 33
                 console.log(`${new Date().toISOString()} ${prefix} Adding listener for event: ${event}`);
34 34
                 window.jitsiAPI.addListener(event, evt => {
@@ -42,15 +42,15 @@ export default class IframeAPI extends BasePageObject {
42 42
     /**
43 43
      * Returns an array of available rooms and details of it.
44 44
      */
45
-    async getRoomsInfo() {
46
-        return await this.participant.driver.execute(() => window.jitsiAPI.getRoomsInfo());
45
+    getRoomsInfo() {
46
+        return this.participant.driver.execute(() => window.jitsiAPI.getRoomsInfo());
47 47
     }
48 48
 
49 49
     /**
50 50
      * Returns the number of participants in the conference.
51 51
      */
52
-    async getNumberOfParticipants() {
53
-        return await this.participant.driver.execute(() => window.jitsiAPI.getNumberOfParticipants());
52
+    getNumberOfParticipants() {
53
+        return this.participant.driver.execute(() => window.jitsiAPI.getNumberOfParticipants());
54 54
     }
55 55
 
56 56
     /**
@@ -58,8 +58,8 @@ export default class IframeAPI extends BasePageObject {
58 58
      * @param command The command.
59 59
      * @param args The arguments.
60 60
      */
61
-    async executeCommand(command: string, ...args: any[]) {
62
-        return await this.participant.driver.execute(
61
+    executeCommand(command: string, ...args: any[]) {
62
+        return this.participant.driver.execute(
63 63
             (commandName, commandArgs) =>
64 64
                 window.jitsiAPI.executeCommand(commandName, ...commandArgs)
65 65
             , command, args);
@@ -68,15 +68,14 @@ export default class IframeAPI extends BasePageObject {
68 68
     /**
69 69
      * Returns the current state of the participant's pane.
70 70
      */
71
-    async isParticipantsPaneOpen() {
72
-        return await this.participant.driver.execute(() => window.jitsiAPI.isParticipantsPaneOpen());
71
+    isParticipantsPaneOpen() {
72
+        return this.participant.driver.execute(() => window.jitsiAPI.isParticipantsPaneOpen());
73 73
     }
74 74
 
75 75
     /**
76 76
      * Removes the embedded Jitsi Meet conference.
77 77
      */
78
-    async dispose() {
79
-        return await this.participant.driver.execute(() => window.jitsiAPI.dispose());
78
+    dispose() {
79
+        return this.participant.driver.execute(() => window.jitsiAPI.dispose());
80 80
     }
81
-
82 81
 }

+ 3
- 3
tests/pageobjects/InviteDialog.ts 查看文件

@@ -13,7 +13,7 @@ export default class InviteDialog extends BaseDialog {
13 13
     /**
14 14
      * Checks if the dialog is open.
15 15
      */
16
-    async isOpen() {
16
+    isOpen() {
17 17
         return this.participant.driver.$(`.${DIALOG_CONTAINER}`).isExisting();
18 18
     }
19 19
 
@@ -85,8 +85,8 @@ export default class InviteDialog extends BaseDialog {
85 85
     /**
86 86
      * Gets the string that contains the dial in number for the current conference.
87 87
      */
88
-    async getDialInNumber() {
89
-        return await this.getValueAfterColon(PHONE_NUMBER);
88
+    getDialInNumber() {
89
+        return this.getValueAfterColon(PHONE_NUMBER);
90 90
     }
91 91
 
92 92
     /**

+ 2
- 2
tests/pageobjects/LobbyScreen.ts 查看文件

@@ -24,7 +24,7 @@ export default class LobbyScreen extends PreMeetingScreen {
24 24
     /**
25 25
      * Waits for lobby screen to load.
26 26
      */
27
-    async waitForLoading() {
28
-        await this.participant.driver.$('.lobby-screen').waitForDisplayed({ timeout: 4000 });
27
+    waitForLoading(): Promise<void> {
28
+        return this.participant.driver.$('.lobby-screen').waitForDisplayed({ timeout: 4000 });
29 29
     }
30 30
 }

+ 19
- 19
tests/pageobjects/Notifications.ts 查看文件

@@ -47,10 +47,10 @@ export default class Notifications extends BasePageObject {
47 47
     /**
48 48
      * Dismisses any join notifications.
49 49
      */
50
-    async dismissAnyJoinNotification() {
51
-        await Promise.allSettled(
50
+    dismissAnyJoinNotification() {
51
+        return Promise.allSettled(
52 52
             [ `${JOIN_ONE_TEST_ID}-dismiss`, `${JOIN_TWO_TEST_ID}-dismiss`, `${JOIN_MULTIPLE_TEST_ID}-dismiss` ]
53
-                .map(async id => this.participant.driver.$(`#${id}"]`).click()));
53
+                .map(id => this.participant.driver.$(`#${id}"]`).click()));
54 54
     }
55 55
 
56 56
     /**
@@ -68,15 +68,15 @@ export default class Notifications extends BasePageObject {
68 68
     /**
69 69
      * Closes the self view notification.
70 70
      */
71
-    async closeReEnableSelfViewNotification() {
72
-        await this.participant.driver.$(`div[data-testid="${REENABLE_SELF_VIEW_CLOSE_NOTIFICATION}"]`).click();
71
+    closeReEnableSelfViewNotification() {
72
+        return this.participant.driver.$(`div[data-testid="${REENABLE_SELF_VIEW_CLOSE_NOTIFICATION}"]`).click();
73 73
     }
74 74
 
75 75
     /**
76 76
      * The notification on participants page when Lobby is being enabled or disabled.
77 77
      */
78
-    async getLobbyEnabledText() {
79
-        return await this.getNotificationText(LOBBY_ENABLED_TEST_ID);
78
+    getLobbyEnabledText() {
79
+        return this.getNotificationText(LOBBY_ENABLED_TEST_ID);
80 80
     }
81 81
 
82 82
     /**
@@ -101,8 +101,8 @@ export default class Notifications extends BasePageObject {
101 101
     /**
102 102
      * Closes the notification.
103 103
      */
104
-    async closeLobbyEnabled() {
105
-        await this.closeLobbyNotification(LOBBY_ENABLED_TEST_ID);
104
+    closeLobbyEnabled() {
105
+        return this.closeLobbyNotification(LOBBY_ENABLED_TEST_ID);
106 106
     }
107 107
 
108 108
     /**
@@ -135,15 +135,15 @@ export default class Notifications extends BasePageObject {
135 135
     /**
136 136
      * The notification that someone's access was approved.
137 137
      */
138
-    async getLobbyParticipantAccessGranted() {
139
-        return await this.getNotificationText(LOBBY_PARTICIPANT_ACCESS_GRANTED_TEST_ID);
138
+    getLobbyParticipantAccessGranted() {
139
+        return this.getNotificationText(LOBBY_PARTICIPANT_ACCESS_GRANTED_TEST_ID);
140 140
     }
141 141
 
142 142
     /**
143 143
      * Closes the notification.
144 144
      */
145
-    async closeLobbyParticipantAccessGranted() {
146
-        await this.closeLobbyNotification(LOBBY_PARTICIPANT_ACCESS_GRANTED_TEST_ID);
145
+    closeLobbyParticipantAccessGranted() {
146
+        return this.closeLobbyNotification(LOBBY_PARTICIPANT_ACCESS_GRANTED_TEST_ID);
147 147
     }
148 148
 
149 149
     /**
@@ -173,15 +173,15 @@ export default class Notifications extends BasePageObject {
173 173
     /**
174 174
      * The notification test that someone's access was denied.
175 175
      */
176
-    async getLobbyParticipantAccessDenied() {
177
-        return await this.getNotificationText(LOBBY_PARTICIPANT_ACCESS_DENIED_TEST_ID);
176
+    getLobbyParticipantAccessDenied() {
177
+        return this.getNotificationText(LOBBY_PARTICIPANT_ACCESS_DENIED_TEST_ID);
178 178
     }
179 179
 
180 180
     /**
181 181
      * Closes the notification.
182 182
      */
183
-    async closeLobbyParticipantAccessDenied() {
184
-        await this.closeLobbyNotification(LOBBY_PARTICIPANT_ACCESS_DENIED_TEST_ID);
183
+    closeLobbyParticipantAccessDenied() {
184
+        return this.closeLobbyNotification(LOBBY_PARTICIPANT_ACCESS_DENIED_TEST_ID);
185 185
     }
186 186
 
187 187
     /**
@@ -199,8 +199,8 @@ export default class Notifications extends BasePageObject {
199 199
      * Will wait 3 seconds for the knocking participants to disappear and return true or will return false.
200 200
      * @return <tt>true</tt> if the knocking participants list was not displayed.
201 201
      */
202
-    async waitForHideOfKnockingParticipants() {
203
-        await this.participant.driver.$(LOBBY_KNOCKING_PARTICIPANT_NOTIFICATION_XPATH)
202
+    waitForHideOfKnockingParticipants() {
203
+        return this.participant.driver.$(LOBBY_KNOCKING_PARTICIPANT_NOTIFICATION_XPATH)
204 204
             .waitForDisplayed({
205 205
                 timeout: 3000,
206 206
                 reverse: true

+ 1
- 1
tests/pageobjects/ParticipantsPane.ts 查看文件

@@ -26,7 +26,7 @@ export default class ParticipantsPane extends BasePageObject {
26 26
     /**
27 27
      * Checks if the pane is open.
28 28
      */
29
-    async isOpen() {
29
+    isOpen() {
30 30
         return this.participant.driver.$(`.${PARTICIPANTS_PANE}`).isExisting();
31 31
     }
32 32
 

+ 2
- 2
tests/pageobjects/PreJoinScreen.ts 查看文件

@@ -24,8 +24,8 @@ export default class PreJoinScreen extends PreMeetingScreen {
24 24
     /**
25 25
      * Waits for pre join screen to load.
26 26
      */
27
-    async waitForLoading() {
28
-        await this.participant.driver.$('[data-testid="prejoin.screen"]')
27
+    waitForLoading(): Promise<void> {
28
+        return this.participant.driver.$('[data-testid="prejoin.screen"]')
29 29
             .waitForDisplayed({ timeout: 3000 });
30 30
     }
31 31
 }

+ 4
- 4
tests/pageobjects/PreMeetingScreen.ts 查看文件

@@ -40,9 +40,9 @@ export default abstract class PreMeetingScreen extends BasePageObject {
40 40
      *
41 41
      * @returns {Promise<void>}
42 42
      */
43
-    async waitToJoinLobby(): Promise<void> {
43
+    waitToJoinLobby(): Promise<void> {
44 44
         return this.participant.driver.waitUntil(
45
-            async () => await this.isLobbyRoomJoined(),
45
+            () => this.isLobbyRoomJoined(),
46 46
             {
47 47
                 timeout: 3_000, // 3 seconds
48 48
                 timeoutMsg: `Timeout waiting to join lobby for ${this.participant.name}`
@@ -53,8 +53,8 @@ export default abstract class PreMeetingScreen extends BasePageObject {
53 53
     /**
54 54
      * Checks internally whether lobby room is joined.
55 55
      */
56
-    async isLobbyRoomJoined() {
57
-        return await this.participant.driver.execute(
56
+    isLobbyRoomJoined() {
57
+        return this.participant.driver.execute(
58 58
             () => APP.conference._room?.room?.getLobby()?.lobbyRoom?.joined === true);
59 59
     }
60 60
 

+ 9
- 9
tests/pageobjects/SecurityDialog.ts 查看文件

@@ -15,8 +15,8 @@ export default class SecurityDialog extends BaseDialog {
15 15
     /**
16 16
      *  Waits for the settings dialog to be visible.
17 17
      */
18
-    async waitForDisplay() {
19
-        await this.participant.driver.$(`.${DIALOG_CONTAINER}`).waitForDisplayed();
18
+    waitForDisplay() {
19
+        return this.participant.driver.$(`.${DIALOG_CONTAINER}`).waitForDisplayed();
20 20
     }
21 21
 
22 22
     /**
@@ -30,7 +30,7 @@ export default class SecurityDialog extends BaseDialog {
30 30
     /**
31 31
      * Returns is the lobby enabled.
32 32
      */
33
-    async isLobbyEnabled() {
33
+    isLobbyEnabled() {
34 34
         return this.getLobbySwitch().isSelected();
35 35
     }
36 36
 
@@ -47,15 +47,15 @@ export default class SecurityDialog extends BaseDialog {
47 47
     /**
48 48
      * Checks whether lobby section is present in the UI.
49 49
      */
50
-    async isLobbySectionPresent() {
51
-        return await this.getLobbySwitch().isExisting();
50
+    isLobbySectionPresent() {
51
+        return this.getLobbySwitch().isExisting();
52 52
     }
53 53
 
54 54
     /**
55 55
      * Waits for the lobby to be enabled or disabled.
56 56
      * @param reverse
57 57
      */
58
-    async waitForLobbyEnabled(reverse = false) {
58
+    waitForLobbyEnabled(reverse = false) {
59 59
         const lobbySwitch = this.getLobbySwitch();
60 60
 
61 61
         return this.participant.driver.waitUntil(
@@ -74,7 +74,7 @@ export default class SecurityDialog extends BaseDialog {
74 74
      * @return {@code true} if the conference is displayed as locked locally in
75 75
      * the security dialog, {@code false} otherwise.
76 76
      */
77
-    private async isLockedLocally() {
77
+    private isLockedLocally() {
78 78
         return this.participant.driver.$(`.${LOCAL_LOCK}`).isExisting();
79 79
     }
80 80
 
@@ -84,8 +84,8 @@ export default class SecurityDialog extends BaseDialog {
84 84
      * @return {@code true}  if the conference is displayed as locked remotely
85 85
      * in the security dialog, {@code false} otherwise.
86 86
      */
87
-    private async isLockedRemotely() {
88
-        return await this.participant.driver.$(`.${REMOTE_LOCK}`).isExisting();
87
+    private isLockedRemotely() {
88
+        return this.participant.driver.$(`.${REMOTE_LOCK}`).isExisting();
89 89
     }
90 90
 
91 91
     /**

+ 10
- 10
tests/pageobjects/SettingsDialog.ts 查看文件

@@ -15,8 +15,8 @@ export default class SettingsDialog extends BaseDialog {
15 15
     /**
16 16
      *  Waits for the settings dialog to be visible.
17 17
      */
18
-    async waitForDisplay() {
19
-        await this.participant.driver.$(SETTINGS_DIALOG_CONTENT).waitForDisplayed();
18
+    waitForDisplay() {
19
+        return this.participant.driver.$(SETTINGS_DIALOG_CONTENT).waitForDisplayed();
20 20
     }
21 21
 
22 22
     /**
@@ -34,22 +34,22 @@ export default class SettingsDialog extends BaseDialog {
34 34
     /**
35 35
      * Selects the Profile tab to be displayed.
36 36
      */
37
-    async openProfileTab() {
38
-        await this.openTab(X_PATH_PROFILE_TAB);
37
+    openProfileTab() {
38
+        return this.openTab(X_PATH_PROFILE_TAB);
39 39
     }
40 40
 
41 41
     /**
42 42
      * Selects the More tab to be displayed.
43 43
      */
44
-    async openMoreTab() {
45
-        await this.openTab(X_PATH_MORE_TAB);
44
+    openMoreTab() {
45
+        return this.openTab(X_PATH_MORE_TAB);
46 46
     }
47 47
 
48 48
     /**
49 49
      * Selects the moderator tab to be displayed.
50 50
      */
51
-    async openModeratorTab() {
52
-        await this.openTab(X_PATH_MODERATOR_TAB);
51
+    openModeratorTab() {
52
+        return this.openTab(X_PATH_MODERATOR_TAB);
53 53
     }
54 54
 
55 55
     /**
@@ -74,8 +74,8 @@ export default class SettingsDialog extends BaseDialog {
74 74
     /**
75 75
      * Clicks the OK button on the settings dialog to close the dialog and save any changes made.
76 76
      */
77
-    async submit() {
78
-        await this.clickOkButton();
77
+    submit() {
78
+        return this.clickOkButton();
79 79
     }
80 80
 
81 81
     /**

+ 47
- 38
tests/pageobjects/Toolbar.ts 查看文件

@@ -55,9 +55,10 @@ export default class Toolbar extends BasePageObject {
55 55
      *
56 56
      * @returns {Promise<void>}
57 57
      */
58
-    async clickAudioMuteButton(): Promise<void> {
58
+    clickAudioMuteButton(): Promise<void> {
59 59
         this.participant.log('Clicking on: Audio Mute Button');
60
-        await this.audioMuteBtn.click();
60
+
61
+        return this.audioMuteBtn.click();
61 62
     }
62 63
 
63 64
     /**
@@ -65,9 +66,10 @@ export default class Toolbar extends BasePageObject {
65 66
      *
66 67
      * @returns {Promise<void>}
67 68
      */
68
-    async clickAudioUnmuteButton(): Promise<void> {
69
+    clickAudioUnmuteButton(): Promise<void> {
69 70
         this.participant.log('Clicking on: Audio Unmute Button');
70
-        await this.audioUnMuteBtn.click();
71
+
72
+        return this.audioUnMuteBtn.click();
71 73
     }
72 74
 
73 75
     /**
@@ -89,9 +91,10 @@ export default class Toolbar extends BasePageObject {
89 91
      *
90 92
      * @returns {Promise<void>}
91 93
      */
92
-    async clickVideoMuteButton(): Promise<void> {
94
+    clickVideoMuteButton(): Promise<void> {
93 95
         this.participant.log('Clicking on: Video Mute Button');
94
-        await this.videoMuteBtn.click();
96
+
97
+        return this.videoMuteBtn.click();
95 98
     }
96 99
 
97 100
     /**
@@ -99,9 +102,10 @@ export default class Toolbar extends BasePageObject {
99 102
      *
100 103
      * @returns {Promise<void>}
101 104
      */
102
-    async clickVideoUnmuteButton(): Promise<void> {
105
+    clickVideoUnmuteButton(): Promise<void> {
103 106
         this.participant.log('Clicking on: Video Unmute Button');
104
-        await this.videoUnMuteBtn.click();
107
+
108
+        return this.videoUnMuteBtn.click();
105 109
     }
106 110
 
107 111
     /**
@@ -109,9 +113,10 @@ export default class Toolbar extends BasePageObject {
109 113
      *
110 114
      * @returns {Promise<void>}
111 115
      */
112
-    async clickCloseParticipantsPaneButton(): Promise<void> {
116
+    clickCloseParticipantsPaneButton(): Promise<void> {
113 117
         this.participant.log('Clicking on: Close Participants pane Button');
114
-        await this.getButton(CLOSE_PARTICIPANTS_PANE).click();
118
+
119
+        return this.getButton(CLOSE_PARTICIPANTS_PANE).click();
115 120
     }
116 121
 
117 122
     /**
@@ -119,101 +124,105 @@ export default class Toolbar extends BasePageObject {
119 124
      *
120 125
      * @returns {Promise<void>}
121 126
      */
122
-    async clickParticipantsPaneButton(): Promise<void> {
127
+    clickParticipantsPaneButton(): Promise<void> {
123 128
         this.participant.log('Clicking on: Participants pane Button');
124 129
 
125 130
         // Special case for participants pane button, as it contains the number of participants and its label
126 131
         // is changing
127
-        await this.participant.driver.$(`[aria-label^="${PARTICIPANTS}"]`).click();
132
+        return this.participant.driver.$(`[aria-label^="${PARTICIPANTS}"]`).click();
128 133
     }
129 134
 
130 135
     /**
131 136
      * Clicks on the video quality toolbar button which opens the
132 137
      * dialog for adjusting max-received video quality.
133 138
      */
134
-    async clickVideoQualityButton(): Promise<void> {
139
+    clickVideoQualityButton(): Promise<void> {
135 140
         return this.clickButtonInOverflowMenu(VIDEO_QUALITY);
136 141
     }
137 142
 
138 143
     /**
139 144
      * Clicks on the profile toolbar button which opens or closes the profile panel.
140 145
      */
141
-    async clickProfileButton(): Promise<void> {
146
+    clickProfileButton(): Promise<void> {
142 147
         return this.clickButtonInOverflowMenu(PROFILE);
143 148
     }
144 149
 
145 150
     /**
146 151
      * Clicks on the raise hand button that enables participants will to speak.
147 152
      */
148
-    async clickRaiseHandButton(): Promise<void> {
153
+    clickRaiseHandButton(): Promise<void> {
149 154
         this.participant.log('Clicking on: Raise hand Button');
150
-        await this.getButton(RAISE_HAND).click();
155
+
156
+        return this.getButton(RAISE_HAND).click();
151 157
     }
152 158
 
153 159
     /**
154 160
      * Clicks on the chat button that opens chat panel.
155 161
      */
156
-    async clickChatButton(): Promise<void> {
162
+    clickChatButton(): Promise<void> {
157 163
         this.participant.log('Clicking on: Chat Button');
158
-        await this.getButton(CHAT).click();
164
+
165
+        return this.getButton(CHAT).click();
159 166
     }
160 167
 
161 168
     /**
162 169
      * Clicks on the chat button that closes chat panel.
163 170
      */
164
-    async clickCloseChatButton(): Promise<void> {
171
+    clickCloseChatButton(): Promise<void> {
165 172
         this.participant.log('Clicking on: Close Chat Button');
166
-        await this.getButton(CLOSE_CHAT).click();
173
+
174
+        return this.getButton(CLOSE_CHAT).click();
167 175
     }
168 176
 
169 177
     /**
170 178
      * Clicks on the desktop sharing button that starts desktop sharing.
171 179
      */
172
-    async clickDesktopSharingButton() {
173
-        await this.getButton(DESKTOP).click();
180
+    clickDesktopSharingButton() {
181
+        return this.getButton(DESKTOP).click();
174 182
     }
175 183
 
176 184
     /**
177 185
      * Clicks on the desktop sharing button to stop it.
178 186
      */
179
-    async clickStopDesktopSharingButton() {
180
-        await this.getButton(STOP_DESKTOP).click();
187
+    clickStopDesktopSharingButton() {
188
+        return this.getButton(STOP_DESKTOP).click();
181 189
     }
182 190
 
183 191
     /**
184 192
      * Clicks on the tile view button which enables tile layout.
185 193
      */
186
-    async clickEnterTileViewButton() {
187
-        await this.getButton(ENTER_TILE_VIEW_BUTTON).click();
194
+    clickEnterTileViewButton() {
195
+        return this.getButton(ENTER_TILE_VIEW_BUTTON).click();
188 196
     }
189 197
 
190 198
     /**
191 199
      * Clicks on the tile view button which exits tile layout.
192 200
      */
193
-    async clickExitTileViewButton() {
194
-        await this.getButton(EXIT_TILE_VIEW_BUTTON).click();
201
+    clickExitTileViewButton() {
202
+        return this.getButton(EXIT_TILE_VIEW_BUTTON).click();
195 203
     }
196 204
 
197 205
     /**
198 206
      * Clicks on the hangup button that ends the conference.
199 207
      */
200
-    async clickHangupButton(): Promise<void> {
208
+    clickHangupButton(): Promise<void> {
201 209
         this.participant.log('Clicking on: Hangup Button');
202
-        await this.getButton(HANGUP).click();
210
+
211
+        return this.getButton(HANGUP).click();
203 212
     }
204 213
 
205 214
     /**
206 215
      * Clicks on the security toolbar button which opens the security panel.
207 216
      */
208
-    async clickSecurityButton() {
209
-        await this.clickButtonInOverflowMenu(SECURITY);
217
+    clickSecurityButton() {
218
+        return this.clickButtonInOverflowMenu(SECURITY);
210 219
     }
211 220
 
212 221
     /**
213 222
      * Clicks on the settings toolbar button which opens or closes the settings panel.
214 223
      */
215
-    async clickSettingsButton() {
216
-        await this.clickButtonInOverflowMenu(SETTINGS);
224
+    clickSettingsButton() {
225
+        return this.clickButtonInOverflowMenu(SETTINGS);
217 226
     }
218 227
 
219 228
     /**
@@ -246,8 +255,8 @@ export default class Toolbar extends BasePageObject {
246 255
      * Clicks on the overflow toolbar button which opens or closes the overflow menu.
247 256
      * @private
248 257
      */
249
-    private async clickOverflowButton(): Promise<void> {
250
-        await this.getButton(OVERFLOW).click();
258
+    private clickOverflowButton(): Promise<void> {
259
+        return this.getButton(OVERFLOW).click();
251 260
     }
252 261
 
253 262
     /**
@@ -283,8 +292,8 @@ export default class Toolbar extends BasePageObject {
283 292
      * @param visible
284 293
      * @private
285 294
      */
286
-    private async waitForOverFlowMenu(visible: boolean) {
287
-        await this.getButton(OVERFLOW_MENU).waitForDisplayed({
295
+    private waitForOverFlowMenu(visible: boolean) {
296
+        return this.getButton(OVERFLOW_MENU).waitForDisplayed({
288 297
             reverse: !visible,
289 298
             timeout: 3000,
290 299
             timeoutMsg: `Overflow menu is not ${visible ? 'visible' : 'hidden'}`

+ 3
- 11
tests/specs/2way/audioOnly.spec.ts 查看文件

@@ -1,18 +1,12 @@
1 1
 import { ensureTwoParticipants } from '../../helpers/participants';
2 2
 
3 3
 describe('Audio only', () => {
4
-    it('joining the meeting', async () => {
5
-        await ensureTwoParticipants(ctx, {
6
-            skipFirstModerator: true
7
-        });
8
-    });
4
+    it('joining the meeting', () => ensureTwoParticipants(ctx, { skipFirstModerator: true }));
9 5
 
10 6
     /**
11 7
      * Enables audio only mode for p1 and verifies that the other participant sees participant1 as video muted.
12 8
      */
13
-    it('set and check', async () => {
14
-        await setAudioOnlyAndCheck(true);
15
-    });
9
+    it('set and check', () => setAudioOnlyAndCheck(true));
16 10
 
17 11
     /**
18 12
      * Verifies that participant1 sees avatars for itself and other participants.
@@ -29,9 +23,7 @@ describe('Audio only', () => {
29 23
     /**
30 24
      * Disables audio only mode and verifies that both participants see p1 as not video muted.
31 25
      */
32
-    it('disable and check', async () => {
33
-        await setAudioOnlyAndCheck(false);
34
-    });
26
+    it('disable and check', () => setAudioOnlyAndCheck(false));
35 27
 
36 28
     /**
37 29
      * Mutes video on participant1, toggles audio-only twice and then verifies if both participants see participant1

+ 1
- 5
tests/specs/2way/displayName.spec.ts 查看文件

@@ -1,11 +1,7 @@
1 1
 import { ensureTwoParticipants } from '../../helpers/participants';
2 2
 
3 3
 describe('DisplayName', () => {
4
-    it('joining the meeting', async () => {
5
-        await ensureTwoParticipants(ctx, {
6
-            skipDisplayName: true
7
-        });
8
-    });
4
+    it('joining the meeting', () => ensureTwoParticipants(ctx, { skipDisplayName: true }));
9 5
 
10 6
     it('check change', async () => {
11 7
         const { p1, p2 } = ctx;

+ 1
- 3
tests/specs/2way/endConference.spec.ts 查看文件

@@ -1,9 +1,7 @@
1 1
 import { ensureTwoParticipants } from '../../helpers/participants';
2 2
 
3 3
 describe('End Conference', () => {
4
-    it('joining the meeting', async () => {
5
-        await ensureTwoParticipants(ctx);
6
-    });
4
+    it('joining the meeting', () => ensureTwoParticipants(ctx));
7 5
 
8 6
     it('hangup call and check', async () => {
9 7
         const { p1 } = ctx;

+ 12
- 17
tests/specs/2way/iFrameApiParticipantsPresence.spec.ts 查看文件

@@ -144,7 +144,7 @@ describe('Participants presence', () => {
144 144
 
145 145
         await p1.getIframeAPI().executeCommand('grantModerator', p2EpId);
146 146
 
147
-        await p2.driver.waitUntil(async () => await p2.getIframeAPI().getEventResult('isModerator'), {
147
+        await p2.driver.waitUntil(() => p2.getIframeAPI().getEventResult('isModerator'), {
148 148
             timeout: 3000,
149 149
             timeoutMsg: 'Moderator role not granted'
150 150
         });
@@ -202,13 +202,11 @@ describe('Participants presence', () => {
202 202
 
203 203
         await p1.getIframeAPI().executeCommand('kickParticipant', p2EpId);
204 204
 
205
-        const eventP1 = await p1.driver.waitUntil(async () =>
206
-            await p1.getIframeAPI().getEventResult('participantKickedOut'), {
205
+        const eventP1 = await p1.driver.waitUntil(() => p1.getIframeAPI().getEventResult('participantKickedOut'), {
207 206
             timeout: 2000,
208 207
             timeoutMsg: 'participantKickedOut event not received on participant1 side'
209 208
         });
210
-        const eventP2 = await p2.driver.waitUntil(async () =>
211
-            await p2.getIframeAPI().getEventResult('participantKickedOut'), {
209
+        const eventP2 = await p2.driver.waitUntil(() => p2.getIframeAPI().getEventResult('participantKickedOut'), {
212 210
             timeout: 2000,
213 211
             timeoutMsg: 'participantKickedOut event not received on participant2 side'
214 212
         });
@@ -243,8 +241,8 @@ describe('Participants presence', () => {
243 241
             }
244 242
         })).toBe(true);
245 243
 
246
-        const eventConferenceLeftP2 = await p2.driver.waitUntil(async () =>
247
-            await p2.getIframeAPI().getEventResult('videoConferenceLeft'), {
244
+        const eventConferenceLeftP2 = await p2.driver.waitUntil(() =>
245
+            p2.getIframeAPI().getEventResult('videoConferenceLeft'), {
248 246
             timeout: 2000,
249 247
             timeoutMsg: 'videoConferenceLeft not received'
250 248
         });
@@ -289,8 +287,7 @@ describe('Participants presence', () => {
289 287
 
290 288
         await p1.switchToAPI();
291 289
 
292
-        const event = await p1.driver.waitUntil(async () =>
293
-            await p1.getIframeAPI().getEventResult('participantJoined'), {
290
+        const event = await p1.driver.waitUntil(() => p1.getIframeAPI().getEventResult('participantJoined'), {
294 291
             timeout: 2000,
295 292
             timeoutMsg: 'participantJoined not received'
296 293
         });
@@ -341,8 +338,8 @@ describe('Participants presence', () => {
341 338
 
342 339
         await p2.getIframeAPI().executeCommand('hangup');
343 340
 
344
-        const eventConferenceLeftP2 = await p2.driver.waitUntil(async () =>
345
-            await p2.getIframeAPI().getEventResult('videoConferenceLeft'), {
341
+        const eventConferenceLeftP2 = await p2.driver.waitUntil(() =>
342
+            p2.getIframeAPI().getEventResult('videoConferenceLeft'), {
346 343
             timeout: 2000,
347 344
             timeoutMsg: 'videoConferenceLeft not received'
348 345
         });
@@ -352,8 +349,7 @@ describe('Participants presence', () => {
352 349
 
353 350
         await checkParticipantLeftHook(p2, 'left');
354 351
 
355
-        const eventReadyToCloseP2 = await p2.driver.waitUntil(async () =>
356
-            await p2.getIframeAPI().getEventResult('readyToClose'), {
352
+        const eventReadyToCloseP2 = await p2.driver.waitUntil(() => p2.getIframeAPI().getEventResult('readyToClose'), {
357 353
             timeout: 2000,
358 354
             timeoutMsg: 'readyToClose not received'
359 355
         });
@@ -371,8 +367,8 @@ describe('Participants presence', () => {
371 367
 
372 368
         await p1.getIframeAPI().executeCommand('hangup');
373 369
 
374
-        const eventConferenceLeft = await p1.driver.waitUntil(async () =>
375
-            await p1.getIframeAPI().getEventResult('videoConferenceLeft'), {
370
+        const eventConferenceLeft = await p1.driver.waitUntil(() =>
371
+            p1.getIframeAPI().getEventResult('videoConferenceLeft'), {
376 372
             timeout: 2000,
377 373
             timeoutMsg: 'videoConferenceLeft not received'
378 374
         });
@@ -397,8 +393,7 @@ describe('Participants presence', () => {
397 393
             expect(event.data.isBreakout).toBe(false);
398 394
         }
399 395
 
400
-        const eventReadyToClose = await p1.driver.waitUntil(async () =>
401
-            await p1.getIframeAPI().getEventResult('readyToClose'), {
396
+        const eventReadyToClose = await p1.driver.waitUntil(() => p1.getIframeAPI().getEventResult('readyToClose'), {
402 397
             timeout: 2000,
403 398
             timeoutMsg: 'readyToClose not received'
404 399
         });

+ 1
- 3
tests/specs/2way/kick.spec.ts 查看文件

@@ -9,9 +9,7 @@ describe('Kick', () => {
9 9
         }
10 10
     });
11 11
 
12
-    it('kick and check', async () => {
13
-        await kickParticipant2AndCheck();
14
-    });
12
+    it('kick and check', () => kickParticipant2AndCheck());
15 13
 
16 14
     it('kick p2p and check', async () => {
17 15
         await ensureTwoParticipants(ctx, {

+ 1
- 3
tests/specs/2way/selfView.spec.ts 查看文件

@@ -2,9 +2,7 @@ import type { Participant } from '../../helpers/Participant';
2 2
 import { ensureTwoParticipants } from '../../helpers/participants';
3 3
 
4 4
 describe('Self view', () => {
5
-    it('joining the meeting', async () => {
6
-        await ensureTwoParticipants(ctx);
7
-    });
5
+    it('joining the meeting', () => ensureTwoParticipants(ctx));
8 6
 
9 7
     it('hide from menu', async () => {
10 8
         const { p1 } = ctx;

+ 1
- 2
tests/specs/3way/activeSpeaker.spec.ts 查看文件

@@ -61,8 +61,7 @@ async function testActiveSpeaker(
61 61
     const otherParticipant1Driver = otherParticipant1.driver;
62 62
 
63 63
     await otherParticipant1Driver.waitUntil(
64
-        async () => await otherParticipant1Driver.execute(
65
-            id => APP.UI.getLargeVideoID() === id, speakerEndpoint),
64
+        () => otherParticipant1Driver.execute(id => APP.UI.getLargeVideoID() === id, speakerEndpoint),
66 65
         {
67 66
             timeout: 30_000, // 30 seconds
68 67
             timeoutMsg: 'Active speaker not displayed on large video.'

+ 1
- 1
tests/specs/3way/audioVideoModeration.spec.ts 查看文件

@@ -135,7 +135,7 @@ describe('AVModeration', () => {
135 135
         await p1.getFilmstrip().grantModerator(p3);
136 136
 
137 137
         await p3.driver.waitUntil(
138
-            async () => await p3.isModerator(), {
138
+            () => p3.isModerator(), {
139 139
                 timeout: 5000,
140 140
                 timeoutMsg: `${p3.name} is not moderator`
141 141
             });

+ 4
- 5
tests/specs/3way/avatars.spec.ts 查看文件

@@ -8,15 +8,14 @@ const EMAIL = 'support@jitsi.org';
8 8
 const HASH = '38f014e4b7dde0f64f8157d26a8c812e';
9 9
 
10 10
 describe('Avatar', () => {
11
-    it('setup the meeting', async () => {
12
-        // Start p1
13
-        await ensureTwoParticipants(ctx, {
11
+    it('setup the meeting', () =>
12
+        ensureTwoParticipants(ctx, {
14 13
             skipDisplayName: true,
15 14
 
16 15
             // no default avatar if we have used to join a token with an avatar and no option to set it
17 16
             skipFirstModerator: true
18
-        });
19
-    });
17
+        })
18
+    );
20 19
 
21 20
     it('change and check', async () => {
22 21
         const { p1, p2 } = ctx;

+ 2
- 3
tests/specs/3way/breakoutRooms.spec.ts 查看文件

@@ -266,8 +266,8 @@ describe('BreakoutRooms', () => {
266 266
             });
267 267
 
268 268
         // there should be two participants in the main room, either p2 or p3 got moved to the main room
269
-        const checkParticipants = async (p: Participant) => {
270
-            await p.driver.waitUntil(
269
+        const checkParticipants = (p: Participant) =>
270
+            p.driver.waitUntil(
271 271
                 async () => {
272 272
                     const isInBreakoutRoom = await p.isInBreakoutRoom();
273 273
                     const breakoutRooms = p.getBreakoutRooms();
@@ -303,7 +303,6 @@ describe('BreakoutRooms', () => {
303 303
                     timeout: 2000,
304 304
                     timeoutMsg: `${p.name} is not seeing an empty breakout room and one with one participant`
305 305
                 });
306
-        };
307 306
 
308 307
         await checkParticipants(p2);
309 308
         await checkParticipants(p3);

+ 2
- 2
tests/specs/3way/codecSelection.spec.ts 查看文件

@@ -104,14 +104,14 @@ describe('Codec selection', () => {
104 104
 
105 105
         // Check of p1 and p2 have switched to VP9.
106 106
         await p1.driver.waitUntil(
107
-            async () => await p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
107
+            () => p1.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
108 108
             {
109 109
                 timeout: 10000,
110 110
                 timeoutMsg: 'p1 did not switch back to VP9'
111 111
             }
112 112
         );
113 113
         await p2.driver.waitUntil(
114
-            async () => await p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
114
+            () => p2.driver.execute(() => JitsiMeetJS.app.testing.isLocalCameraEncodingVp9()),
115 115
             {
116 116
                 timeout: 10000,
117 117
                 timeoutMsg: 'p1 did not switch back to VP9'

+ 3
- 3
tests/specs/3way/lobby.spec.ts 查看文件

@@ -201,7 +201,7 @@ describe('Lobby', () => {
201 201
         await p1.hangup();
202 202
 
203 203
         await p2.driver.waitUntil(
204
-            async () => await p2.isModerator(),
204
+            () => p2.isModerator(),
205 205
             {
206 206
                 timeout: 3000,
207 207
                 timeoutMsg: 'p2 is not moderator after p1 leaves'
@@ -241,7 +241,7 @@ describe('Lobby', () => {
241 241
         await p1SecurityDialog.addPassword(roomPasscode);
242 242
 
243 243
         await p1.driver.waitUntil(
244
-            async () => await p1SecurityDialog.isLocked(),
244
+            () => p1SecurityDialog.isLocked(),
245 245
             {
246 246
                 timeout: 2000,
247 247
                 timeoutMsg: 'room did not lock for p1'
@@ -286,7 +286,7 @@ describe('Lobby', () => {
286 286
         await p1.hangup();
287 287
 
288 288
         await p2.driver.waitUntil(
289
-            async () => await p2.isModerator(),
289
+            () => p2.isModerator(),
290 290
             {
291 291
                 timeout: 3000,
292 292
                 timeoutMsg: 'p2 is not moderator after p1 leaves'

+ 2
- 4
tests/specs/4way/desktopSharing.spec.ts 查看文件

@@ -203,8 +203,7 @@ describe('Desktop sharing', () => {
203 203
         await checkForScreensharingTile(p3, p2);
204 204
 
205 205
         // the video should be playing
206
-        await p1.driver.waitUntil(async () =>
207
-            await p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
206
+        await p1.driver.waitUntil(() => p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
208 207
             timeout: 5_000,
209 208
             timeoutMsg: 'expected remote screen share to be on large'
210 209
         });
@@ -255,8 +254,7 @@ describe('Desktop sharing', () => {
255 254
         expect(await p1.driver.execute(() => APP.UI.getLargeVideoID())).toBe(`${await p3.getEndpointId()}-v1`);
256 255
 
257 256
         // the video should be playing
258
-        await p1.driver.waitUntil(async () =>
259
-            await p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
257
+        await p1.driver.waitUntil(() => p1.driver.execute(() => JitsiMeetJS.app.testing.isLargeVideoReceived()), {
260 258
             timeout: 5_000,
261 259
             timeoutMsg: 'expected remote screen share to be on large'
262 260
         });

+ 2
- 3
tests/specs/alone/chatPanel.spec.ts 查看文件

@@ -1,9 +1,8 @@
1 1
 import { ensureOneParticipant } from '../../helpers/participants';
2 2
 
3 3
 describe('Chat Panel', () => {
4
-    it('join participant', async () => {
5
-        await ensureOneParticipant(ctx);
6
-    });
4
+    it('join participant', () => ensureOneParticipant(ctx));
5
+
7 6
     it('start closed', async () => {
8 7
         expect(await ctx.p1.getChatPanel().isOpen()).toBe(false);
9 8
     });

+ 1
- 3
tests/specs/alone/invite.spec.ts 查看文件

@@ -2,9 +2,7 @@ import { ensureOneParticipant } from '../../helpers/participants';
2 2
 import { isDialInEnabled } from '../helpers/DialIn';
3 3
 
4 4
 describe('Invite', () => {
5
-    it('join participant', async () => {
6
-        await ensureOneParticipant(ctx);
7
-    });
5
+    it('join participant', () => ensureOneParticipant(ctx));
8 6
 
9 7
     it('url displayed', async () => {
10 8
         const { p1 } = ctx;

Loading…
取消
儲存