Skip to content

Commit ec703af

Browse files
authored
refactor(tests): Remove unneeded tabNavigateToWorkspace calls (#701)
The focusOnBlock function moves focus to the workspace regardless of where it was previously, so there's no need to call tabNavigateToWorkspace first.
1 parent e438ba7 commit ec703af

File tree

5 files changed

+0
-13
lines changed

5 files changed

+0
-13
lines changed

test/webdriverio/test/duplicate_test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ suite('Duplicate test', function () {
2929

3030
test('Duplicate block', async function () {
3131
// Navigate to draw_circle_1.
32-
await tabNavigateToWorkspace(this.browser);
3332
await focusOnBlock(this.browser, 'draw_circle_1');
3433

3534
// Duplicate

test/webdriverio/test/insert_test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ suite('Insert test', function () {
3434

3535
test('Insert and cancel with block selection', async function () {
3636
// Navigate to draw_circle_1.
37-
await tabNavigateToWorkspace(this.browser);
3837
await focusOnBlock(this.browser, 'draw_circle_1');
3938
// Insert 'if' block
4039
await sendKeyAndWait(this.browser, 't');
@@ -70,7 +69,6 @@ suite('Insert test', function () {
7069

7170
test('Insert C-shaped block with statement block selected', async function () {
7271
// Navigate to draw_circle_1.
73-
await tabNavigateToWorkspace(this.browser);
7472
await focusOnBlock(this.browser, 'draw_circle_1');
7573

7674
await moveToToolboxCategory(this.browser, 'Functions');

test/webdriverio/test/move_test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {Browser, Key} from 'webdriverio';
1010
import {
1111
PAUSE_TIME,
1212
focusOnBlock,
13-
tabNavigateToWorkspace,
1413
testFileLocations,
1514
testSetup,
1615
sendKeyAndWait,
@@ -36,7 +35,6 @@ suite('Move tests', function () {
3635
test('Start moving statement blocks', async function () {
3736
for (let i = 1; i < 7; i++) {
3837
// Navigate to statement_<i>.
39-
await tabNavigateToWorkspace(this.browser);
4038
await focusOnBlock(this.browser, `statement_${i}`);
4139

4240
// Get information about parent connection of selected block,
@@ -96,7 +94,6 @@ suite('Move tests', function () {
9694
test('Start moving value blocks', async function () {
9795
for (let i = 1; i < 7; i++) {
9896
// Navigate to statement_<i>.
99-
await tabNavigateToWorkspace(this.browser);
10097
await focusOnBlock(this.browser, `value_${i}`);
10198

10299
// Get information about parent connection of selected block,
@@ -166,7 +163,6 @@ suite('Move tests', function () {
166163
});
167164

168165
// Navigate to unconnectable block, get initial coords and start move.
169-
await tabNavigateToWorkspace(this.browser);
170166
await focusOnBlock(this.browser, BLOCK);
171167
const startCoordinate = await getCoordinate(this.browser, BLOCK);
172168
await sendKeyAndWait(this.browser, 'm');

test/webdriverio/test/mutator_test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
testSetup,
1515
testFileLocations,
1616
PAUSE_TIME,
17-
tabNavigateToWorkspace,
1817
sendKeyAndWait,
1918
keyRight,
2019
keyDown,
@@ -29,8 +28,6 @@ suite('Mutator navigation', function () {
2928
setup(async function () {
3029
this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS);
3130
this.openMutator = async () => {
32-
await tabNavigateToWorkspace(this.browser);
33-
await this.browser.pause(PAUSE_TIME);
3431
await focusOnBlock(this.browser, 'controls_if_1');
3532
await this.browser.pause(PAUSE_TIME);
3633
// Navigate to the mutator icon

test/webdriverio/test/styling_test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ suite('Styling test', function () {
8181
});
8282

8383
test('Workspace has only active tree style when move is in progress', async function () {
84-
await tabNavigateToWorkspace(this.browser);
8584
await focusOnBlock(this.browser, 'set_background_color_1');
8685
// Moves block to drag layer which requires different selectors.
8786
await sendKeyAndWait(this.browser, 'm');
@@ -91,7 +90,6 @@ suite('Styling test', function () {
9190
});
9291

9392
test('Workspace has only active tree style when widget has focus', async function () {
94-
await tabNavigateToWorkspace(this.browser);
9593
await focusOnBlock(this.browser, 'create_canvas_1');
9694
// Move to field.
9795
await keyRight(this.browser);
@@ -103,7 +101,6 @@ suite('Styling test', function () {
103101
});
104102

105103
test('Workspace has only active tree style when dropdown has focus', async function () {
106-
await tabNavigateToWorkspace(this.browser);
107104
await focusOnBlock(this.browser, 'set_background_color_1');
108105
// Move to color block.
109106
await keyRight(this.browser);

0 commit comments

Comments
 (0)