Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor issues in browser tests #7493

Merged
merged 1 commit into from
Sep 18, 2023
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
7 changes: 4 additions & 3 deletions tests/browser/test/delete_blocks_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ suite('Delete blocks', function (done) {
await this.browser.keys([Key.Backspace]);
await this.browser.pause(PAUSE_TIME);
// Undo
await this.browser.keys([Key.Ctrl, 'Z']);
await this.browser.keys([Key.Ctrl, 'z']);
await this.browser.pause(PAUSE_TIME);
const after = (await getAllBlocks(this.browser)).length;
chai.assert.equal(
before,
Expand All @@ -195,10 +196,10 @@ suite('Delete blocks', function (done) {
await this.browser.keys([Key.Backspace]);
await this.browser.pause(PAUSE_TIME);
// Undo
await this.browser.keys([Key.Ctrl, 'Z']);
await this.browser.keys([Key.Ctrl, 'z']);
await this.browser.pause(PAUSE_TIME);
// Redo
await this.browser.keys([Key.Ctrl, Key.Shift, 'Z']);
await this.browser.keys([Key.Ctrl, Key.Shift, 'z']);
await this.browser.pause(PAUSE_TIME);
const after = (await getAllBlocks(this.browser)).length;
chai.assert.equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/browser/test/field_edits_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ async function testFieldEdits(browser, direction) {
// Click on the field to change the value
await numberBlock.click();
await browser.keys([Key.Delete]);
await numberBlock.click();
await browser.keys(['1093']);

// Click on the workspace to exit the field editor
const workspace = await browser.$('#blocklyDiv > div > svg.blocklySvg > g');
await workspace.click();
Expand Down
1 change: 1 addition & 0 deletions tests/browser/test/procedure_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ suite('Testing Connecting Blocks', function (done) {
await this.browser.pause(PAUSE_TIME);
const alertText = await this.browser.getAlertText(); // get the alert text
chai.assert.equal(alertText, '123');
await this.browser.acceptAlert();
});
});
4 changes: 2 additions & 2 deletions tests/browser/test/toolbox_drag_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ async function openCategories(browser, categoryList, directionMultiplier) {
const flyoutBlock = await browser.$(
`.blocklyFlyout .blocklyBlockCanvas > g:nth-child(${3 + i * 2})`,
);
if (!(await elementInBounds(browser, flyoutBlock))) {
await scrollFlyout(browser, 0, 500);
while (!(await elementInBounds(browser, flyoutBlock))) {
await scrollFlyout(browser, 0, 50);
}

await flyoutBlock.dragAndDrop({x: directionMultiplier * 50, y: 0});
Expand Down
Loading