Get your E2E tests running in 5 minutes.
# Install project dependencies
pnpm install
# Install Playwright browsers
pnpm playwright installIn your Supabase dashboard (https://app.supabase.com):
- Go to Authentication > Users
- Click Add User (manually)
- Create these 5 users:
| Password | |
|---|---|
| [email protected] | password1 |
| [email protected] | password2 |
| [email protected] | password3 |
| [email protected] | password4 |
| [email protected] | password5 |
✅ Quick tip: Use "Email" tab, not "Magic Link"
Check your .env file has:
VITE_SUPABASE_URL="your_supabase_project_url"
VITE_SUPABASE_ANON_KEY="your_anon_key"Add these minimal data-testids to get started:
<div data-testid="login-page">
<input data-testid="email-input" type="email" />
<input data-testid="password-input" type="password" />
<button data-testid="login-button">Login</button>
</div><Stage
data-testid="board-stage"
data-transform={JSON.stringify({ x: stageX, y: stageY, scale: stageScale })}
>
{/* your layers */}
</Stage><Group
data-testid={`sticky-note-${object.id}`}
// ... other props
>
{/* sticky note content */}
</Group>{isEditing && (
<div data-testid="text-edit-overlay">
<textarea data-testid="text-edit-input" />
</div>
)}# Start dev server (in one terminal)
pnpm dev
# Run a simple test (in another terminal)
pnpm playwright test mvp-requirements.spec.ts -g "User authentication" --headedYou should see a browser open, the test log in, and pass!
See e2e/DATA_TESTID_CHECKLIST.md for the complete list.
Work through them in order:
- Critical - MVP tests need these
- High - Real-time tests need these
- Medium - Board feature tests need these
- Low - Nice to have
# Run all MVP tests
pnpm playwright test mvp-requirements --headed
# Run all tests (takes 10-15 minutes)
pnpm test:e2e
# View HTML report
pnpm test:e2e:reportIf tests fail:
- Check the error message - usually tells you what's missing
- Look for missing data-testids - most common issue
- Verify test users exist in Supabase Auth
- Check console logs in the browser (headed mode)
Fix: Add the data-testid attribute to that component
Fix:
- Verify test users exist in Supabase Auth
- Check
.envhas correct credentials - Verify Supabase is running
Fix:
- Component might not have data-testid
- Increase timeout:
await expect(el).toBeVisible({ timeout: 10000 }) - Check if element is actually rendered
Fix:
- Run specific tests instead of all:
pnpm playwright test mvp-requirements - Run in single browser:
pnpm playwright test --project=chromium - Close other applications
Check off as you implement:
-
MVP Requirements (9 tests)
- User authentication works
- Board loads and displays
- Can create sticky notes
- Can create shapes
- Can pan and zoom
- Objects sync between users
- Cursors show up
- Presence works
-
Board Features (40+ tests)
- All object types work
- Transform operations work
- Selection works
-
Real-Time Collaboration (30+ tests)
- Multi-user sync works
- Disconnect/reconnect works
- State persists
-
Testing Scenarios (25+ tests)
- Simultaneous editing
- Refresh mid-edit
- Rapid operations
- Network issues
- 5+ users
-
Performance Targets (20+ tests)
- 60 FPS during operations
- <100ms object sync
- <50ms cursor sync
- 500+ objects capacity
- 5+ concurrent users
- Add feature to your codebase
- Add data-testid to new components
- Run relevant tests to verify
- Fix any failures
- Run full suite before committing
✅ DO:
- Add data-testids as you build components
- Run tests frequently during development
- Use headed mode (
--headed) to debug - Check test output carefully
❌ DON'T:
- Use class names or text for selectors
- Skip adding data-testids (tests won't work)
- Ignore test failures
- Run tests without dev server
# Run specific test file
pnpm playwright test mvp-requirements.spec.ts
# Run tests matching pattern
pnpm playwright test --grep "sticky note"
# Run in headed mode (see browser)
pnpm playwright test --headed
# Debug mode (step through)
pnpm playwright test --debug
# Run single browser
pnpm playwright test --project=chromium
# Show test report
pnpm test:e2e:report- Read error messages carefully - they usually tell you what's wrong
- Check
e2e/README.md- comprehensive documentation - Check
DATA_TESTID_CHECKLIST.md- missing testids? - Check
E2E_TEST_SUMMARY.md- overview of test suite
Once you see tests passing, you'll have:
- ✅ Verified MVP requirements
- ✅ Automated regression testing
- ✅ Performance validation
- ✅ Multi-user testing
- ✅ CI/CD readiness
Now run the full suite and watch your CollabBoard come to life! 🎉
pnpm test:e2e