Skip to content

Document running the Playwright tests locally - #2939

Open
hanapotski wants to merge 1 commit into
developfrom
claude/playwright-local-tests-docs-c3732f
Open

hanapotski wants to merge 1 commit into
developfrom
claude/playwright-local-tests-docs-c3732f

Conversation

@hanapotski

Copy link
Copy Markdown
Contributor

What changed

Adds a Running the Playwright tests locally section to client/README.md, and fixes the npm test entry.

The new section covers:

  • No backend needed: specs mock the API (tests/helpers/mocks.ts), and the shared fixture in tests/helpers/test.ts blocks Mapbox tiles and analytics and stubs geocoding.
  • One-time setup: npm ci and npx playwright install.
  • Running: start npm start first, because the webServer block in playwright.config.ts is commented out, then run npx playwright test and npx playwright show-report.
  • Variations: --project=chromium, a single spec file, -g, --headed, --ui, --debug.
  • Matching CI: reproducing the vite build + vite preview setup CI uses, and opening the CI playwright-report artifact.
  • Writing new tests: import test from ./helpers/test.

Why

Nothing in the repo explained how to run the E2E suite locally. The client README's npm test entry was leftover Create React App text that described Jest watch mode, but the script actually runs playwright test --ui --headed. I also added a short entry for npm run test:unit.

For reviewers

  • Docs only, no code changes.
  • The rest of client/README.md is still Create React App boilerplate. I left it as is to keep this PR focused.
  • I checked the documented commands locally: all 55 specs pass on Chromium against the dev server. Running a single file and filtering with -g both work, and tests/app.spec.ts passes against vite build + vite preview. I didn't run Firefox or WebKit locally.

🤖 Generated with Claude Code


🤖 Written by Claude on behalf of @hanapotski

client/README.md had no instructions for the Playwright E2E suite, and its
leftover Create React App text described `npm test` as Jest watch mode, though
it actually opens Playwright's UI mode. Add a section covering one-time
browser setup, starting the dev server first (Playwright's webServer is
disabled), common run variations, how to reproduce CI's vite preview setup,
and how new specs should use the shared test fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant