test: target generated floor labels in smoke
Some checks failed
ci / test (macos-latest, 3.10) (push) Has been cancelled
ci / test (macos-latest, 3.12) (push) Has been cancelled
ci / test (ubuntu-latest, 3.10) (push) Has been cancelled
ci / test (ubuntu-latest, 3.12) (push) Has been cancelled
ci / test (windows-latest, 3.10) (push) Has been cancelled
ci / test (windows-latest, 3.12) (push) Has been cancelled
ci / browser-smoke (push) Has been cancelled

This commit is contained in:
2026-07-21 15:37:03 +08:00
parent d18c2fcc41
commit adbd476957

View File

@@ -43,7 +43,7 @@ async function inspect(viewport, name) {
// The loading overlay starts hidden, then becomes visible while metadata and // The loading overlay starts hidden, then becomes visible while metadata and
// the first GLB load. Waiting for "hidden" alone can pass before loading has // 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. // 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 }); await page.waitForSelector("#loading", { state: "hidden", timeout: 60000 });
const actualViewport = await page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight })); const actualViewport = await page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight }));
const viewportMatches = actualViewport.width === viewport.width && actualViewport.height === viewport.height; 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); const after = await page.evaluate(() => window.__renders || 0);
checks.push({ name: `${name}:idle-render`, status: after === before ? "PASS" : "FAIL", detail: `${before}->${after}` }); checks.push({ name: `${name}:idle-render`, status: after === before ? "PASS" : "FAIL", detail: `${before}->${after}` });
if (name === "desktop") { if (name === "desktop") {
const buttons = page.locator("#floor-controls button"); const floorLabels = page.locator("#floor-controls label");
const buttonCount = await buttons.count(); const floorLabelCount = await floorLabels.count();
if (buttonCount > 0) { if (floorLabelCount > 0) {
const button = buttons.nth(0); const floorLabel = floorLabels.nth(0);
const label = (await button.innerText()).trim(); const label = (await floorLabel.innerText()).trim();
await button.click(); await floorLabel.click();
await page.waitForTimeout(150); await page.waitForTimeout(150);
const hashWritten = await page.evaluate(() => window.location.hash.length > 1); const hashWritten = await page.evaluate(() => window.location.hash.length > 1);
await button.click(); await floorLabel.click();
await page.waitForTimeout(150); await page.waitForTimeout(150);
checks.push({ checks.push({
name: "desktop:floor-state", name: "desktop:floor-state",