Get Started with Maestro

Install @testrelic/maestro-analytics alongside Maestro and capture flow analytics.

npm install package
CLI wrapper config
Run maestro as usual

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-analytics

Requires 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:

Run flows through TestRelic
npx testrelic-maestro test ./flows

Post-run parser — if you already run Maestro in CI, parse its artifacts afterwards:

Parse an existing run
maestro test --format junit --output report.xml --test-output-dir ./artifacts ./flows
npx testrelic-maestro report --junit report.xml --artifacts ./artifacts --flows-dir ./flows

Both write ./test-results/testrelic-maestro.json and ./test-results/testrelic-maestro.html and open the HTML report. Useful flags:

FlagPurpose
--output-dir <dir>Write the JSON (testrelic-maestro.json) and HTML report to this directory
--html-report <path>Explicit HTML report path
--no-openDon't open the HTML report after the run
--quietSuppress 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)
--analyzeEnable 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:

Capture network during a run
npx testrelic-maestro test --capture-network --platform android ./flows

Tune the proxy with these flags:

FlagPurpose
--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-installSkip 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:

Import an existing HAR
npx testrelic-maestro test --har-path ./run.har ./flows

mitmproxy 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.

Next steps

Was this page helpful?

On this page