Skip to content

test: Playwright e2e tests + WS connection fix + BuildLogger variadic args#105

Merged
MarcosBrendonDePaula merged 3 commits intomainfrom
test/e2e-playwright
Mar 15, 2026
Merged

test: Playwright e2e tests + WS connection fix + BuildLogger variadic args#105
MarcosBrendonDePaula merged 3 commits intomainfrom
test/e2e-playwright

Conversation

@MarcosBrendonDePaula
Copy link
Copy Markdown
Collaborator

@MarcosBrendonDePaula MarcosBrendonDePaula commented Mar 15, 2026

Summary

  • 27 Playwright e2e tests covering all 9 routes + server API (health, users CRUD, swagger, rooms)
  • Direct WS connection to port 3000 in dev mode — eliminates Vite proxy overhead and HMR WebSocket contention (fixes connection delay)
  • Variadic ...args on BuildLogger methods (error, warn, info, success, step) — fixes 15 pre-existing tsc errors
  • AuthDemo null-safety?. and ?? [] guards on proxy state access to prevent pre-mount crashes

Test plan

  • bunx tsc --noEmit — 0 errors
  • bunx vitest run — 398 passed
  • npx playwright test — 27/27 passed

🤖 Generated with Claude Code

MarcosBrendonDePaula and others added 3 commits March 14, 2026 22:18
Add comprehensive end-to-end tests using Playwright (Chromium) that
cover all frontend routes and backend API endpoints:

- Homepage (2 tests): title, feature cards, API status
- API Test (3 tests): page render, health check call, create user
- Counter (3 tests): render sections, increment, WS connection
- Form (3 tests): render fields, connection status, field input
- Upload (2 tests): render component, upload button
- Shared Counter (2 tests): render with room info, increment
- Room Chat (3 tests): render interface, username/count, room click
- Auth (3 tests): page load, nav routing, root element
- Ping Pong (2 tests): render interface, WS connection
- Server API (4 tests): health, users CRUD, swagger, room emit

Key changes:
- Add Vite proxy for /api/ and /swagger to forward to backend (port 3000)
- Add custom Playwright fixture to auto-remove vite-plugin-checker overlay
- Configure Playwright with webServer (bun run dev) auto-start
- Add test:e2e, test:e2e:ui, test:e2e:headed scripts to package.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
AdminSection crashed the React tree by accessing undefined proxy state
properties (currentRoles.join, users.map, audit.length, audit.map)
before WS connection populates the Live Component state. Added optional
chaining and nullish coalescing for all four unsafe accesses.

Also updated auth e2e tests to assert real page content (heading, token
input, login flow) now that the page renders correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Connect WebSocket directly to port 3000 in dev mode to avoid Vite
  proxy overhead and HMR contention (fixes connection delay)
- Add variadic ...args to all BuildLogger methods (fixes 15 tsc errors)
- Remove ws:true from Vite proxy config (no longer needed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MarcosBrendonDePaula MarcosBrendonDePaula changed the title test: add 27 Playwright e2e tests covering all routes test: Playwright e2e tests + WS connection fix + BuildLogger variadic args Mar 15, 2026
@MarcosBrendonDePaula MarcosBrendonDePaula merged commit 66b83da into main Mar 15, 2026
11 checks passed
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