Skip to content

Commit

Permalink
fix(tests): wait for the workspace to render before starting test act…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
rachel-fenichel committed Aug 16, 2023
1 parent b4ce6af commit 1bc8ef5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/browser/test/test_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ async function driverTeardown() {

/**
* Navigate to the correct URL for the test, using the shared driver.
* @param {string} url The URL to open for the test.
* @param {string} playgroundUrl The URL to open for the test, which should be
* a Blockly playground with a workspace.
* @return A Promsie that resolves to a webdriverIO browser that tests can manipulate.
*/
async function testSetup(url) {
async function testSetup(playgroundUrl) {
if (!driver) {
await driverSetup();
}
await driver.url(url);
await driver.url(playgroundUrl);
// Wait for the workspace to exist and be rendered.
await driver
.$('.blocklySvg .blocklyWorkspace > .blocklyBlockCanvas')
.waitForExist({timeout: 2000});
return driver;
}

Expand Down

0 comments on commit 1bc8ef5

Please sign in to comment.