Skip to main content

In CI

The trq CLI is built for pipelines: it's a single binary, runs headless, exits with a standard pass/fail code, and can emit a machine-readable report your CI system understands.

Reports

trq play --suite smoke --reporter junit --out results.xml
trq play --suite smoke --reporter json --out results.json
  • junit — a JUnit XML file most CI systems render as a test report (one test case per session).
  • json — a structured summary ({ summary, results }) for custom dashboards.

Without --out, the report is printed to standard output.

Exit codes

A run exits 0 when everything passed and 1 when anything failed — so no extra scripting is needed to fail the build.

GitHub Actions

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Cache the browser Trq downloads on first run.
- uses: actions/cache@v4
with:
path: ~/.cache/trq
key: trq-browser

- name: Install Trq CLI
run: curl -fsSL https://dl.trq.dev/install-cli.sh | sh

- name: Run tests
run: ~/.trq/bin/trq play --suite smoke --reporter junit --out results.xml

- uses: actions/upload-artifact@v4
if: always()
with:
name: trq-results
path: results.xml

Jenkins

stage('E2E') {
steps {
sh 'curl -fsSL https://dl.trq.dev/install-cli.sh | sh'
sh '~/.trq/bin/trq play --suite smoke --reporter junit --out results.xml'
}
post { always { junit 'results.xml' } }
}

Caching the browser

The first web run downloads a Chromium build and caches it under ~/.cache/trq. Cache that folder (as shown above) so later runs skip the download. To relocate the cache, set TRQ_BROWSERS_PATH. To use a browser already on the runner instead, set TRQ_CHROMIUM_BIN or TRQ_CDP_URL — see Reference.

Secrets

Keep credentials and URLs in an environment and select it per run with --env. Inject the secret values through your CI's secret store as needed.

Mobile in CI

Mobile runs need adb and a device or emulator on the runner — Trq drives them, but doesn't provide them. See Mobile.