Skip to content

Commit 5556dcd

Browse files
committed
feat: Attempt to improve timeouts.
This adds more waits and ensures that WebdriverIO timeouts synchronize with Mocha's (for better CI stability).
1 parent 2cc6ffe commit 5556dcd

18 files changed

+73
-32
lines changed

test/webdriverio/test/actions_test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,10 @@ suite('Menus test', function () {
9292

9393
// Clear the workspace and load start blocks.
9494
setup(async function () {
95-
// This is the first test suite, which must wait for Chrome +
96-
// chromedriver to start up, which can be slow—perhaps a few
97-
// seconds. Allow 30s just in case.
98-
this.timeout(30000);
99-
100-
this.browser = await testSetup(testFileLocations.MORE_BLOCKS);
95+
this.browser = await testSetup(
96+
testFileLocations.MORE_BLOCKS,
97+
this.timeout(),
98+
);
10199
await this.browser.pause(PAUSE_TIME);
102100
});
103101

test/webdriverio/test/basic_test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ suite('Keyboard navigation on Blocks', function () {
3131

3232
// Clear the workspace and load start blocks.
3333
suiteSetup(async function () {
34-
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
34+
this.browser = await testSetup(
35+
testFileLocations.NAVIGATION_TEST_BLOCKS,
36+
this.timeout(),
37+
);
3538
});
3639

3740
test('Default workspace', async function () {
@@ -226,7 +229,10 @@ suite('Keyboard navigation on Fields', function () {
226229

227230
// Clear the workspace and load start blocks.
228231
suiteSetup(async function () {
229-
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
232+
this.browser = await testSetup(
233+
testFileLocations.NAVIGATION_TEST_BLOCKS,
234+
this.timeout(),
235+
);
230236
});
231237

232238
test('Up from first field selects block', async function () {

test/webdriverio/test/block_comment_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ suite('Block comment navigation', function () {
2323

2424
// Clear the workspace and load start blocks.
2525
setup(async function () {
26-
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
26+
this.browser = await testSetup(
27+
testFileLocations.NAVIGATION_TEST_BLOCKS,
28+
this.timeout(),
29+
);
2730
await this.browser.execute(() => {
2831
Blockly.getMainWorkspace()
2932
.getBlockById('p5_canvas_1')

test/webdriverio/test/clipboard_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ suite('Clipboard test', function () {
2727

2828
// Clear the workspace and load start blocks.
2929
setup(async function () {
30-
this.browser = await testSetup(testFileLocations.BASE);
30+
this.browser = await testSetup(testFileLocations.BASE, this.timeout());
3131
await this.browser.pause(PAUSE_TIME);
3232
});
3333

test/webdriverio/test/delete_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ suite('Deleting Blocks', function () {
2727

2828
// Clear the workspace and load start blocks.
2929
setup(async function () {
30-
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
30+
this.browser = await testSetup(
31+
testFileLocations.NAVIGATION_TEST_BLOCKS,
32+
this.timeout(),
33+
);
3134
await this.browser.pause(PAUSE_TIME);
3235
});
3336

test/webdriverio/test/duplicate_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ suite('Duplicate test', function () {
2323

2424
// Clear the workspace and load start blocks.
2525
setup(async function () {
26-
this.browser = await testSetup(testFileLocations.BASE);
26+
this.browser = await testSetup(testFileLocations.BASE, this.timeout());
2727
await this.browser.pause(PAUSE_TIME);
2828
});
2929

test/webdriverio/test/flyout_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ suite('Toolbox and flyout test', function () {
2828

2929
// Clear the workspace and load start blocks.
3030
setup(async function () {
31-
this.browser = await testSetup(testFileLocations.BASE);
31+
this.browser = await testSetup(testFileLocations.BASE, this.timeout());
3232
await this.browser.pause(PAUSE_TIME);
3333
});
3434

test/webdriverio/test/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const mochaHooks: RootHookObject = {
1616
async beforeAll(this: Mocha.Context) {
1717
// Set a long timeout for startup.
1818
this.timeout(60000);
19-
return await driverSetup();
19+
return await driverSetup(this.timeout());
2020
},
2121
async afterAll() {
2222
return await driverTeardown();

test/webdriverio/test/insert_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ suite('Insert test', function () {
2828

2929
// Clear the workspace and load start blocks.
3030
setup(async function () {
31-
this.browser = await testSetup(testFileLocations.BASE);
31+
this.browser = await testSetup(testFileLocations.BASE, this.timeout());
3232
await this.browser.pause(PAUSE_TIME);
3333
});
3434

test/webdriverio/test/keyboard_mode_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ suite(
3232

3333
setup(async function () {
3434
// Reload the page between tests
35-
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
35+
this.browser = await testSetup(
36+
testFileLocations.NAVIGATION_TEST_BLOCKS,
37+
this.timeout(),
38+
);
3639

3740
await this.browser.pause(PAUSE_TIME);
3841

0 commit comments

Comments
 (0)