Give QA scripts one launch, readiness and geometry helper

scripts/qa/browser.mjs launches headless Chrome with QA_ANGLE and the
shared Chrome lookup; scripts/qa/ready.mjs adds frame, tile and transition
readiness and bounded polling; scripts/qa/geometry.mjs hands page
evaluations the engine-neutral geometry without dev-only source URLs.
CODE-BOUNDARIES gains the rule for new QA scripts.
This commit is contained in:
German Khokhlov committed 2026-11-10 16:43:58 +04:00
1 parent 37263a3e2b
commit 731eadc34a
7 files changed
+305

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import vm from 'node:vm';
import { evaluateWithGeo } from './geometry.mjs';
test('page geometry works without source routes or native engine constructors', async () => {
const page = {
evaluate: (callback, ...args) =>
vm.runInNewContext(`(${callback})(...${JSON.stringify(args)})`),
};
const result = await evaluateWithGeo(
page,
(geo, lon, lat, height) => {
const point = geo.cartesian3.fromDegrees(lon, lat, height);
return geo.cartographic.fromCartesian(point);
},
23,
-12,
650,
);
assert.ok(Math.abs(result.longitude - (23 * Math.PI) / 180) < 1e-12);
assert.ok(Math.abs(result.latitude + (12 * Math.PI) / 180) < 1e-12);
assert.ok(Math.abs(result.height - 650) < 1e-6);
});