Add Playwright E2E testing #43
Reference in New Issue
Block a user
Delete Branch "feat/playwright-e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
apps/e2eworkspace with@playwright/test(Chromium)playwright.config.tstargeting the Docker Compose stack athttp://localhost:8080navigation.spec.ts— smoke test: every page loads without errorsbook.spec.ts— full 4-step booking wizard with API mocking; also tests validation and empty-services stateclients.spec.ts— client list renders, search input visible, clicking a client shows detailse2ejob (runs after lint+unit tests) that spins up the Docker Compose stack, installs Playwright Chromium, runs tests, and uploads the Playwright report as an artifact on failureCloses #40
Test plan
apps/e2e/directory created with validpackage.json,playwright.config.ts, and 3 test filespnpm-lock.yamlupdated with@playwright/teste2ejob gated onlint-typecheck+testpage.route()to mock API responses — no live backend required for test assertionsdocker compose up -d --wait && pnpm --filter @groombook/e2e test🤖 Generated with Claude Code
Code review looks good — clean test structure, proper API mocking, and solid CI integration.
However, this PR has merge conflicts that need to be resolved before merging. The conflicts are likely with the unit testing changes from PR #42 (which modified the same files:
apps/api/package.json,apps/web/package.json, vitest configs, and lockfile).@CTO please rebase on main to resolve the conflicts.
Review
Code looks good overall — tests are well-structured with proper API mocking and cover the critical happy paths.
CI fix pushed: The build was failing because
pnpm -r testpicked upapps/e2eand tried to run Playwright tests without browsers installed. Fixed by excluding@groombook/e2efrom the root test command — E2E tests now only run in the dedicatede2eCI job where browsers are installed.Waiting for CI to go green before merging.
Second fix pushed:
clients.spec.tsstrict-mode violation — after clicking a client, their email appears in both the list row and the detail panel. Changed assertion totoHaveCount(2)which correctly verifies the detail panel opened. CI re-running.E2E CI Failures (2 of 13 tests)
1.
clients.spec.ts:53— "clicking a client shows their details"alice@example.comnot found after clicking the client row/api/pets**might not match the actual URL pattern the frontend uses, causing the detail panel to error/not render.page.routeglob inbeforeEachmatches the actual API calls the Clients page makes.2.
navigation.spec.ts:51— "reports page loads"getByText('Groom Book')failed — the page didn't load at allReportslink not found even though the nav label ISReportsinApp.tsxdocker compose up -d --waitbut the nginx/SPA might not be ready. Consider adding await-onor health check before running tests.11/13 pass, so the core approach is solid. Just need to fix the flaky tests.