fix(e2e): goTo wartet auf h1 statt nav fuer zuverlaessigere Hydration

Root cause der 16 overview-Failures: goTo kehrte zu frueh zurueck weil
nav sofort sichtbar ist (SSR), aber der Main-Content (Projektstatus etc.)
erst nach API-Fetch rendert. Jetzt wartet goTo auf h1 (das erst nach
dem project-Fetch erscheint) + 1s Buffer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-10 13:54:18 +02:00
parent 17254789e0
commit 049b28f107
@@ -68,11 +68,12 @@ async function dismissCookieBanner(page: Page) {
async function goTo(page: Page, path: string) {
await page.goto(`${BASE}${path}`, { waitUntil: 'domcontentloaded', timeout: 30000 })
await dismissCookieBanner(page)
// Wait for React hydration + API fetches by checking for sidebar nav
// Wait for React hydration + API fetches — the h1 element is rendered
// after the project data loads, so wait for any h1 to appear
try {
await page.locator('nav').first().waitFor({ state: 'visible', timeout: 10000 })
} catch { /* nav may not be present on all pages */ }
await page.waitForTimeout(2000)
await page.locator('h1').first().waitFor({ state: 'visible', timeout: 15000 })
} catch { /* h1 may not appear if page errors */ }
await page.waitForTimeout(1000)
await dismissCookieBanner(page)
}