This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
app/apps/e2e/playwright.config.ts
T
Groom Book CTO 75cbc2364a fix(e2e): block service workers to prevent route mock bypass
The PWA service worker (VitePWA workbox runtimeCaching) intercepts
/api/* requests, which prevents Playwright's page.route() mocks from
working. This caused the booking flow E2E test to fail because the
availability request was handled by the service worker instead of the
test mock, resulting in real (empty) API responses.

Fixes #65

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-19 13:51:02 +00:00

35 lines
804 B
TypeScript

import { defineConfig, devices } from "@playwright/test";
/**
* Playwright configuration for Groom Book E2E tests.
*
* Targets the Docker Compose stack:
* - Web: http://localhost:8080
* - API: http://localhost:3000 (proxied via the web container's nginx)
*
* Run locally:
* docker compose up -d
* pnpm --filter @groombook/e2e test
*/
export default defineConfig({
testDir: "./tests",
timeout: 30_000,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? "github" : "list",
use: {
baseURL: "http://localhost:8080",
trace: "on-first-retry",
screenshot: "only-on-failure",
serviceWorkers: "block",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
});