@probara/cli
v0.9.2
Published
Command-line tool that imports JUnit XML test results into Probara from any CI.
Maintainers
Readme
The probara command imports JUnit XML test results into Probara from any
CI. It reads the reports your test framework already writes, links each test to its Probara test
case, creates the cases that are missing, uploads the files the reports reference, and closes the
run once everything is in. It also syncs the scenarios of Gherkin .feature files, and imports the
results of Cucumber JSON reports (Gherkin), and manages the Vises of Probara
Vis: it uploads a test's recording or screenshot, with the console, network and actions of its
Playwright trace, as a new Vis, and records a page of a browser an agent drives, over the Chrome
DevTools Protocol, as a replay Vis (probara vis). It also manages the
recording links anyone records their screen with (recording links). cucumber-js reports with its attachments, at the end of the run, through @probara/cucumber-reporter.
It understands the JUnit dialects of these tools, and detects each one per file:
| Framework | Writer | Dialect |
| ---------------------- | -------------------------------- | --------------- |
| Jest | jest-junit | jest |
| pytest | --junitxml | pytest |
| Playwright | the junit reporter | playwright |
| Java (Maven) | Maven Surefire | surefire |
| Go | gotestsum --junitfile | gotestsum |
| Cypress | cypress-junit | cypress-junit |
| Vitest | vitest run --reporter=junit | vitest |
| Anything else in JUnit | any JUnit XML (testsuite tree) | generic |
Requirements
- Node.js 22.12 or later, on the machine that runs the import (a Python, Java or Go job needs Node too).
- A Probara app token, created from the JUnit XML card in Integrations
(get a token), and the code of the project to report into
(such as
SHOP). Reporting from CI needs a paid plan. Theviscommands need a personal API token instead, and no project (Probara Vis).
Install
Run it without installing, or add it to a project:
npx @probara/cli --version
npm i -D @probara/cliRun it from a checkout
To try a change that is not released yet, build this repository once, then run the built bin with Node:
git clone https://github.com/cynch-me/probara-sdk.git
cd probara-sdk
corepack enable
pnpm install
pnpm build
node packages/cli/dist/cli.js --versionTo type probara like the docs do, add an alias in the checkout:
alias probara="node $PWD/packages/cli/dist/cli.js". pnpm build builds @probara/core first;
the CLI finds it through the workspace link, so keep the checkout where it is.
Quick start (60 seconds)
Create an app token from the JUnit XML card in Integrations (get a token), and keep it in the environment. The CLI has no
--tokenflag, so the token never shows up in a process list or a CI log:export PROBARA_API_TOKEN="probara_app_your_token" export PROBARA_PROJECT=SHOPCheck what would be sent. A dry run needs no token and sends nothing:
probara import junit junit.xml --dry-runImport the report:
probara import junit junit.xml
The log goes to stderr and ends with a link to the run:
$ probara import junit junit.xml
[probara] junit.xml: jest, 10 results
[probara] Results: 10 (7 passed, 2 failed, 1 skipped, 0 blocked)
[probara] Project: SHOP
[probara] Run: new run "Automated run 2026-09-29 14:05 UTC"
[probara] Base URL: https://app.probara.net
[probara] Missing cases: created
[probara] Attachments: on
[probara] Recorded 10 results (10 new cases, 0 unmatched) in R-1 (closed): https://app.probara.net/projects/SHOP/runs/R-1[!TIP] In CI, run the same command after the tests, even when they failed. Failed tests do not fail the step: only a reporting problem does (exit codes). Pick your CI in the CI guides.
Import several files or a folder into one run, and quote globs so the shell leaves them to
probara:
probara import junit "reports/**/*.xml"
probara import junit target/surefire-reportsGitHub Actions: parallel jobs, one run
In GitHub Actions every job of one workflow run that imports without a run ULID goes into the
same run. The parallel jobs leave it open with PROBARA_CLOSE_RUN: false, and a final job closes
it, after every test job, even when they fail:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3]
steps:
# ... checkout, install, run the tests of the shard ...
- if: always()
run: npx @probara/cli import junit reports/junit.xml
env:
PROBARA_API_TOKEN: ${{ secrets.PROBARA_API_TOKEN }}
PROBARA_PROJECT: SHOP
PROBARA_CLOSE_RUN: false
probara:
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- run: npx @probara/cli run close
env:
PROBARA_API_TOKEN: ${{ secrets.PROBARA_API_TOKEN }}
PROBARA_PROJECT: SHOPA workflow Probara launched for one of its runs gets the run's ULID as the input
probara_run_id: set PROBARA_RUN_ULID: ${{ inputs.probara_run_id }} and every job reports into
that run. A single job needs none of this: its run is closed at the end. The
GitHub Actions guide has
the details.
Documentation
| Page | What it covers |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Commands | import junit, import results, import cucumber, run create, run close, sync gherkin, snap upload, snap finalize, snap wait, with their full --help |
| Gherkin | Syncing .feature files as cases, and importing Cucumber JSON results |
| Configuration | Every option, its variable and default; precedence; self-hosted Probara |
| Linking tests to cases | Case ids in names and properties, automation keys, missing cases |
| JUnit mapping and dialects | How each framework's JUnit becomes results, and how to produce it |
| Attachments | Files referenced by the reports, test output, limits |
| Exit codes | What each code means and how to fail or pass CI on purpose |
| Troubleshooting | Problems and their solutions |
| Debugging | --dry-run, --debug, --json, stdout and stderr |
| Network | Timeouts, retries, rate limits, proxies and certificates |
| Upgrading | Versioning policy and the automation key contract |
| Changelog | What changed in each version |
CI guides: GitHub Actions, GitLab CI, Jenkins, Azure Pipelines, CircleCI, Bitbucket Pipelines, Buildkite, and sharded runs.
How it works
probara parses every file before it sends anything, so one invalid file sends nothing. Each
testcase becomes a result for @probara/core, which builds its automation key, keeps every field
inside the API limits, sends the results in chunks with retries, and closes the run. Library
authors can build on @probara/core directly.
