diff --git a/tests/e2e/driverAuth.spec.ts b/tests/e2e/driverAuth.spec.ts index 3fe48d0f..35dd0267 100644 --- a/tests/e2e/driverAuth.spec.ts +++ b/tests/e2e/driverAuth.spec.ts @@ -11,6 +11,23 @@ import { expect, test } from "@playwright/test"; * on mobile (form inputs reachable, submit button visible). */ +// `/login` wraps the LoginForm in ConnectivityIssue, which shows an overlay +// when GET /ping fails. In the full E2E matrix the api health check may not +// have come up yet when this suite runs first, so mock /ping to short-circuit +// the overlay and let the LoginForm (with the driver entry point) mount. +const pingOkBody = JSON.stringify({ data: { ok: true } }); + +test.beforeEach(async ({ page }) => { + await page.route(/\/ping(\?.*)?$/i, async (route) => { + await route.fulfill({ + status: 200, + contentType: "application/json", + headers: { "access-control-allow-origin": "*" }, + body: pingOkBody, + }); + }); +}); + test.describe("[AUTH][Driver] discoverability", () => { test("/login surfaces the driver login button on desktop and mobile", async ({ page }, testInfo) => { await page.goto("/login");