Skip to content

Commit cc3c0d9

Browse files
fix: minor issues in browser tests
1 parent 00d870e commit cc3c0d9

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

tests/browser/test/delete_blocks_test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ suite('Delete blocks', function (done) {
179179
await this.browser.keys([Key.Backspace]);
180180
await this.browser.pause(PAUSE_TIME);
181181
// Undo
182-
await this.browser.keys([Key.Ctrl, 'Z']);
182+
await this.browser.keys([Key.Ctrl, 'z']);
183+
await this.browser.pause(PAUSE_TIME);
183184
const after = (await getAllBlocks(this.browser)).length;
184185
chai.assert.equal(
185186
before,
@@ -195,10 +196,10 @@ suite('Delete blocks', function (done) {
195196
await this.browser.keys([Key.Backspace]);
196197
await this.browser.pause(PAUSE_TIME);
197198
// Undo
198-
await this.browser.keys([Key.Ctrl, 'Z']);
199+
await this.browser.keys([Key.Ctrl, 'z']);
199200
await this.browser.pause(PAUSE_TIME);
200201
// Redo
201-
await this.browser.keys([Key.Ctrl, Key.Shift, 'Z']);
202+
await this.browser.keys([Key.Ctrl, Key.Shift, 'z']);
202203
await this.browser.pause(PAUSE_TIME);
203204
const after = (await getAllBlocks(this.browser)).length;
204205
chai.assert.equal(

tests/browser/test/field_edits_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ async function testFieldEdits(browser, direction) {
4545
// Click on the field to change the value
4646
await numberBlock.click();
4747
await browser.keys([Key.Delete]);
48-
await numberBlock.click();
4948
await browser.keys(['1093']);
49+
5050
// Click on the workspace to exit the field editor
5151
const workspace = await browser.$('#blocklyDiv > div > svg.blocklySvg > g');
5252
await workspace.click();

tests/browser/test/procedure_test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,6 @@ suite('Testing Connecting Blocks', function (done) {
104104
await this.browser.pause(PAUSE_TIME);
105105
const alertText = await this.browser.getAlertText(); // get the alert text
106106
chai.assert.equal(alertText, '123');
107+
await this.browser.acceptAlert();
107108
});
108109
});

tests/browser/test/toolbox_drag_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ async function openCategories(browser, categoryList, directionMultiplier) {
148148
const flyoutBlock = await browser.$(
149149
`.blocklyFlyout .blocklyBlockCanvas > g:nth-child(${3 + i * 2})`,
150150
);
151-
if (!(await elementInBounds(browser, flyoutBlock))) {
152-
await scrollFlyout(browser, 0, 500);
151+
while (!(await elementInBounds(browser, flyoutBlock))) {
152+
await scrollFlyout(browser, 0, 50);
153153
}
154154

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

0 commit comments

Comments
 (0)