From d6a2772422f16f80deea600888fa90350a20fd6c Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 19 Aug 2025 14:14:37 +0100 Subject: [PATCH] refactor(tests): Remove unneeded tabNavigateToWorkspace calls The focusOnBlock function moves focus to the workspace regardless of where it was previously, so there's no need to call tabNavigateToWorkspace first. --- test/webdriverio/test/duplicate_test.ts | 1 - test/webdriverio/test/insert_test.ts | 2 -- test/webdriverio/test/move_test.ts | 4 ---- test/webdriverio/test/mutator_test.ts | 3 --- test/webdriverio/test/styling_test.ts | 3 --- 5 files changed, 13 deletions(-) diff --git a/test/webdriverio/test/duplicate_test.ts b/test/webdriverio/test/duplicate_test.ts index 93e33a4c..8498d32b 100644 --- a/test/webdriverio/test/duplicate_test.ts +++ b/test/webdriverio/test/duplicate_test.ts @@ -29,7 +29,6 @@ suite('Duplicate test', function () { test('Duplicate block', async function () { // Navigate to draw_circle_1. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'draw_circle_1'); // Duplicate diff --git a/test/webdriverio/test/insert_test.ts b/test/webdriverio/test/insert_test.ts index e2305f97..bf22f8f9 100644 --- a/test/webdriverio/test/insert_test.ts +++ b/test/webdriverio/test/insert_test.ts @@ -34,7 +34,6 @@ suite('Insert test', function () { test('Insert and cancel with block selection', async function () { // Navigate to draw_circle_1. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'draw_circle_1'); // Insert 'if' block await sendKeyAndWait(this.browser, 't'); @@ -70,7 +69,6 @@ suite('Insert test', function () { test('Insert C-shaped block with statement block selected', async function () { // Navigate to draw_circle_1. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'draw_circle_1'); await moveToToolboxCategory(this.browser, 'Functions'); diff --git a/test/webdriverio/test/move_test.ts b/test/webdriverio/test/move_test.ts index 9de0ee19..a32e34e7 100644 --- a/test/webdriverio/test/move_test.ts +++ b/test/webdriverio/test/move_test.ts @@ -10,7 +10,6 @@ import {Browser, Key} from 'webdriverio'; import { PAUSE_TIME, focusOnBlock, - tabNavigateToWorkspace, testFileLocations, testSetup, sendKeyAndWait, @@ -36,7 +35,6 @@ suite('Move tests', function () { test('Start moving statement blocks', async function () { for (let i = 1; i < 7; i++) { // Navigate to statement_. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, `statement_${i}`); // Get information about parent connection of selected block, @@ -96,7 +94,6 @@ suite('Move tests', function () { test('Start moving value blocks', async function () { for (let i = 1; i < 7; i++) { // Navigate to statement_. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, `value_${i}`); // Get information about parent connection of selected block, @@ -166,7 +163,6 @@ suite('Move tests', function () { }); // Navigate to unconnectable block, get initial coords and start move. - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, BLOCK); const startCoordinate = await getCoordinate(this.browser, BLOCK); await sendKeyAndWait(this.browser, 'm'); diff --git a/test/webdriverio/test/mutator_test.ts b/test/webdriverio/test/mutator_test.ts index 3e03c576..0d106e16 100644 --- a/test/webdriverio/test/mutator_test.ts +++ b/test/webdriverio/test/mutator_test.ts @@ -14,7 +14,6 @@ import { testSetup, testFileLocations, PAUSE_TIME, - tabNavigateToWorkspace, sendKeyAndWait, keyRight, keyDown, @@ -29,8 +28,6 @@ suite('Mutator navigation', function () { setup(async function () { this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS); this.openMutator = async () => { - await tabNavigateToWorkspace(this.browser); - await this.browser.pause(PAUSE_TIME); await focusOnBlock(this.browser, 'controls_if_1'); await this.browser.pause(PAUSE_TIME); // Navigate to the mutator icon diff --git a/test/webdriverio/test/styling_test.ts b/test/webdriverio/test/styling_test.ts index c2153f27..f226a5a5 100644 --- a/test/webdriverio/test/styling_test.ts +++ b/test/webdriverio/test/styling_test.ts @@ -81,7 +81,6 @@ suite('Styling test', function () { }); test('Workspace has only active tree style when move is in progress', async function () { - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'set_background_color_1'); // Moves block to drag layer which requires different selectors. await sendKeyAndWait(this.browser, 'm'); @@ -91,7 +90,6 @@ suite('Styling test', function () { }); test('Workspace has only active tree style when widget has focus', async function () { - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'create_canvas_1'); // Move to field. await keyRight(this.browser); @@ -103,7 +101,6 @@ suite('Styling test', function () { }); test('Workspace has only active tree style when dropdown has focus', async function () { - await tabNavigateToWorkspace(this.browser); await focusOnBlock(this.browser, 'set_background_color_1'); // Move to color block. await keyRight(this.browser);