Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
8101a16
fix: Fix failing NPM build.
BenHenning Nov 20, 2025
b85a4b1
chore: Disable workflows for investigation.
BenHenning Nov 20, 2025
8859f98
chore: Debug & disable test for investigation.
BenHenning Nov 20, 2025
ae9ee30
chore: More investigation work.
BenHenning Nov 20, 2025
27785c6
chore: Clean up test & re-enable all.
BenHenning Nov 20, 2025
d5497fe
chore: Try upgrading WebdriverIO.
BenHenning Nov 20, 2025
3d7c478
Merge branch 'main' into update-npm-lock-file
BenHenning Nov 21, 2025
75d0c73
Merge branch 'update-npm-lock-file' into attempt-to-fix-mac-tests
BenHenning Nov 21, 2025
8d56eba
chore: Re-isolate scroll test.
BenHenning Nov 21, 2025
af1dbaa
chore: Add more debug logs.
BenHenning Nov 21, 2025
2e210fe
chore: Run tests up to 50 times.
BenHenning Nov 21, 2025
2187b2c
chore: Speed & reduce tests for CI investigating.
BenHenning Nov 21, 2025
dabaad5
chore: Fix path changing.
BenHenning Nov 21, 2025
4b97659
chore: Remove debug logs to test theory.
BenHenning Nov 21, 2025
cefb286
chore: Try to remove more logs.
BenHenning Nov 21, 2025
28a32f4
chore: Try adding a pause.
BenHenning Nov 21, 2025
059092f
chore: Add comment & enable most tests.
BenHenning Nov 21, 2025
531979e
chore: Re-add removed comment.
BenHenning Nov 21, 2025
efecfd9
chore: Re-add logs for investigation.
BenHenning Nov 21, 2025
1e96c0a
chore: Undo accidental test isolation.
BenHenning Nov 21, 2025
7c607d1
chore: More logs.
BenHenning Nov 21, 2025
385b562
chore: Undo pause.
BenHenning Nov 21, 2025
bfe5ea6
chore: Re-enable most tests.
BenHenning Nov 21, 2025
7e2035e
chore: More logs.
BenHenning Nov 21, 2025
c82a486
chore: More logs.
BenHenning Nov 21, 2025
4fb876c
chore: More logs.
BenHenning Nov 21, 2025
75a8bc8
chore: Use correct parent.
BenHenning Nov 21, 2025
4b4c842
chore: Try to 'jiggle' block.
BenHenning Nov 21, 2025
2cc7478
chore: Try using pause time.
BenHenning Nov 21, 2025
27b375f
feat: Record & upload test failures in CI.
BenHenning Nov 21, 2025
ffed2d1
chore: Remove pause timeout.
BenHenning Nov 21, 2025
b0ef7f9
chore: Hopefully fix screenshots in CI.
BenHenning Nov 21, 2025
c757c64
chore: Add missing 'cd'.
BenHenning Nov 21, 2025
cb6f91f
chore: Fix artifact path.
BenHenning Nov 21, 2025
d44fec2
chore: Add position log.
BenHenning Dec 1, 2025
a8845c8
chore: Attempt to disable BiDi again.
BenHenning Dec 1, 2025
e850385
chore: Fix syntax error.
BenHenning Dec 1, 2025
f8039b4
chore: More logs on relative position.
BenHenning Dec 1, 2025
1d3b366
chore: Fix test.
BenHenning Dec 1, 2025
ed9d2db
chore: Add more to log.
BenHenning Dec 1, 2025
f504532
chore: Try adding a long pause.
BenHenning Dec 1, 2025
6ee17d7
chore: Add another log statement.
BenHenning Dec 1, 2025
7023e09
chore: Fix log output.
BenHenning Dec 1, 2025
bba3633
chore: Add additional screenshot.
BenHenning Dec 1, 2025
d731e9e
Merge branch 'main' into attempt-to-fix-mac-tests
BenHenning Dec 1, 2025
5c505a1
chore: Restore PAUSE_TIME.
BenHenning Dec 1, 2025
cc40d71
chore: Attempt at synchronizing.
BenHenning Dec 2, 2025
14a2a3c
chore: Attempt to pretend to be JavaFX.
BenHenning Dec 2, 2025
c7a5087
chore: Attempt to use --headless=new.
BenHenning Dec 2, 2025
3542de5
chore: Restore headless, and add force rendering.
BenHenning Dec 3, 2025
11080fd
chore: Use idle() more broadly.
BenHenning Dec 3, 2025
e0a0594
chore: Some more controls for better inspection.
BenHenning Dec 3, 2025
db03a10
chore: Speed up test & force rendering.
BenHenning Dec 5, 2025
04325d1
fix: Use correct branch after rename.
BenHenning Dec 5, 2025
3b6c99e
chore: Re-enable non-scroll tests.
BenHenning Dec 5, 2025
d5fcc1d
chore: Re-enable tests & some cleanups.
BenHenning Dec 5, 2025
661b4fe
chore: Undo all package lock changes.
BenHenning Dec 5, 2025
587ddbf
chore: Undo lots of logs.
BenHenning Dec 5, 2025
4b4dd48
fix: Fix failing tests by adding config support.
BenHenning Dec 5, 2025
5bf1ac7
chore: Re-enable move tests.
BenHenning Dec 5, 2025
52b7aed
chore: Try to isolate failing test.
BenHenning Dec 5, 2025
9986e9c
chore: Run all move tests.
BenHenning Dec 5, 2025
efb5b7d
chore: Re-enable previous tests to move.
BenHenning Dec 5, 2025
8499089
chore: Skip some of the earlier suites.
BenHenning Dec 5, 2025
3a26ac5
chore: Re-disable more suites.
BenHenning Dec 5, 2025
4d2a86e
chore: Re-enable one suite.
BenHenning Dec 5, 2025
2750f66
chore: Try re-disabling other suites.
BenHenning Dec 5, 2025
c8e3728
chore: Try re-disabling big suite.
BenHenning Dec 5, 2025
eceb74f
chore: Isolate to just 2 suites.
BenHenning Dec 5, 2025
adc0c98
chore: Drop inner suite.
BenHenning Dec 5, 2025
f015528
chore: Disable first 8 & re-add sub-suite.
BenHenning Dec 5, 2025
a213520
chore: Skip remaining tests.
BenHenning Dec 5, 2025
cf3b5c4
chore: Disable immediate previous test.
BenHenning Dec 5, 2025
c8743df
chore: Swap disabled tests.
BenHenning Dec 5, 2025
0895aaf
chore: Try disabling alert dialog assertion.
BenHenning Dec 5, 2025
e561389
chore: Don't open alert dialog.
BenHenning Dec 5, 2025
df7324a
chore: Re-open alert. Reduce previous test.
BenHenning Dec 5, 2025
f7e7479
chore: Try reducing failing test.
BenHenning Dec 5, 2025
caf02c8
chore: Attempt WDIO upgrade.
BenHenning Dec 5, 2025
ff5ba58
Revert "chore: Attempt WDIO upgrade."
BenHenning Dec 5, 2025
339667e
chore: Add cross-suite session reloading in CI.
BenHenning Dec 5, 2025
69896a2
chore: Re-enable all suites and tests.
BenHenning Dec 5, 2025
1122f65
chore: Re-enable Ubuntu tests in CI.
BenHenning Dec 5, 2025
e407c73
chore: Increase timeouts.
BenHenning Dec 5, 2025
1411d90
chore: Run tests 50 times in CI.
BenHenning Dec 5, 2025
65e6c02
fix: Make mkdir resilient for multiple runs.
BenHenning Dec 5, 2025
be86fd2
chore: Prepare branch for review.
BenHenning Dec 8, 2025
3589c6d
Merge branch 'main' into attempt-to-fix-mac-tests
BenHenning Dec 8, 2025
a3c7f78
fix: Fix broken artifact upload on failure.
BenHenning Dec 9, 2025
96738ec
fix: Fix broken scroll test.
BenHenning Dec 9, 2025
ceea30e
chore: Lint fixes.
BenHenning Dec 9, 2025
7f4b4fe
chore: Comment fixes to address reviewer comments.
BenHenning Dec 10, 2025
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
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ jobs:
cd main
npm run test:ci

- name: Upload test failure screenshots
if: always()
uses: actions/upload-artifact@v5
with:
name: test-failure-screenshots-${{ matrix.os }}
path: main/test/webdriverio/test/failures

webdriverio_tests:
name: WebdriverIO tests (against pinned v12)
# Don't run pinned version checks for PRs.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build-debug.log
node_modules/
build/
dist/
test/webdriverio/test/failures/
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"wdio:build": "npm run wdio:build:app && npm run wdio:build:tests",
"wdio:build:app": "cd test/webdriverio && webpack",
"wdio:build:tests": "tsc -p ./test/webdriverio/test/tsconfig.json",
"wdio:clean": "cd test/webdriverio/test && rm -rf dist",
"wdio:run": "npm run wdio:build && cd test/webdriverio/test && npx mocha dist",
"wdio:run:ci": "npm run wdio:build && cd test/webdriverio/test && npx mocha --timeout 30000 dist"
"wdio:clean": "cd test/webdriverio/test && rm -rf dist && rm -rf failures",
"wdio:run": "npm run wdio:build && cd test/webdriverio/test && mkdir -p failures && npx mocha dist",
"wdio:run:ci": "npm run wdio:build && cd test/webdriverio/test && mkdir -p failures && npx mocha --timeout 30000 dist"
},
"main": "./dist/index.js",
"module": "./src/index.js",
Expand Down
30 changes: 20 additions & 10 deletions test/webdriverio/test/actions_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
sendKeyAndWait,
keyRight,
contextMenuItems,
checkForFailures,
pause,
} from './test_setup.js';

const isDarwin = process.platform === 'darwin';
Expand Down Expand Up @@ -96,13 +98,21 @@ suite('Menus test', function () {
testFileLocations.MORE_BLOCKS,
this.timeout(),
);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
});

teardown(async function () {
await checkForFailures(
this.browser,
this.currentTest?.title,
this.currentTest?.state,
);
});

test('Menu action via keyboard on block opens menu', async function () {
// Navigate to draw_circle_1.
await focusOnBlock(this.browser, 'draw_circle_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await sendKeyAndWait(this.browser, [Key.Ctrl, Key.Return]);

chai.assert.deepEqual(
Expand All @@ -126,7 +136,7 @@ suite('Menus test', function () {
await focusOnBlock(this.browser, 'text_print_1');
await this.browser.keys(Key.ArrowRight);
await this.browser.keys([Key.Ctrl, Key.Return]);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);

chai.assert.deepEqual(
await contextMenuItems(this.browser),
Expand Down Expand Up @@ -154,9 +164,9 @@ suite('Menus test', function () {
await moveToToolboxCategory(this.browser, 'Math');
// Move to flyout.
await keyRight(this.browser);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await rightClickOnFlyoutBlockType(this.browser, 'math_number');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);

chai.assert.deepEqual(
await contextMenuItems(this.browser),
Expand Down Expand Up @@ -192,11 +202,11 @@ suite('Menus test', function () {
test('Escape key dismisses menu', async function () {
await tabNavigateToWorkspace(this.browser);
await focusOnBlock(this.browser, 'draw_circle_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await this.browser.keys([Key.Ctrl, Key.Return]);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await this.browser.keys(Key.Escape);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);

chai.assert.isTrue(
await contextMenuExists(this.browser, 'Duplicate', /* reverse= */ true),
Expand All @@ -207,9 +217,9 @@ suite('Menus test', function () {
test('Clicking workspace dismisses menu', async function () {
await tabNavigateToWorkspace(this.browser);
await clickBlock(this.browser, 'draw_circle_1', {button: 'right'});
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await focusWorkspace(this.browser);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);

chai.assert.isTrue(
await contextMenuExists(this.browser, 'Duplicate', /* reverse= */ true),
Expand Down
66 changes: 42 additions & 24 deletions test/webdriverio/test/basic_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
keyRight,
keyUp,
keyDown,
checkForFailures,
pause,
} from './test_setup.js';
import {Key} from 'webdriverio';

Expand All @@ -37,6 +39,14 @@ suite('Keyboard navigation on Blocks', function () {
);
});

teardown(async function () {
await checkForFailures(
this.browser,
this.currentTest?.title,
this.currentTest?.state,
);
});

test('Default workspace', async function () {
const blockCount = await this.browser.execute(() => {
return Blockly.getMainWorkspace().getAllBlocks(false).length;
Expand All @@ -47,7 +57,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Selected block', async function () {
await tabNavigateToWorkspace(this.browser);
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);

await keyDown(this.browser, 14);

Expand All @@ -58,7 +68,7 @@ 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 pause(this.browser);
await keyDown(this.browser);

chai
Expand All @@ -68,7 +78,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Up from statement block selects previous block', async function () {
await focusOnBlock(this.browser, 'simple_circle_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyUp(this.browser);

chai
Expand All @@ -78,7 +88,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Down from parent block selects first child block', async function () {
await focusOnBlock(this.browser, 'p5_setup_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyDown(this.browser);
chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand All @@ -87,7 +97,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Up from child block selects parent block', async function () {
await focusOnBlock(this.browser, 'p5_canvas_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyUp(this.browser);
chai
.expect(await getCurrentFocusedBlockId(this.browser))
Expand All @@ -96,7 +106,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Right from block selects first field', async function () {
await focusOnBlock(this.browser, 'p5_canvas_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyRight(this.browser);

chai
Expand All @@ -108,7 +118,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Right from block selects first inline input', async function () {
await focusOnBlock(this.browser, 'simple_circle_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyRight(this.browser);

chai.assert.equal(
Expand All @@ -119,7 +129,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Up from inline input selects statement block', async function () {
await focusOnBlock(this.browser, 'math_number_2');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyUp(this.browser);

chai.assert.equal(
Expand All @@ -130,7 +140,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Left from first inline input selects block', async function () {
await focusOnBlock(this.browser, 'math_number_2');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyLeft(this.browser);

chai.assert.equal(
Expand All @@ -141,7 +151,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Right from first inline input selects second inline input', async function () {
await focusOnBlock(this.browser, 'math_number_2');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyRight(this.browser);

chai.assert.equal(
Expand All @@ -152,7 +162,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Left from second inline input selects first inline input', async function () {
await focusOnBlock(this.browser, 'math_number_3');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyLeft(this.browser);

chai.assert.equal(
Expand All @@ -163,7 +173,7 @@ 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 pause(this.browser);
await keyRight(this.browser);

chai
Expand All @@ -173,7 +183,7 @@ 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 pause(this.browser);
await keyDown(this.browser);

chai
Expand All @@ -183,7 +193,7 @@ suite('Keyboard navigation on Blocks', function () {

test("Down from inline input selects block's child block", async function () {
await focusOnBlock(this.browser, 'logic_boolean_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyDown(this.browser);

chai
Expand All @@ -193,7 +203,7 @@ suite('Keyboard navigation on Blocks', function () {

test('Right from text block selects shadow block then field', async function () {
await focusOnBlock(this.browser, 'text_print_1');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyRight(this.browser);

chai.assert.equal(await getCurrentFocusedBlockId(this.browser), 'text_1');
Expand Down Expand Up @@ -235,9 +245,17 @@ suite('Keyboard navigation on Fields', function () {
);
});

teardown(async function () {
await checkForFailures(
this.browser,
this.currentTest?.title,
this.currentTest?.state,
);
});

test('Up from first field selects block', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'WIDTH');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyUp(this.browser);

chai.assert.equal(
Expand All @@ -248,7 +266,7 @@ suite('Keyboard navigation on Fields', function () {

test('Left from first field selects block', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'WIDTH');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyLeft(this.browser);

chai.assert.equal(
Expand All @@ -259,7 +277,7 @@ suite('Keyboard navigation on Fields', function () {

test('Right from first field selects second field', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'WIDTH');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyRight(this.browser);

chai
Expand All @@ -271,7 +289,7 @@ suite('Keyboard navigation on Fields', function () {

test('Left from second field selects first field', async function () {
await focusOnBlockField(this.browser, 'p5_canvas_1', 'HEIGHT');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyLeft(this.browser);

chai
Expand All @@ -283,7 +301,7 @@ 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 pause(this.browser);
await keyRight(this.browser);

chai
Expand All @@ -293,7 +311,7 @@ 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 pause(this.browser);
await keyDown(this.browser);

chai
Expand All @@ -303,7 +321,7 @@ suite('Keyboard navigation on Fields', function () {

test("Down from field selects block's child block", async function () {
await focusOnBlockField(this.browser, 'controls_repeat_1', 'TIMES');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await keyDown(this.browser);

chai
Expand All @@ -314,7 +332,7 @@ suite('Keyboard navigation on Fields', function () {
test('Do not navigate while field editor is open', async function () {
// Open a field editor dropdown
await focusOnBlockField(this.browser, 'logic_boolean_1', 'BOOL');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await sendKeyAndWait(this.browser, Key.Enter);

// Try to navigate to a different block
Expand All @@ -327,7 +345,7 @@ suite('Keyboard navigation on Fields', function () {
test('Do not reopen field editor when handling enter to make a choice inside the editor', async function () {
// Open colour picker
await focusOnBlockField(this.browser, 'colour_picker_1', 'COLOUR');
await this.browser.pause(PAUSE_TIME);
await pause(this.browser);
await sendKeyAndWait(this.browser, Key.Enter);

// Move right to pick a new colour.
Expand Down
9 changes: 9 additions & 0 deletions test/webdriverio/test/block_comment_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
testFileLocations,
keyRight,
PAUSE_TIME,
checkForFailures,
} from './test_setup.js';
import {Key} from 'webdriverio';

Expand All @@ -34,6 +35,14 @@ suite('Block comment navigation', function () {
});
});

teardown(async function () {
await checkForFailures(
this.browser,
this.currentTest?.title,
this.currentTest?.state,
);
});

test('Activating a block comment icon focuses the comment', async function () {
await focusOnBlock(this.browser, 'p5_canvas_1');
await keyRight(this.browser);
Expand Down
Loading
Loading