diff --git a/frontend/e2e/admin-responsive-nav.spec.ts b/frontend/e2e/admin-responsive-nav.spec.ts index 4e1816d..743e51f 100644 --- a/frontend/e2e/admin-responsive-nav.spec.ts +++ b/frontend/e2e/admin-responsive-nav.spec.ts @@ -27,6 +27,7 @@ test.describe('Admin Responsive Navigation', () => { async function loginAsAdmin(page: import('@playwright/test').Page) { await page.goto(`${ALPHA_URL}/login`); + await page.waitForLoadState('networkidle'); await page.locator('#email').fill(ADMIN_EMAIL); await page.locator('#password').fill(ADMIN_PASSWORD); await Promise.all([ diff --git a/frontend/e2e/periods.spec.ts b/frontend/e2e/periods.spec.ts index 56d7e92..c8eff24 100644 --- a/frontend/e2e/periods.spec.ts +++ b/frontend/e2e/periods.spec.ts @@ -89,8 +89,8 @@ test.describe('Periods Management (Story 2.3)', () => { await page.goto(`${ALPHA_URL}/admin/academic-year/periods`); const tabs = page.getByRole('tab'); - // Middle tab (current) should be active - await expect(tabs.nth(1)).toHaveAttribute('aria-selected', 'true'); + // Middle tab (current) should be active — wait for Svelte hydration + await expect(tabs.nth(1)).toHaveAttribute('aria-selected', 'true', { timeout: 10000 }); }); test('can switch between year tabs', async ({ page }) => {