Skip to content

Commit

Permalink
fix(test-functional): fixes on hooks_functional.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed May 7, 2024
1 parent d3a317b commit bc41708
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/hooks_functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const loadExample = async (url, screenshotName) => {

pageErrors.forEach((e) => { throw e; });

await page.waitForFunction(() => typeof (view) === 'object');
await page.waitForFunction(() => typeof view === 'object' && view instanceof itowns.View);

await page.evaluate(() => {
itowns.CameraUtils.defaultStopPlaceOnGroundAtEnd = true;
Expand All @@ -131,6 +131,8 @@ const loadExample = async (url, screenshotName) => {
itowns.CameraUtils.stop(view, view.camera3D);
});
await layersAreInitialized();
} else {
throw e;
}
}

Expand Down Expand Up @@ -206,7 +208,7 @@ export const mochaHooks = {
});

// the page all tests will be tested in
return browser.newPage().then((p) => { global.page = p; });
global.page = await browser.newPage();
},
// store initial position for restoration after the test
afterAll(done) {
Expand Down

0 comments on commit bc41708

Please sign in to comment.