## Testing: mabl

This project uses [mabl](https://www.mabl.com) for end-to-end browser
tests. The `mabl` CLI is installed and authenticated.

When a mabl test fails (CI surfaces a `*-jr` test run ID):

```bash
# 1. Find the failing step
mabl agent debug steps <jr-id>           # default: failed + recovered only; copy step_run_id

# 2. Drill into the step's artifacts. Each call returns
#    {file, size_bytes} — slice with --query / --text-only, never blindly --print MBs.
mabl agent debug artifact network <jr-id> --step-run-id <sid> \
  --query '.log.entries[] | select(.response.status >= 400)'
mabl agent debug artifact console <jr-id> --step-run-id <sid> \
  --query '[.console_logs[] | select(.level == "error")] + .javascript_exceptions'
mabl agent debug artifact dom <jr-id> --step-run-id <sid> --text-only
mabl agent debug artifact screenshot <jr-id> --step-run-id <sid>   # open `file`

# 3. Map endpoints / selectors / data-testids back to source with grep -r.
#    For regressions, the hosted `mabl` MCP server's analyze_failure tool
#    returns the last-passing-deploy commit — diff with git log.

# 4. Reproduce locally — --run-id seeds test id, browser, creds, env from the run.
#    Add --url http://localhost:<port> only when the user wants to test against
#    a local dev server instead of the host the run used.
mabl agent debug session start --run-id <jr-id>
```

ID forms: test run `*-jr`, plan run `*-pr`, test `*-j`, plan `*-p`.
Cached artifacts live under `.mabl/debug/` (auto-gitignored).

For one-shot discovery — every subcommand, full command path,
positionals and options — run
`mabl agent debug command-list` (or `mabl agent debug session
command-list` for just the session subtree). Use
`mabl agent debug <subcommand> --help` when you want yargs' formatted
text help on a single command.
