mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
test: wait for city tiles before Location captures
This commit is contained in:
1 parent
9bbb437592
commit
4e33e98377
1 file changed
+27
@@ -166,6 +166,33 @@ try {
|
|||||||
() => !window.__godsEyeView.viewer.camera._currentFlight,
|
() => !window.__godsEyeView.viewer.camera._currentFlight,
|
||||||
{ timeout: 10000 },
|
{ timeout: 10000 },
|
||||||
);
|
);
|
||||||
|
await page.evaluate(
|
||||||
|
() =>
|
||||||
|
new Promise((resolve) =>
|
||||||
|
requestAnimationFrame(() => requestAnimationFrame(resolve)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
const settled = await page
|
||||||
|
.waitForFunction(
|
||||||
|
() => {
|
||||||
|
const scene = window.__godsEyeView.viewer.scene;
|
||||||
|
for (let index = 0; index < scene.primitives.length; index++) {
|
||||||
|
const primitive = scene.primitives.get(index);
|
||||||
|
if (
|
||||||
|
typeof primitive.tilesLoaded === 'boolean' &&
|
||||||
|
!primitive.tilesLoaded
|
||||||
|
)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
{ timeout: 60000 },
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
() => true,
|
||||||
|
() => false,
|
||||||
|
);
|
||||||
|
check('visible city tiles settle before screenshots', settled);
|
||||||
fs.mkdirSync('qa-shots/location-controls', { recursive: true });
|
fs.mkdirSync('qa-shots/location-controls', { recursive: true });
|
||||||
await page.screenshot({ path: 'qa-shots/location-controls/desktop.png' });
|
await page.screenshot({ path: 'qa-shots/location-controls/desktop.png' });
|
||||||
await page.setViewport({ width: 620, height: 900 });
|
await page.setViewport({ width: 620, height: 900 });
|
||||||
|
|||||||
Reference in new issue
Block a user