mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
fix(tests): wait for the workspace to render before starting test actions (#7399)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user