From 82c95d32c0eef29c9f6d5b33a345c99f17d9383a Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Sun, 9 Aug 2026 15:37:13 +0200 Subject: [PATCH] Mock /ping in driverAuth e2e so the ConnectivityIssue overlay does not hide the driver entry point (#266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [OpenClaw](https://openclaw.ai) ## Why `tests/e2e/driverAuth.spec.ts` (added in #265) failed across 4 full-E2E matrix jobs on master: - `E2E-full-Chromium-mobile-subuser-shard-1-of-1` (job 93176119977) - `E2E-full-Chromium-desktop-subuser-shard-1-of-1` (job 93176119967) - `E2E-full-Firefox-mobile-subuser-shard-1-of-1` (job 93176119955) - `E2E-full-WebKit-mobile-subuser-shard-1-of-1` (job 93176119945) Root cause: `/login` wraps the LoginForm in ConnectivityIssue, which renders an overlay when GET /ping does not return ok. In the full subuser E2E matrix driverAuth.spec.ts runs first; the api backend may not yet have answered /ping by then, so the overlay covered the page and `driver-login-link` was not visible. Targeted E2E (driverAuth only) passed because the api was warm by then. ## Fix Add a `test.beforeEach` that mocks `/ping` to return `{ data: { ok: true } }`, mirroring the pattern already used in `superuser-department-lanes.spec.ts`. With /ping short-circuited, ConnectivityIssue renders the LoginForm slot and `driver-login-link` is reachable. ## Risk Low. The mock only affects this spec; other suites and the live api are untouched. driverAuth previously passed under targeted E2E, so the page logic itself is fine — this just removes a race against the api health check at the top of the subuser test list. --------- Co-authored-by: Truck Wash Agent --- tests/e2e/driverAuth.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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");