diff --git a/qa/full_dogfood.mjs b/qa/full_dogfood.mjs index a3e9c1c..7535bf5 100644 --- a/qa/full_dogfood.mjs +++ b/qa/full_dogfood.mjs @@ -26,10 +26,12 @@ record("login_shows_three_personas", chips.length === 3, chips.join(" | ")); const ssoBtn = await p.locator(".sso-btn").count(); record("login_has_microsoft_sso_button", ssoBtn === 1); -// 2. Persona dev-login works +// 2. Persona dev-login works. Wait for the landing hero to actually hydrate +// rather than a fixed sleep so a slow EA2 round-trip doesn't flake. await p.locator(".persona-chip", { hasText: /Mariana/ }).click(); await p.locator(".dev-login-btn").click(); -await p.waitForTimeout(2500); +await p.waitForSelector(".hero-actions", { timeout: 15000 }).catch(() => {}); +await p.waitForFunction(() => document.querySelectorAll(".hub-chip").length >= 7, undefined, { timeout: 15000 }).catch(() => {}); const onLanding = await p.locator(".hero-actions").count(); record("ceo_persona_dev_login_lands_on_landing", onLanding === 1); @@ -45,11 +47,12 @@ await p.waitForTimeout(1000); const explainerCards = await p.locator(".explainer-card").count(); record("explainer_renders_eight_cards", explainerCards === 8, `cards=${explainerCards}`); -// 5. Geo-attendance: tiles + markers + stats +// 5. Geo-attendance: tiles + markers + stats. Wait up to 20s for EA2 fetch +// + leaflet hydration; the attendance API materialises 8 docs lazily. await p.locator(".tab", { hasText: /Home/ }).first().click(); await p.waitForTimeout(800); await p.locator(".hub-chip", { hasText: /Attendance Map/ }).click(); -await p.waitForTimeout(3000); +await p.waitForFunction(() => document.querySelectorAll(".leaflet-marker-icon").length >= 8, undefined, { timeout: 20000 }).catch(() => {}); const tiles = await p.locator(".leaflet-tile").count(); const markers = await p.locator(".leaflet-marker-icon").count(); record("geo_attendance_renders_tiles", tiles > 10, `tiles=${tiles}`);