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:
@@ -27,6 +27,7 @@ test.describe('Admin Responsive Navigation', () => {
|
|||||||
|
|
||||||
async function loginAsAdmin(page: import('@playwright/test').Page) {
|
async function loginAsAdmin(page: import('@playwright/test').Page) {
|
||||||
await page.goto(`${ALPHA_URL}/login`);
|
await page.goto(`${ALPHA_URL}/login`);
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
await page.locator('#email').fill(ADMIN_EMAIL);
|
await page.locator('#email').fill(ADMIN_EMAIL);
|
||||||
await page.locator('#password').fill(ADMIN_PASSWORD);
|
await page.locator('#password').fill(ADMIN_PASSWORD);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ test.describe('Periods Management (Story 2.3)', () => {
|
|||||||
await page.goto(`${ALPHA_URL}/admin/academic-year/periods`);
|
await page.goto(`${ALPHA_URL}/admin/academic-year/periods`);
|
||||||
|
|
||||||
const tabs = page.getByRole('tab');
|
const tabs = page.getByRole('tab');
|
||||||
// Middle tab (current) should be active
|
// Middle tab (current) should be active — wait for Svelte hydration
|
||||||
await expect(tabs.nth(1)).toHaveAttribute('aria-selected', 'true');
|
await expect(tabs.nth(1)).toHaveAttribute('aria-selected', 'true', { timeout: 10000 });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('can switch between year tabs', async ({ page }) => {
|
test('can switch between year tabs', async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user