Skip to content

feat(e2e): Playwright e2e test suite for critical user journeys (#540)#635

Open
jones43r wants to merge 1 commit into
Arenax-gaming:mainfrom
jones43r:feat/540-e2e-test-coverage
Open

feat(e2e): Playwright e2e test suite for critical user journeys (#540)#635
jones43r wants to merge 1 commit into
Arenax-gaming:mainfrom
jones43r:feat/540-e2e-test-coverage

Conversation

@jones43r

Copy link
Copy Markdown
Contributor

Summary

Closes #540

Adds a complete Playwright end-to-end test suite covering the four critical user journeys. All tests use Playwright route mocking so they run without a live backend.


What was added

frontend/playwright.config.ts

  • Single Chromium project, baseURL defaults to http://localhost:3000
  • Auto-starts next dev via webServer; reuses pre-built server in CI

frontend/e2e/mocks/handlers.ts

  • Centralised page.route() mock factories for auth, tournaments, matches, wallet, notifications
  • Shared fixtures: mockUser, mockTournament, mockMatch, mockTokens

frontend/e2e/auth.spec.ts

Test Journey
register POST /api/auth/register → redirects to /verify-email
verify email GET /auth/verify-email?token= → redirects to /
login success POST /api/auth/login → redirects home
login error 401 response → error alert visible
logout Clears storage → lands on /login

frontend/e2e/tournament.spec.ts

Test Journey
browse tournaments Tournaments page loads with card list
join tournament Join button → success dialog
view bracket /tournaments/:id/bracket renders
tournament detail /tournaments/:id shows content

frontend/e2e/match.spec.ts

Test Journey
enter matchmaking queue Select game mode → queue UI appears
cancel matchmaking Cancel → mode selector shown
report score Report button → submit → feedback

frontend/e2e/wallet.spec.ts

Test Journey
connect wallet prompt Wallet page shows Connect button
view balance section Balance cards rendered
withdraw modal opens Withdraw button → dialog (stubbed Freighter)
initiate withdraw Fill amount → submit

frontend/package.json

test:e2e          playwright test
test:e2e:ui       playwright test --ui
test:e2e:report   playwright show-report

.github/workflows/ci.yml

New e2e job on every PR:

  1. npm ci
  2. npx playwright install --with-deps chromium
  3. npm run build
  4. npm run test:e2e
  5. Uploads playwright-report/ artifact (7-day retention)

…renax-gaming#540)

- Install @playwright/test@1.49.1 and configure playwright.config.ts
- Add API mock handlers via Playwright route mocking (e2e/mocks/handlers.ts)
- Auth journey: register → verify-email, login success/failure, logout
- Tournament journey: browse list, join button, bracket page, detail page
- Match journey: enter matchmaking queue, cancel queue, report score
- Wallet journey: connect prompt, view balances, withdraw modal + submit
- Add test:e2e / test:e2e:ui / test:e2e:report scripts to package.json
- Add e2e CI job to ci.yml: installs chromium, builds, runs tests, uploads report artifact
@jones43r jones43r requested a review from anonfedora as a code owner June 26, 2026 10:21
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@jones43r is attempting to deploy a commit to the paul joseph's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[frontend] -End-to-end test coverage for critical user journeys

1 participant