Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

test: wait for city tiles before Location captures

Sameh Khamis4e33e983774c
diff --git a/scripts/qa-location-controls.mjs b/scripts/qa-location-controls.mjs
index 5a7578ef3..4c3248ce8 100644
--- a/scripts/qa-location-controls.mjs
+++ b/scripts/qa-location-controls.mjs
@@ -166,6 +166,33 @@ try {
() => !window.__godsEyeView.viewer.camera._currentFlight,
{ 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 });
await page.screenshot({ path: 'qa-shots/location-controls/desktop.png' });
await page.setViewport({ width: 620, height: 900 });