Testing
The demo includes a comprehensive Playwright E2E test suite covering every feature.
E2E test coverage
- Board CRUD, note operations (create, edit, drag, delete, color, z-order)
- Board settings (title, background), persistence across refresh
- FAB menu (tidy, rearrange by color, shuffle, group by author)
- Undo/redo (Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y, textarea guard)
- Multi-user realtime sync (two browser contexts)
- Presence and cursor overlay
- Activity ticker
- Identity system and theme toggle
- Input validation (empty/long titles, XSS, invalid slugs)
- WebSocket connection leak detection
- Performance metrics (TTFB, FCP, CLS, resource sizes)
- Mobile touch (drag, double-tap create, controls visible, responsive nav)
- 1000-user cursor stress test
- Presence-only destroyer (ramp to 10K, find the connection ceiling)
- Cursor destroyer (ramp with live cursor movement)
Playwright commands
# Run everything
npm run test:e2e
# Run without the stress/destroyer tests (faster)
npx playwright test --grep-invert "Stress|Destroyer"
# Run only the stress test
npx playwright test e2e/stress.spec.js
# Run the destroyer from the server (bypass NAT limits)
node e2e/destroyer-standalone.js
node e2e/destroyer-standalone.js --cursors Tests run against https://svelte-realtime-demo.lantean.io. Change baseURL in playwright.config.js to test elsewhere.
Environment variables
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | (none) | Postgres connection string. When unset, uses in-memory store. |
REDIS_URL | redis://localhost:6379 | Redis for pub/sub, presence, cursors, and rate limiting. |
HOST | 0.0.0.0 | Server bind address. |
PORT | 3000 | Server port. |
Was this page helpful?