diff --git a/eslint.config.js b/eslint.config.js index 60bfe8ab..4a8f0fb3 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -259,4 +259,17 @@ module.exports = [ '@typescript-eslint/no-require-imports': 'error', }, }, + { + files: ['test/webdriverio/test/*.ts'], + languageOptions: { + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + }, + }, + rules: { + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-misused-promises': 'error', + }, + }, ]; diff --git a/test/webdriverio/test/keyboard_mode_test.ts b/test/webdriverio/test/keyboard_mode_test.ts index 692f0d9f..d022c69a 100644 --- a/test/webdriverio/test/keyboard_mode_test.ts +++ b/test/webdriverio/test/keyboard_mode_test.ts @@ -86,7 +86,7 @@ suite( chai.assert.isFalse(await isKeyboardNavigating(this.browser)); - this.browser.execute(() => { + await this.browser.execute(() => { Blockly.keyboardNavigationController.setIsActive(true); }); @@ -106,7 +106,7 @@ suite( chai.assert.isFalse(await isKeyboardNavigating(this.browser)); - this.browser.execute(() => { + await this.browser.execute(() => { Blockly.keyboardNavigationController.setIsActive(true); }); @@ -126,7 +126,7 @@ suite( await this.browser.pause(PAUSE_TIME); // Right click a block - clickBlock(this.browser, 'controls_if_1', {button: 'right'}); + await clickBlock(this.browser, 'controls_if_1', {button: 'right'}); await this.browser.pause(PAUSE_TIME); chai.assert.isFalse(await isKeyboardNavigating(this.browser)); diff --git a/test/webdriverio/test/scroll_test.ts b/test/webdriverio/test/scroll_test.ts index c198ff1a..305ca31c 100644 --- a/test/webdriverio/test/scroll_test.ts +++ b/test/webdriverio/test/scroll_test.ts @@ -24,7 +24,7 @@ suite('Scrolling into view', function () { setup(async function () { this.browser = await testSetup(testFileLocations.BASE); // Predictable small window size for scrolling. - this.browser.setWindowSize(800, 600); + await this.browser.setWindowSize(800, 600); await this.browser.pause(PAUSE_TIME); }); diff --git a/test/webdriverio/test/test_setup.ts b/test/webdriverio/test/test_setup.ts index 497e4796..e5d47aa7 100644 --- a/test/webdriverio/test/test_setup.ts +++ b/test/webdriverio/test/test_setup.ts @@ -441,10 +441,10 @@ export async function tabNavigateToWorkspace( hasFlyout = true, ) { // Navigate past the initial pre-injection focusable div element. - tabNavigateForward(browser); - if (hasToolbox) tabNavigateForward(browser); - if (hasFlyout) tabNavigateForward(browser); - tabNavigateForward(browser); // Tab to the workspace itself. + await tabNavigateForward(browser); + if (hasToolbox) await tabNavigateForward(browser); + if (hasFlyout) await tabNavigateForward(browser); + await tabNavigateForward(browser); // Tab to the workspace itself. } /** diff --git a/test/webdriverio/test/workspace_comment_test.ts b/test/webdriverio/test/workspace_comment_test.ts index 82d6fe12..eb882e27 100644 --- a/test/webdriverio/test/workspace_comment_test.ts +++ b/test/webdriverio/test/workspace_comment_test.ts @@ -7,7 +7,6 @@ import * as chai from 'chai'; import * as Blockly from 'blockly'; import { - contextMenuExists, focusOnBlock, getCurrentFocusNodeId, getFocusedBlockType,