From 049b28f10726dcf74b309f87977cb4bd95afc064 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Sun, 10 May 2026 13:54:18 +0200 Subject: [PATCH] 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) --- admin-compliance/e2e/specs/iace-module.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/admin-compliance/e2e/specs/iace-module.spec.ts b/admin-compliance/e2e/specs/iace-module.spec.ts index cce1a27..91bb996 100644 --- a/admin-compliance/e2e/specs/iace-module.spec.ts +++ b/admin-compliance/e2e/specs/iace-module.spec.ts @@ -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) }