mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
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:
1 parent
2c62e1e378
commit
b5cc4feacb
11 files changed
+480
-51
No files matched your search
@@ -4,6 +4,7 @@ import { createFakeEngine } from '../../src/globe/testing/fakeEngine.js';
|
||||
import { createSettledState } from '../../src/app/qaProbe.js';
|
||||
import {
|
||||
waitForSettled,
|
||||
whenSettled,
|
||||
whenFramesDrawn,
|
||||
whenTilesLoaded,
|
||||
whenUiSettled,
|
||||
@@ -252,3 +253,57 @@ test('scenario polling waits for evidence and identifies an unmet condition', as
|
||||
/broken predicate/,
|
||||
);
|
||||
});
|
||||
|
||||
test('camera readiness also waits for the startup cover to stop intercepting clicks', async (t) => {
|
||||
pageEngine(t);
|
||||
const previous = {
|
||||
document: globalThis.document,
|
||||
getComputedStyle: globalThis.getComputedStyle,
|
||||
};
|
||||
let visibility = 'visible';
|
||||
globalThis.document = { querySelector: () => ({}) };
|
||||
globalThis.getComputedStyle = () => ({ visibility });
|
||||
t.after(() => {
|
||||
for (const [key, value] of Object.entries(previous)) {
|
||||
if (value === undefined) delete globalThis[key];
|
||||
else globalThis[key] = value;
|
||||
}
|
||||
});
|
||||
let disposed = false;
|
||||
await whenSettled({
|
||||
async waitForFunction(predicate) {
|
||||
assert.equal(predicate(), false, 'a started engine still has a cover');
|
||||
visibility = 'hidden';
|
||||
assert.equal(predicate(), true);
|
||||
return {
|
||||
dispose: async () => {
|
||||
disposed = true;
|
||||
},
|
||||
};
|
||||
},
|
||||
async evaluate() {
|
||||
assert.equal(disposed, true);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test('tile and UI polling never request globe frames', async (t) => {
|
||||
const { engine } = pageEngine(t);
|
||||
const previous = globalThis.document;
|
||||
globalThis.document = { getAnimations: () => [] };
|
||||
t.after(() => {
|
||||
if (previous === undefined) delete globalThis.document;
|
||||
else globalThis.document = previous;
|
||||
});
|
||||
t.mock.method(engine.render, 'request', () => {
|
||||
assert.fail('passive readiness requested a frame');
|
||||
});
|
||||
const page = {
|
||||
async waitForFunction(predicate) {
|
||||
assert.equal(predicate(), true);
|
||||
return { dispose: async () => {} };
|
||||
},
|
||||
};
|
||||
await whenTilesLoaded(page);
|
||||
await whenUiSettled(page);
|
||||
});
|
||||
Reference in new issue
Block a user