Get Started with Maestro
Install @testrelic/maestro-analytics alongside Maestro and capture flow analytics.
Install @testrelic/maestro-analytics next to your Maestro project. Follow the package README for the exact CLI flags and environment variables for your version.
Full guide
Detailed install steps live in the upstream package documentation. This page is a short on-ramp for the docs site.
npm install @testrelic/maestro-analyticsRequires Node.js ≥ 18 and the Maestro CLI. The package ships the testrelic-maestro CLI with two modes.
CLI wrapper (recommended) — runs maestro test for you, with no changes to your YAML flows:
npx testrelic-maestro test ./flowsPost-run parser — if you already run Maestro in CI, parse its artifacts afterwards:
maestro test --format junit --output report.xml --test-output-dir ./artifacts ./flows
npx testrelic-maestro report --junit report.xml --artifacts ./artifacts --flows-dir ./flowsBoth write ./test-results/testrelic-maestro.json and ./test-results/testrelic-maestro.html and open the HTML report. Useful flags:
| Flag | Purpose |
|---|---|
--output-dir <dir> | Write the JSON (testrelic-maestro.json) and HTML report to this directory |
--html-report <path> | Explicit HTML report path |
--no-open | Don't open the HTML report after the run |
--quiet | Suppress console output |
--platform <android|ios|web> | Target platform (test only) |
--device <id> | Device UDID (test only) |
--include-tags / --exclude-tags <tags> | Comma-separated Maestro tags (test only) |
--shards <n> | Number of parallel shards (test only) |
--config <path> | Maestro config.yaml (test only) |
-e, --env <KEY=VALUE> | Pass an environment variable to the flows (test only, repeatable) |
--analyze | Enable Maestro AI analysis so AI defects appear in the report (test only) |
Mobile network capture (v1.2.2)
Capture mobile network traffic alongside your flow run in one of two ways.
Live capture — --capture-network spawns mitmproxy, so mitmdump must be on your PATH:
npx testrelic-maestro test --capture-network --platform android ./flowsTune the proxy with these flags:
| Flag | Purpose |
|---|---|
--proxy-port <n> | Port the proxy listens on (default 8080) |
--proxy-host <host> | Host/interface for the proxy (default 127.0.0.1) |
--skip-cert-install | Skip auto-installing the mitmproxy CA certificate on the device |
--proxy-include <pat> | Only capture URLs matching this substring or regex (repeatable) |
--proxy-exclude <pat> | Drop URLs matching this substring or regex (repeatable) |
The same settings can come from the environment: TESTRELIC_CAPTURE_NETWORK=1, TESTRELIC_PROXY_PORT, TESTRELIC_PROXY_HOST and TESTRELIC_HAR_PATH. Sensitive headers (authorization, cookie, set-cookie, x-api-key) and body fields (password, secret, token, apiKey, api_key) are redacted before anything is written to disk.
Import a HAR — if you already have a capture, skip the proxy and import it:
npx testrelic-maestro test --har-path ./run.har ./flowsmitmproxy required for live capture
--capture-network needs mitmdump (from mitmproxy) installed and on PATH. If you cannot install a proxy CA, use --har-path to import a HAR instead.
Per-step detail
Maestro analytics parses the commands-*.json files Maestro emits to record per-step timing and per-step parameters (text typed, swipe direction, lat/lon), retry/repeat grouping, and assertions — surfaced per step in the cloud.