diff --git a/scripts/web_smoke_test.mjs b/scripts/web_smoke_test.mjs index 2c5b2e9..ba966ba 100644 --- a/scripts/web_smoke_test.mjs +++ b/scripts/web_smoke_test.mjs @@ -43,7 +43,7 @@ async function inspect(viewport, name) { // 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("#floor-controls label", { 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; @@ -63,15 +63,15 @@ async function inspect(viewport, name) { const after = await page.evaluate(() => window.__renders || 0); checks.push({ name: `${name}:idle-render`, status: after === before ? "PASS" : "FAIL", detail: `${before}->${after}` }); if (name === "desktop") { - const buttons = page.locator("#floor-controls button"); - const buttonCount = await buttons.count(); - if (buttonCount > 0) { - const button = buttons.nth(0); - const label = (await button.innerText()).trim(); - await button.click(); + const floorLabels = page.locator("#floor-controls label"); + const floorLabelCount = await floorLabels.count(); + if (floorLabelCount > 0) { + const floorLabel = floorLabels.nth(0); + const label = (await floorLabel.innerText()).trim(); + await floorLabel.click(); await page.waitForTimeout(150); const hashWritten = await page.evaluate(() => window.location.hash.length > 1); - await button.click(); + await floorLabel.click(); await page.waitForTimeout(150); checks.push({ name: "desktop:floor-state",