Skip to content

Commit d5fcc1d

Browse files
committed
chore: Re-enable tests & some cleanups.
Also inclues WDIO version downgrade.
1 parent 3b6c99e commit d5fcc1d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: [macos-latest]
24+
os: [ubuntu-latest, macos-latest]
2525

2626
steps:
2727
- name: Checkout experimentation plugin

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"prettier": "^3.3.1",
7878
"ts-loader": "^9.5.1",
7979
"typescript": "^5.4.5",
80-
"webdriverio": "^9.20.1"
80+
"webdriverio": "^9.12.1"
8181
},
8282
"peerDependencies": {
8383
"blockly": "^12.3.0"

test/webdriverio/test/scroll_test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
testSetup,
1919
checkForFailures,
2020
idle,
21-
setPauseTime,
2221
} from './test_setup.js';
2322

2423
suite('Scrolling into view', function () {

test/webdriverio/test/test_setup.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ let driver: webdriverio.Browser | null = null;
4242
* the browser.wait* functions if you need your test to wait for
4343
* something to happen after sending input.
4444
*/
45-
export var PAUSE_TIME = 0;
46-
47-
export function setPauseTime(time: number) { PAUSE_TIME = time; }
45+
export const PAUSE_TIME = 0;
4846

4947
/**
5048
* Start up WebdriverIO and load the test page. This should only be
@@ -65,10 +63,8 @@ export async function driverSetup(
6563
'unhandledPromptBehavior': 'ignore',
6664
// eslint-disable-next-line @typescript-eslint/naming-convention
6765
'goog:chromeOptions': {
68-
args: ['--allow-file-access-from-files', '--user_agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.44 (KHTML, like Gecko) JavaFX/8.0 Safari/537.44'],
66+
args: ['--allow-file-access-from-files'],
6967
},
70-
// Allows certain BiDi features to work correctly.
71-
// 'webSocketUrl': true
7268
// We aren't (yet) using any BiDi features, and BiDi is sensitive to
7369
// mismatches between Chrome version and Chromedriver version.
7470
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -207,6 +203,11 @@ export async function getSelectedBlockId(browser: WebdriverIO.Browser) {
207203
}
208204

209205
export async function idle(browser: WebdriverIO.Browser) {
206+
// First, attempt to synchronize on rendering to ensure that Blockly is fully
207+
// rendered before pausing for browser execution. This works around potential
208+
// bugs when running in headless mode that can cause requestAnimationFrame to
209+
// not call back (and cause state inconsistencies in block positions and sizes
210+
// per #770).
210211
await browser.execute(() => {
211212
const workspace = Blockly.getMainWorkspace() as Blockly.WorkspaceSvg;
212213
// Queue re-rendering all blocks.

0 commit comments

Comments
 (0)