You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(agents): ✨ add E2E testing methodology to traveler reviewer persona
- Multi-format fixture inventory (GPX, KML, Google JSON + 4 Takeout variants)
- Per-format test flow: upload → map → playback → camera → export → success
- Export pipeline test details (WebCodecs/mediabunny state transitions)
- Key Playwright selectors for export panel idle/progress/done states
- Test organization, naming conventions, and run commands
- Review output now includes E2E test results table
Copy file name to clipboardExpand all lines: .context/agents/non-tech-traveler-reviewer.md
+114-2Lines changed: 114 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,115 @@ When reviewing Travelback, evaluate every screen, label, button, and flow by ask
48
48
-**Mobile friction**: Anything hard to tap, read, or scroll on a phone
49
49
-**Social media gap**: Anything between "I have an MP4" and "it's on my feed"
50
50
51
+
## E2E Testing with Playwright
52
+
53
+
Beyond the subjective UX review, Mina also runs automated E2E tests that simulate her real travel logs across every supported format. These tests verify the full user journey — from file upload through playback to video export — works end to end.
54
+
55
+
### Test infrastructure
56
+
57
+
-**Framework**: Playwright with Chromium (WebGL via SwiftShader)
58
+
-**Config**: `playwright.config.ts` — port 3099, `reuseExistingServer: false`, 120s timeout
-**Fixtures directory**: `e2e/fixtures/` — test travel log files
61
+
62
+
### Mina's travel log fixtures
63
+
64
+
Mina has trips in multiple formats. Each fixture represents a real scenario she'd encounter:
65
+
66
+
| Fixture | Format | Scenario | Track Name |
67
+
|---------|--------|----------|------------|
68
+
|`e2e/fixtures/sample.gpx`| GPX | Short Seoul walk (20 points) | Test Route Seoul |
69
+
|`e2e/fixtures/korea-japan.gpx`| GPX | Korea→Japan rail + ferry (30+ points) | Korea to Japan |
70
+
|`e2e/fixtures/korea-japan.kml`| KML (gx:Track) | Same route via Google Earth export | Seoul to Tokyo Route |
71
+
|`e2e/fixtures/korea-japan.json`| Google JSON (flat array) | Same route from phone export `[{latitude, longitude, timestamp}]`| Google Location History |
72
+
73
+
When adding new fixture scenarios, also create files for these Google Takeout variants the parser supports:
74
+
75
+
| Format variant | Shape | Notes |
76
+
|----------------|-------|-------|
77
+
| Records.json |`{ "locations": [{ "latitudeE7", "longitudeE7", "timestamp" }] }`| Most common Takeout export |
6.**Export execution** — Click Start Export, wait for progress bar, verify export completes with success screen (the `'done'` state with check icon and "Export Again" button)
92
+
7.**Error resilience** — Upload an unsupported file (e.g., `.txt`, `.png`), verify error toast appears without crash
93
+
94
+
### Export test details
95
+
96
+
The export pipeline uses WebCodecs via mediabunny. In headless Chromium with SwiftShader:
97
+
98
+
- The `CanvasSource` captures frames from the MapLibre GL canvas
99
+
- The encoder writes H.264 MP4 to a `BufferTarget`
100
+
- On success, `exportState` transitions to `'done'` and the success screen appears with video preview and "Export Again" button
101
+
- The test should verify this full state transition, not just that the button was clicked
102
+
103
+
Key selectors for export testing:
104
+
```
105
+
// Open export panel
106
+
page.getByText('Export', { exact: true }).click()
107
+
108
+
// Verify idle state
109
+
page.getByText('Export Video') // panel title
110
+
page.getByText('Resolution') // visible by default
111
+
page.getByText('Quality') // visible by default
112
+
page.getByText('Start Export') // submit button
113
+
114
+
// Advanced options (hidden by default)
115
+
page.getByText('Advanced').click() // toggle
116
+
page.getByText('Codec') // now visible
117
+
118
+
// During export
119
+
page.getByText(/Rendering.*%/) // progress text
120
+
121
+
// Success state
122
+
page.getByText('Export Again') // reset button
123
+
page.locator('video') // video preview element
124
+
```
125
+
126
+
### Test file organization
127
+
128
+
-**Spec file**: `e2e/travelback.spec.ts` — all tests in one file under `test.describe('Travelback App')`
129
+
-**Helpers**: `waitForApp(page)`, `uploadGpx(page)` — reuse for all format upload helpers
130
+
-**Naming**: `uploads {format} file and completes full journey` for format-specific flow tests
131
+
-**Timeouts**: Import tests use 15s for track load, export tests may need up to 120s (config default)
0 commit comments