Skip to content

Commit de93f58

Browse files
committed
fix: Improve test robustness.
1 parent 7a67273 commit de93f58

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/webdriverio/test/basic_test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,10 @@ suite('Keyboard navigation on Fields', function () {
405405
await focusOnBlock(this.browser, 'logic_boolean_1');
406406
// Select the field.
407407
await keyRight(this.browser);
408-
// Open the field's editor.
408+
// Open the field's editor and select the first option to give a child of
409+
// the editor focus.
409410
await sendKeyAndWait(this.browser, Key.Enter);
411+
await keyDown(this.browser);
410412

411413
// Exit the editor.
412414
await sendKeyAndWait(this.browser, Key.Escape);

test/webdriverio/test/test_setup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,9 @@ export async function getFocusedFieldName(
398398
browser: WebdriverIO.Browser,
399399
): Promise<string | undefined> {
400400
return await browser.execute(() => {
401-
const field = Blockly.getFocusManager().getFocusedNode() as Blockly.Field;
402-
return field.name;
401+
const field =
402+
Blockly.getFocusManager().getFocusedNode() as Blockly.Field | null;
403+
return field?.name;
403404
});
404405
}
405406

0 commit comments

Comments
 (0)