fix: Corriger les tests E2E de blocage utilisateur qui échouent de manière intermittente

Sur Firefox, l'hydration Svelte peut prendre plus de temps que sur
Chromium. L'assertion tabs.nth(1).toHaveAttribute manquait de timeout
dans periods.spec.ts, et le formulaire de login n'était pas
complètement hydraté avant interaction dans admin-responsive-nav.spec.ts.
This commit is contained in:
2026-02-25 20:42:52 +01:00
parent 2420e35492
commit f2f57bb999
2 changed files with 3 additions and 2 deletions

View File

@@ -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([

View File

@@ -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 }) => {