Wait for the application, not the clock, in the strict QA set

The probe exposes settled() and the first-frame outcome; scripts/qa/ready.mjs
waits for drawn frames with the camera at rest and for a pick at the click
position, with a deadline and its reason in the error. The strict scenarios
use these instead of fixed pauses and loading-screen polling, and the
hidden-switch scenario checks how the loading screen was lifted instead of
how long it took.

Each switch scenario now records a draw ledger per engine and runs a
contract monitor; both write to the scenario's evidence file only, with an
empty allowlist until browser runs show what differs on purpose.
This commit is contained in:
German Khokhlov committed 2026-11-10 15:46:26 +04:00
1 parent 9c2a2d6951
commit 60f9de8511
47 files changed
+1788 -312

No files matched your search

+5 -4
View File
@@ -1,3 +1,4 @@
import { whenSettled } from './qa/ready.mjs';
import { trafficFixtureResponse } from './traffic-fixtures.mjs';
import sharp from 'sharp';
import assert from 'node:assert/strict';
@@ -156,14 +157,14 @@ await strict.run({}, async (b) => {
'traffic did not settle with 12 vehicles in view: ' +
JSON.stringify({ loading, inView: rows.length }),
);
await new Promise((resolve) => setTimeout(resolve, 500));
await whenSettled(p);
}
};
// The population once roads, heights and dots have settled. Source counts
// can be ready before the renderer has drawn terrain, so the camera and the
// attached road heights get the same delay before and after the switches.
// attached road heights are sampled after drawn frames on either engine.
const settledPopulation = async () => {
await new Promise((resolve) => setTimeout(resolve, 2200));
await whenSettled(p);
await settled();
return p.evaluate(() => window.qaTraffic.getStats().count);
};
@@ -251,7 +252,7 @@ await strict.run({}, async (b) => {
origin: 'user',
}),
);
await new Promise((resolve) => setTimeout(resolve, 600));
await whenSettled(p);
const hidden = await raw();
const { width, height } = shown.info;
const scale = width / 1024;