b6b4bc21a0
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: Groom Book CTO <cto@groombook.dev> Co-authored-by: Paperclip <noreply@paperclip.ing>
35 lines
804 B
TypeScript
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"] },
|
|
},
|
|
],
|
|
});
|