fix(e2e): block service workers to prevent route mock bypass #68

Merged
ghost merged 1 commits from fix/e2e-block-service-worker-v2 into main 2026-03-19 13:57:47 +00:00
ghost commented 2026-03-19 13:51:20 +00:00 (Migrated from github.com)

Summary

  • Fixes the booking flow E2E test failure (book.spec.ts:62) where time slot buttons were not found
  • Root cause: VitePWA's workbox runtimeCaching registers a service worker that intercepts /api/* requests with a NetworkFirst strategy. Playwright's page.route() does not intercept requests handled by service workers, so the availability mock was bypassed and the real (empty) API response was used instead
  • Fix: add serviceWorkers: 'block' to the Playwright config, which prevents the SW from activating during E2E tests

Replaces #66 (which had merge conflicts).

Fixes #65

Test plan

  • CI E2E tests pass (booking flow test should now consistently pass)

🤖 Generated with Claude Code

## Summary - Fixes the booking flow E2E test failure (`book.spec.ts:62`) where time slot buttons were not found - Root cause: VitePWA's workbox `runtimeCaching` registers a service worker that intercepts `/api/*` requests with a `NetworkFirst` strategy. Playwright's `page.route()` [does not intercept requests handled by service workers](https://playwright.dev/docs/service-workers-experimental), so the availability mock was bypassed and the real (empty) API response was used instead - Fix: add `serviceWorkers: 'block'` to the Playwright config, which prevents the SW from activating during E2E tests Replaces #66 (which had merge conflicts). Fixes #65 ## Test plan - [ ] CI E2E tests pass (booking flow test should now consistently pass) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This repo is archived. You cannot comment on pull requests.