From d18c2fcc41918611e2a83fe08847ec1b0afe56a3 Mon Sep 17 00:00:00 2001 From: zhengwr Date: Tue, 21 Jul 2026 15:32:54 +0800 Subject: [PATCH] test: wait for viewer floor controls before smoke --- scripts/web_smoke_test.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/web_smoke_test.mjs b/scripts/web_smoke_test.mjs index f0b461f..2c5b2e9 100644 --- a/scripts/web_smoke_test.mjs +++ b/scripts/web_smoke_test.mjs @@ -40,6 +40,10 @@ async function inspect(viewport, name) { page.on("pageerror", (error) => pageErrors.push(error.message)); page.on("requestfailed", (request) => failedRequests.push(`${request.url()} ${request.failure()?.errorText || "failed"}`)); await page.goto(url, { waitUntil: "networkidle", timeout: 60000 }); + // The loading overlay starts hidden, then becomes visible while metadata and + // the first GLB load. Waiting for "hidden" alone can pass before loading has + // even started. A rendered floor control is the first stable readiness fact. + await page.waitForSelector("#floor-controls button", { state: "visible", timeout: 60000 }); await page.waitForSelector("#loading", { state: "hidden", timeout: 60000 }); const actualViewport = await page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight })); const viewportMatches = actualViewport.width === viewport.width && actualViewport.height === viewport.height;