Skip to content

Commit 48d2da2

Browse files
committed
test(MoveActions): Test starting move using keyboard shortcuts
Fixes #695.
1 parent 7991855 commit 48d2da2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/webdriverio/test/move_test.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
testSetup,
1616
sendKeyAndWait,
1717
keyDown,
18+
contextMenuItems,
1819
} from './test_setup.js';
1920

2021
suite('Move tests', function () {
@@ -33,6 +34,8 @@ suite('Move tests', function () {
3334
// moved, with subsequent statement blocks below it in the stack
3435
// reattached to where the moving block was - i.e., that a stack
3536
// heal will occur.
37+
//
38+
// Also tests initating a move using the shortcut key.
3639
test('Start moving statement blocks', async function () {
3740
for (let i = 1; i < 7; i++) {
3841
// Navigate to statement_<i>.
@@ -50,7 +53,7 @@ suite('Move tests', function () {
5053
);
5154
chai.assert(info.nextId, 'selected block has no next block');
5255

53-
// Start move.
56+
// Start move using keyboard shortcut.
5457
await sendKeyAndWait(this.browser, 'm');
5558

5659
// Check that the moving block has nothing connected it its
@@ -93,6 +96,8 @@ suite('Move tests', function () {
9396
// When a move of a value block begins, it is expected that block
9497
// and all blocks connected to its inputs will be moved - i.e., that
9598
// a stack heal (really: unary operator chain heal) will NOT occur.
99+
//
100+
// Also tests initiating a move via the context menu.
96101
test('Start moving value blocks', async function () {
97102
for (let i = 1; i < 7; i++) {
98103
// Navigate to statement_<i>.
@@ -110,8 +115,16 @@ suite('Move tests', function () {
110115
);
111116
chai.assert(info.valueId, 'selected block has no child value block');
112117

113-
// Start move.
118+
// Start move using context menu (using keyboard nav).
119+
await sendKeyAndWait(this.browser, [Key.Ctrl, Key.Return]);
114120
await sendKeyAndWait(this.browser, 'm');
121+
await keyDown(
122+
this.browser,
123+
(await contextMenuItems(this.browser)).findIndex(({text}) =>
124+
text.includes('Move'),
125+
),
126+
);
127+
await sendKeyAndWait(this.browser, Key.Return);
115128

116129
// Check that the moving block has nothing connected it its
117130
// next/previous connections, and same thing connected to value

0 commit comments

Comments
 (0)