Summary
Add end-to-end tests that exercise the full surf CLI against a real Chrome browser instance.
Background
PR #2 added the testing infrastructure with vitest. The test/e2e/ directory exists but is empty.
Scope
E2E tests should cover real browser automation scenarios:
Navigation & Reading
surf go → navigate to URL, verify page loaded
surf read → verify accessibility tree extraction
surf page.text → verify text content extraction
surf back / surf forward → history navigation
Interaction
surf click → click elements by ref, selector, coordinates
surf type → text input with/without submit
surf scroll.* → scroll operations
surf key → keyboard input
Screenshots
surf screenshot → verify image output
surf screenshot --annotate → verify element labels
surf screenshot --fullpage → full page capture
Tabs
surf tab.new / surf tab.close / surf tab.switch
surf tab.name / surf tab.switch <name>
Network Capture
- Verify requests are captured during navigation
surf network filtering options
surf network.get / surf network.body / surf network.curl
AI Queries (optional/manual)
surf chatgpt, surf gemini, surf perplexity
- These require logged-in sessions, may need to be manual or skipped in CI
Technical Considerations
- Need a strategy for launching/managing Chrome instances
- Consider using a local test server for predictable test pages
- May need longer timeouts for browser operations
- Some tests may be flaky due to timing—add retries where appropriate
Related
Summary
Add end-to-end tests that exercise the full surf CLI against a real Chrome browser instance.
Background
PR #2 added the testing infrastructure with vitest. The
test/e2e/directory exists but is empty.Scope
E2E tests should cover real browser automation scenarios:
Navigation & Reading
surf go→ navigate to URL, verify page loadedsurf read→ verify accessibility tree extractionsurf page.text→ verify text content extractionsurf back/surf forward→ history navigationInteraction
surf click→ click elements by ref, selector, coordinatessurf type→ text input with/without submitsurf scroll.*→ scroll operationssurf key→ keyboard inputScreenshots
surf screenshot→ verify image outputsurf screenshot --annotate→ verify element labelssurf screenshot --fullpage→ full page captureTabs
surf tab.new/surf tab.close/surf tab.switchsurf tab.name/surf tab.switch <name>Network Capture
surf networkfiltering optionssurf network.get/surf network.body/surf network.curlAI Queries (optional/manual)
surf chatgpt,surf gemini,surf perplexityTechnical Considerations
Related