.agents/skills/agent-testing/surfaces/web.md
Default surface for full-stack changes — a new/changed API plus the UI that consumes it. The browser is the one surface where network requests and UI state are observable together, so you can assert both sides of the contract in a single run.
For pure-frontend changes in a project that ships a desktop shell, prefer electron.md; for backend-only changes prefer cli.md.
The base URL, session name, and auth for the web surface come from
.agents/acceptance/PROJECT.md §4/§3. This guide is
the methodology.
PROJECT.md §2.PROJECT.md §3.Seed/verify the web session per PROJECT.md §3, then drive it. Use one named
session as the single evidence source:
SESSION=your-session # session name from PROJECT.md §4
BASE_URL=http://localhost:3000 # base URL from PROJECT.md §4
agent-browser --session $SESSION open "$BASE_URL/"
agent-browser --session $SESSION snapshot -i
# interact via refs — full command reference: ../references/agent-browser.md
Use this session as the evidence source. Do not use ordinary Chrome screenshots or Chrome Network records as proof; ordinary Chrome is only a fallback source for copying cookies into agent-browser when the seeded login is not available.
# After triggering the UI action under test:
agent-browser --session $SESSION network requests --type xhr,fetch
agent-browser --session $SESSION network requests --method POST
# Record a full HAR for the report
agent-browser --session $SESSION network har start
# ... drive the scenario ...
agent-browser --session $SESSION network har stop ./capture.har
Assert both layers: the request/response shape (network) and the rendered result (snapshot/screenshot). Both belong in the report as evidence — the network dump or HAR as a linked non-visual artifact, the rendered state as an inline screenshot.
For flows that need a real, visible browser (e.g. exercising the login UI itself):
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-test-profile \
"<URL>" &
sleep 5
agent-browser --cdp 9222 snapshot -i
# Or auto-discover a running Chrome with remote debugging
agent-browser --auto-connect snapshot -i
document.cookie is not the probe — session
cookies are often httpOnly, so it reads empty on a fully authenticated page.
Instead call any authed endpoint from the page and read the status: 401 = no
session reached the server (re-seed), 200 = you are really signed in. Only then
conclude anything about the gate.window.fetch and record each request's resolve/reject) — see
../references/probe-mock-patterns.md A.