Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions test/webdriverio/test/basic_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ suite('Keyboard navigation on Blocks', function () {
await tabNavigateToWorkspace(this.browser);
await this.browser.pause(PAUSE_TIME);

await keyDown(this.browser, 14);
await keyDown(this.browser, 22);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand All @@ -59,7 +59,9 @@ suite('Keyboard navigation on Blocks', function () {
test('Down from statement block selects next block across stacks', async function () {
await focusOnBlock(this.browser, 'p5_canvas_1');
await this.browser.pause(PAUSE_TIME);
await keyDown(this.browser);
// Key down twice; the first down moves to the next connection on the
// selected block.
await keyDown(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand Down Expand Up @@ -164,7 +166,9 @@ suite('Keyboard navigation on Blocks', function () {
test('Right from last inline input selects next block', async function () {
await focusOnBlock(this.browser, 'colour_picker_1');
await this.browser.pause(PAUSE_TIME);
await keyRight(this.browser);
// Go right twice; first one selects the next connection on the colour
// picker's parent block.
await keyRight(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand All @@ -174,7 +178,9 @@ suite('Keyboard navigation on Blocks', function () {
test('Down from inline input selects next block', async function () {
await focusOnBlock(this.browser, 'colour_picker_1');
await this.browser.pause(PAUSE_TIME);
await keyDown(this.browser);
// Go down twice; first one selects the next connection on the colour
// picker's parent block.
await keyDown(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand Down Expand Up @@ -204,7 +210,8 @@ suite('Keyboard navigation on Blocks', function () {
.expect(await getCurrentFocusNodeId(this.browser))
.to.include('text_1_field_');

await keyRight(this.browser);
// Go right twice; first one selects the next connection on the print block.
await keyRight(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand Down Expand Up @@ -284,7 +291,9 @@ suite('Keyboard navigation on Fields', function () {
test('Right from second field selects next block', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'HEIGHT');
await this.browser.pause(PAUSE_TIME);
await keyRight(this.browser);
// Go right twice; first one selects the next connection on the create
// canvas block.
await keyRight(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand All @@ -294,7 +303,9 @@ suite('Keyboard navigation on Fields', function () {
test('Down from field selects next block', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'WIDTH');
await this.browser.pause(PAUSE_TIME);
await keyDown(this.browser);
// Go down twice; first one selects the next connection on the create
// canvas block.
await keyDown(this.browser, 2);

chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand Down
2 changes: 1 addition & 1 deletion test/webdriverio/test/flyout_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ suite('Toolbox and flyout test', function () {
await tabNavigateToWorkspace(this.browser);

// Note that two tabs are needed here to move past the flyout.
await keyDown(this.browser, 3);
await keyDown(this.browser, 4);
await tabNavigateBackward(this.browser);
await tabNavigateForward(this.browser);
await tabNavigateForward(this.browser);
Expand Down
14 changes: 8 additions & 6 deletions test/webdriverio/test/stack_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ suite('Stack navigation', function () {
await getCurrentFocusNodeId(this.browser),
);
await sendKeyAndWait(this.browser, 'b');
chai.assert.equal(
'p5_draw_1',
await getCurrentFocusedBlockId(this.browser),
chai.assert.isTrue(
(await getCurrentFocusNodeId(this.browser))?.startsWith(
'draw_circle_2_connection',
),
);
await sendKeyAndWait(this.browser, 'b');
chai.assert.equal(
'p5_setup_1',
await getCurrentFocusedBlockId(this.browser),
chai.assert.isTrue(
(await getCurrentFocusNodeId(this.browser))?.startsWith(
'set_background_color_1_connection',
),
);
});
});
6 changes: 4 additions & 2 deletions test/webdriverio/test/workspace_comment_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ suite('Workspace comment navigation', function () {

test('Navigate forward from block to workspace comment', async function () {
await focusOnBlock(this.browser, 'p5_canvas_1');
await keyDown(this.browser);
// Key down twice; the first focuses the block's next connection.
await keyDown(this.browser, 2);
const focusedNodeId = await getCurrentFocusNodeId(this.browser);
chai.assert.equal(focusedNodeId, this.commentId1);
});
Expand All @@ -92,7 +93,8 @@ suite('Workspace comment navigation', function () {

test('Navigate backward from workspace comment to block', async function () {
await focusOnWorkspaceComment(this.browser, this.commentId1);
await keyUp(this.browser);
// Key up twice; the first focuses the block's next connection.
await keyUp(this.browser, 2);
const focusedBlock = await getFocusedBlockType(this.browser);
chai.assert.equal(focusedBlock, 'p5_canvas');
});
Expand Down