fix(demo): wait for post-login redirect before navigating in e2e tests
Two demo-guide.spec.ts tests navigated straight to /scenarios right after clicking a login button without waiting for the /dashboard redirect to settle first. This raced harmlessly on localhost but flaked against the higher-latency Unraid deployment, hitting RequireAuth before the session was confirmed.
This commit is contained in:
@@ -13,6 +13,7 @@ test("scenario overview lists all 5 scenarios, ready right after a reset", async
|
|||||||
await resetDemoData(request);
|
await resetDemoData(request);
|
||||||
await page.goto("/login");
|
await page.goto("/login");
|
||||||
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
||||||
|
await expect(page).toHaveURL(/\/dashboard$/);
|
||||||
await page.goto("/scenarios");
|
await page.goto("/scenarios");
|
||||||
|
|
||||||
await expect(page.getByRole("heading", { name: "Probeer een demonstratiescenario" })).toBeVisible();
|
await expect(page.getByRole("heading", { name: "Probeer een demonstratiescenario" })).toBeVisible();
|
||||||
@@ -27,6 +28,7 @@ test("scenario overview lists all 5 scenarios, ready right after a reset", async
|
|||||||
test("starting a scenario navigates to its fixed record", async ({ page }) => {
|
test("starting a scenario navigates to its fixed record", async ({ page }) => {
|
||||||
await page.goto("/login");
|
await page.goto("/login");
|
||||||
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
||||||
|
await expect(page).toHaveURL(/\/dashboard$/);
|
||||||
await page.goto("/scenarios");
|
await page.goto("/scenarios");
|
||||||
|
|
||||||
const duplicateCard = page.locator(".scenario-card", { hasText: "dubbele klant" });
|
const duplicateCard = page.locator(".scenario-card", { hasText: "dubbele klant" });
|
||||||
|
|||||||
Reference in New Issue
Block a user