Skip to content

Commit 09cb7f1

Browse files
committed
chore: add assert to make sure context menu is selected
1 parent 681ad1a commit 09cb7f1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/webdriverio/test/move_test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,17 @@ suite('Move start tests', function () {
124124

125125
// Start move using context menu (using keyboard nav).
126126
await sendKeyAndWait(this.browser, [Key.Ctrl, Key.Return]);
127-
await keyDown(
128-
this.browser,
129-
(await contextMenuItems(this.browser)).findIndex(({text}) =>
130-
text.includes('Move'),
131-
),
127+
128+
// Find how many times to press the down arrow
129+
const index = (await contextMenuItems(this.browser)).findIndex(({text}) =>
130+
text.includes('Move'),
131+
);
132+
chai.assert.isAbove(
133+
index,
134+
-1,
135+
'expected Move to appear in context menu items',
132136
);
137+
await keyDown(this.browser, index);
133138
await sendKeyAndWait(this.browser, Key.Return);
134139

135140
// Check that the moving block has nothing connected it its

0 commit comments

Comments
 (0)