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) }