fix: Éliminer la flakiness des login E2E sur Firefox

Les helpers loginAs* utilisaient un pattern séquentiel (click → wait)
qui crée une race condition : la navigation peut se terminer avant que
le listener soit en place. Firefox sur CI est particulièrement sensible.

Le fix remplace ce pattern par Promise.all([waitForURL, click]) dans
les 14 fichiers E2E concernés, alignant le code sur le pattern robuste
déjà utilisé dans login.spec.ts.
This commit is contained in:
2026-02-12 15:49:49 +01:00
parent 2e225eb466
commit 73a473ec93
14 changed files with 726 additions and 24 deletions

View File

@@ -45,8 +45,10 @@ test.describe('Pedagogy - Grading Mode Configuration (Story 2.4)', () => {
await page.goto(`${ALPHA_URL}/login`);
await page.locator('#email').fill(ADMIN_EMAIL);
await page.locator('#password').fill(ADMIN_PASSWORD);
await page.getByRole('button', { name: /se connecter/i }).click();
await expect(page).toHaveURL(/\/dashboard/, { timeout: 10000 });
await Promise.all([
page.waitForURL(/\/dashboard/, { timeout: 10000 }),
page.getByRole('button', { name: /se connecter/i }).click()
]);
}
// =========================================================================