Testing a page
Assertions
Section titled “Assertions”agent-browser-ff test assert @e3 visibleagent-browser-ff test assert @e3 hiddenagent-browser-ff test assert @e3 text "Welcome back"agent-browser-ff test assert @e4 value "abc"agent-browser-ff test assert @e8 count 5A failed assertion exits with code 5, so it works in shell scripts and CI.
Diagnose failures
Section titled “Diagnose failures”| Tool | Use |
|---|---|
screenshot --full-page |
See what the page looked like |
console --level error |
JavaScript errors |
network --filter <pattern> |
Failed or unexpected requests |
network --har <file> |
Full trace for later analysis |
video start / video stop |
Record a whole flow |
Example
Section titled “Example”agent-browser-ff open http://localhost:3000agent-browser-ff snapshotagent-browser-ff fill @e2 "test@example.com"agent-browser-ff click @e4agent-browser-ff wait text "Dashboard"agent-browser-ff test assert @e1 text "Dashboard"agent-browser-ff console --level erroragent-browser-ff closeRun headless, use --json for parsing, and rely on exit codes. Use --timeout <ms> to bound slow steps.