Restore the conditions eight converted QA scripts were waiting for

The harness conversion replaced pauses that stood in for real conditions
with camera readiness: the cables and infrastructure idle checks started
measuring while the overlay was still fading in after moveEnd, directions
sampled before its maneuver dots had ground cells, three scripts clicked
before the loading cover was gone, the credits check hit-tested during UI
transitions, and the oblique traffic flight lost its height cap. Each now
waits for its condition; idle checks observe without requesting frames
and record the reasons of the frames they count; readiness waits for the
startup cover and no longer requests frames while polling.
This commit is contained in:
German Khokhlov committed 2026-11-10 20:14:50 +04:00
1 parent 2c62e1e378
commit b5cc4feacb
11 files changed
+480 -51

No files matched your search

+10 -7
View File
@@ -66,13 +66,18 @@ export async function whenSettled(
) {
const started = Date.now();
try {
await page.waitForFunction(() => window.__godsEyeView?.engine, {
timeout: timeoutMs,
polling: 50,
});
const handle = await page.waitForFunction(
() => {
if (!window.__godsEyeView?.engine) return false;
const cover = globalThis.document?.querySelector('#loading-screen');
return !cover || getComputedStyle(cover).visibility === 'hidden';
},
{ timeout: timeoutMs, polling: 50 },
);
await handle?.dispose();
} catch {
throw new Error(
'Readiness timeout: engineStarted, initialViewRestored, frameDrawn, noFlight, cameraInputsEnabled, cameraPoseStable; observed: inputsEnabled=unknown, following=unknown, cockpitActive=unknown, lastPoseDelta=null',
'Readiness timeout: engineStarted, initialViewRestored, startupUiReady, frameDrawn, noFlight, cameraInputsEnabled, cameraPoseStable; observed: inputsEnabled=unknown, following=unknown, cockpitActive=unknown, lastPoseDelta=null',
);
}
return page.evaluate(
@@ -205,7 +210,6 @@ export async function whenTilesLoaded(page, { timeoutMs = 30000 } = {}) {
() => {
const engine = window.__godsEyeView?.engine;
if (!engine || engine.isDestroyed()) return false;
engine.render.request('qa-tile-readiness');
return engine.surface.tilesLoaded();
},
{ timeout: timeoutMs, polling: 100 },
@@ -217,7 +221,6 @@ export async function whenUiSettled(page) {
const handle = await page.waitForFunction(
() => {
const app = window.__godsEyeView;
app?.engine?.render.request('qa-ui-readiness');
return (
!app?.styleManager?.transitions?.size &&
document