# Auto-starts test servers on 3001/5174
npm run test:e2e # Auto-detect workers (cpus/2)
npm run test:e2e -- --workers=4 # Custom worker count
# Interactive/debug
npm run test:e2e:ui
npm run test:e2e:headed
npm run test:e2e:debug
# Utilities
npm run clean:test
npm run test:e2e:report- Dev: client
5173, server3000. - Tests: client
5174, server3001(PlaywrightwebServerhandles startup/teardown). client/src/scenes/MultiplayerScene.tsselects the server port (usingVITE_SERVER_PORTor defaults).
- 10× time acceleration is enabled in tests; use
waitScaled()utilities instead of rawwaitForTimeout(). - Isolation helpers:
setupIsolatedTest/setupMultiClientTestintests/helpers/room-utils.ts. - Time helpers:
tests/helpers/time-control.ts. - Wait helpers:
tests/helpers/wait-utils.ts,tests/helpers/deterministic-wait-utils.ts. - Test utilities:
tests/helpers/test-utils.ts,tests/helpers/test-setup.ts,tests/helpers/test-constants.ts. - Touch testing:
tests/helpers/touch-test-utils.ts.
- Authoritative server runs a fixed 30 Hz tick (
shared/src/types.ts:GAME_CONFIG). - Tests use isolated rooms per worker to avoid cross-talk.
tests/
├── helpers/ # room-utils, time-control, wait-utils, test-utils, etc.
├── config/ # Playwright project configuration
├── *.spec.ts # All spec files (13 tests across 10 files)
├── fixtures.ts # Custom test fixtures
├── global-setup.ts
└── global-teardown.ts