feat: add Playwright e2e tests (30 tests, full coverage) #23

Merged
ti-paul merged 1 commit from feature/e2e-tests into main 2026-06-11 19:12:42 +00:00
Member

E2E Tests - Playwright

Priorite #1 du heartbeat: tests e2e pour tous les projets.

Couverture (30 tests)

API Tests

  • /api/health - status, uptime, memory, ws_clients
  • /api/info - board config, palette, cooldowns
  • /api/palette - 24 hex colors
  • /api/metrics - metrics snapshot
  • /api/board - binary buffer 1024x1024
  • /api/board.png - valid PNG, scale parameter
  • /api/board/region.png - region export
  • /api/session - guest session creation, cookie reuse
  • /api/register - user registration, validation (short/long username)
  • /api/profile/:userId - profile lookup, 404 for unknown
  • /api/leaderboard - array response
  • /api/history - recent placements, pixel history, limit param

Frontend Tests

  • Main page loads with canvas (#c)
  • WebSocket connects and board renders

WebSocket Tests

  • Auth handshake (info JSON + binary board)
  • Pixel placement after auth
  • Pixel placement without auth (error)
  • Broadcast to other clients
  • Chat after auth
  • Chat without auth (error)
  • Ping/pong
  • Invalid JSON error handling

Setup

npm run test:e2e

All 30 tests pass on chromium.

## E2E Tests - Playwright Priorite #1 du heartbeat: tests e2e pour tous les projets. ### Couverture (30 tests) **API Tests** - `/api/health` - status, uptime, memory, ws_clients - `/api/info` - board config, palette, cooldowns - `/api/palette` - 24 hex colors - `/api/metrics` - metrics snapshot - `/api/board` - binary buffer 1024x1024 - `/api/board.png` - valid PNG, scale parameter - `/api/board/region.png` - region export - `/api/session` - guest session creation, cookie reuse - `/api/register` - user registration, validation (short/long username) - `/api/profile/:userId` - profile lookup, 404 for unknown - `/api/leaderboard` - array response - `/api/history` - recent placements, pixel history, limit param **Frontend Tests** - Main page loads with canvas (#c) - WebSocket connects and board renders **WebSocket Tests** - Auth handshake (info JSON + binary board) - Pixel placement after auth - Pixel placement without auth (error) - Broadcast to other clients - Chat after auth - Chat without auth (error) - Ping/pong - Invalid JSON error handling ### Setup ```bash npm run test:e2e ``` All 30 tests pass on chromium.
feat: add Playwright e2e tests (30 tests, full coverage)
Some checks failed
CI / test (pull_request) Failing after 43s
7d7810f75a
E2E tests covering all main features:
- API: health, info, palette, metrics, board binary/PNG, region export
- API: auth (guest session, registration, profile, validation)
- API: leaderboard, pixel history
- Frontend: canvas rendering, WS connection
- WebSocket: auth handshake, pixel placement, broadcast, chat, ping/pong, error handling

All 30 tests pass on chromium.
ti-paul left a comment
No description provided.
Tests passent tous (30/30). Couverture complete des endpoints API, frontend UI, et WebSocket. Code propre, bien structure. LGTM.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
les_clankeurs/pixel-clash!23
No description provided.