diff --git a/scripts/qa/ready.mjs b/scripts/qa/ready.mjs index ef75ffeb6..99456825e 100644 --- a/scripts/qa/ready.mjs +++ b/scripts/qa/ready.mjs @@ -210,6 +210,8 @@ export async function whenTilesLoaded(page, { timeoutMs = 30000 } = {}) { () => { const engine = window.__godsEyeView?.engine; if (!engine || engine.isDestroyed()) return false; + // A request-mode globe only updates tile state on drawn frames. + engine.render.request('qa-tile-readiness'); return engine.surface.tilesLoaded(); }, { timeout: timeoutMs, polling: 100 }, @@ -221,6 +223,7 @@ 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 diff --git a/scripts/qa/ready.test.mjs b/scripts/qa/ready.test.mjs index cff54c5bb..06ac8cf4f 100644 --- a/scripts/qa/ready.test.mjs +++ b/scripts/qa/ready.test.mjs @@ -287,7 +287,7 @@ test('camera readiness also waits for the startup cover to stop intercepting cli }); }); -test('tile and UI polling never request globe frames', async (t) => { +test('tile and UI polling request frames so a request-mode globe progresses', async (t) => { const { engine } = pageEngine(t); const previous = globalThis.document; globalThis.document = { getAnimations: () => [] }; @@ -295,9 +295,8 @@ test('tile and UI polling never request globe frames', async (t) => { if (previous === undefined) delete globalThis.document; else globalThis.document = previous; }); - t.mock.method(engine.render, 'request', () => { - assert.fail('passive readiness requested a frame'); - }); + const reasons = []; + t.mock.method(engine.render, 'request', (reason) => reasons.push(reason)); const page = { async waitForFunction(predicate) { assert.equal(predicate(), true); @@ -306,4 +305,5 @@ test('tile and UI polling never request globe frames', async (t) => { }; await whenTilesLoaded(page); await whenUiSettled(page); + assert.deepEqual(reasons, ['qa-tile-readiness', 'qa-ui-readiness']); });