Skip to content
This repository was archived by the owner on Oct 10, 2026. It is now read-only.

Commit cf3cf87

Browse files
committed
Document agent-browser interactive test workflow in AGENTS.md
We needed a reliable, repeatable checklist for manual browser validation while a page is already open. Recent testing showed that loading `/` alone can leave the UI non-interactive unless a pane-target route is selected. Architecture decisions: - Keep this guidance in repo-level `AGENTS.md` so all contributors and agents use the same interactive verification flow. - Document the exact auto-connect + pane-discovery sequence instead of generic browser instructions to reduce false negatives during manual checks. - Include a concrete assertion command (`AGENT_BROWSER_OK`) to verify terminal input/output, not just navigation. What was implemented: - Added a new "Interactive testing with `agent-browser`" section. - Documented the quick flow for attaching to an already-running browser, switching from `/` to `/api/state.html`, and selecting a pane route. - Added explicit behavior notes about `/t/%NN` pane URLs being required for terminal interaction. - Added a minimal interaction assertion that validates terminal IO. Current state: Interactive testing instructions now cover the known routing pitfall and provide an executable sanity-check sequence for agent-browser sessions. Next steps for colleague: 1. Use this flow whenever validating live UI behavior in an already-open browser. 2. Keep the command examples updated if agent-browser CLI flags change. 3. If pane routing behavior changes, revise the "Important behavior" notes so they continue to match runtime behavior.
1 parent 0c38c76 commit cf3cf87

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,46 @@
33
We have no users.
44

55
Make changes fearlessly instead of deprecating features.
6+
7+
## E2E testing
8+
9+
Use the Playwright test to validate the browser-to-tmux flow headlessly.
10+
11+
Prerequisites:
12+
- `tmux` installed and available in `PATH`
13+
- Node.js/npm available
14+
- Go toolchain available
15+
16+
Commands:
17+
- `go test ./...`
18+
- `npm ci`
19+
- `npx playwright install chromium`
20+
- `npm run test:e2e`
21+
22+
Notes:
23+
- The E2E harness creates and tears down its own tmux session via `scripts/setup-e2e-tmux-fixture.sh`.
24+
- Keep the test headless and deterministic; do not depend on manual browser interaction.
25+
26+
## Interactive testing with `agent-browser`
27+
28+
Use `agent-browser` when you need to manually validate the running web UI in an already-open browser session.
29+
30+
Quick flow:
31+
- Attach to the running browser: `agent-browser --auto-connect tab list`
32+
- If the app is on `/`, switch to pane discovery: `agent-browser --auto-connect open http://localhost:8080/api/state.html`
33+
- Snapshot interactive controls and click a pane link (for example `@e1`):
34+
- `agent-browser --auto-connect snapshot -i`
35+
- `agent-browser --auto-connect click @e1`
36+
- Confirm you are on a pane route (`/t/%NN`) and terminal input exists:
37+
- `agent-browser --auto-connect get url`
38+
- `agent-browser --auto-connect snapshot -i`
39+
40+
Important behavior:
41+
- `/` alone is usually not interactive for terminal input because the UI needs a pane target from the URL.
42+
- Pane routes look like `/t/%13` and are required for terminal interaction.
43+
44+
Minimal interaction assertion:
45+
- `agent-browser --auto-connect fill @e1 "echo AGENT_BROWSER_OK"`
46+
- `agent-browser --auto-connect press Enter`
47+
- `agent-browser --auto-connect get text ".xterm-rows"`
48+
- Verify `AGENT_BROWSER_OK` appears in the terminal output.

0 commit comments

Comments
 (0)