> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The canonical docs host is https://momentic.ai/docs. Append .md to any page URL for clean Markdown. Fetch https://momentic.ai/docs/llms.txt for the page index and https://momentic.ai/docs/llms-full.txt for every page in one file.
> For an unattended setup, first check whether Claude Code already has the Momentic plugin. With the plugin, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools none` and ignore any CLI skills-install suggestion in its output. Otherwise, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools skills`. Use `--platform ios` or `--platform android` for mobile. Never run an interactive command in a non-TTY shell.
> Mo is the AI QA engineer, separate from repository YAML tests. With the Momentic plugin, use bundled mo-qa and hosted OAuth by default. Without the plugin, install only mo-qa with `npx -y qa skills --target <agent>`. Keep the requested interface. Otherwise, use hosted tools for web or mobile, including private web targets with an existing Connector. Run sessions that need a new tunnel with the qa CLI. If you can't run commands on the machine that reaches the target, ask the user to start the tunnel there, then use hosted tools unless you lack them or the CLI was requested. For a requested hosted session, use an online Connector and pass its name as access, not a CLI tunnel ID. If none is online, ask the user to run `npx -y qa tunnel start --name <name> <address>` on a machine that reaches the target and wait. Do not run login or tunnel commands for them. For a requested hosted session, report unavailable tools or authentication failures without starting a CLI session. For coding-agent bridge setup, ask the user to complete `npx -y qa login`, then add momentic-hosted as a stdio server running `npx -y qa mcp`. Plugin users must explicitly opt in and disable their hosted plugin entry before adding the bridge. Claude.ai/ChatGPT connectors keep https://mcp.momentic.ai with OAuth. After hosted testing completes, read the report and summarize findings and uncovered requirements. Call `momentic_mo_stop_session` only when the user asks or agrees. For CLI sessions, unless the user wants more testing, export the report, run `qa stop <id> --subagents` even if export fails, then summarize. The CLI is qa, not mo. Docs: https://momentic.ai/docs/mo/quickstart.md.
> Ask the user to complete browser sign-in. For local CLI tools, use the exact MOMENTIC_API_KEY environment variable. If it is absent, ask the user to create a key at https://app.momentic.ai/settings/api-keys and set it in the agent's environment. Never print the key or ask the user to paste it into chat.
> Momentic's capability summary for agents is at https://momentic.ai/docs/skill.md. Claude Code users with the Momentic plugin should use its bundled skills and skip CLI skills installation. Otherwise, run `npx momentic skills -y --target <agent>` or `npx momentic-mobile skills -y --target <agent>`. Both install momentic-test, momentic-maintain, and momentic-spec with web/mobile references. Use the running agent's target. The Momentic plugin also includes mo-qa; qa skills installs only mo-qa.
> Tests are YAML files in the user's repository. Use only the step names listed at https://momentic.ai/docs/reference/commands.md and the file structure at https://momentic.ai/docs/core-concepts/file-format.md. Do not invent step names, config keys, or CLI flags.
> Web tests run on Chromium, iOS tests on simulators, and Android tests on emulators.

# Results and reporting

> View test results in the dashboard, generate JUnit, Allure, or Playwright JSON reports, and surface failures in CI.

Momentic produces results in two places:

1. **The dashboard** at [app.momentic.ai](https://app.momentic.ai): uploaded run
   data with videos, traces, auto-heal history, and quarantine state.
2. **Local reports**: JUnit XML, Allure, Playwright JSON, or Buildkite JSON, for
   feeding into other CI tooling.

![Passing iOS assertion in the dashboard with the Momentic Files demo app screenshot](https://mintcdn.com/momentic-docs/17J9Wud_ddzsCPQS/images/running-tests/ios-assertion-result.png?fit=max\&auto=format\&n=17J9Wud_ddzsCPQS\&q=85\&s=4e7c98f63302cf6b6321d9ad20c03031)

Open a step to inspect its result and simulator screenshot

## Uploading to the dashboard

Pass the upload flag on any `run` invocation:

```bash Web theme={null}
npx momentic run --upload-results
```

```bash Mobile theme={null}
npx momentic-mobile run --upload-results
```

Uploaded runs appear in the dashboard's **Runs** view. Authenticate with a saved
login, `MOMENTIC_API_KEY`, or the CLI's `--api-key` option.

Without `--upload-results`, result artifacts stay on your machine. Execution
still sends data to Momentic; see [AI data use](https://momentic.ai/docs/account/ai-data-use.md).

Open the assertion step's screenshot to confirm the app reached the expected
state. For a failed run, check the app URL or selected mobile build, sign-in
state, and assertion before editing the test and rerunning it. See
[Common problems](https://momentic.ai/docs/account/common-problems.md) for setup errors.

### Group independent invocations

If your orchestrator starts separate CLI processes for one batch, generate one
UUID and pass it to every invocation:

```bash theme={null}
BATCH_UUID=$(node -e 'process.stdout.write(crypto.randomUUID())')
momentic run path/to/checkout.test.yaml \
  --run-group-id "$BATCH_UUID" \
  --upload-results
momentic run path/to/refunds.test.yaml \
  --run-group-id "$BATCH_UUID" \
  --upload-results
```

The value must be a UUID. See
[`--run-group-id`](https://momentic.ai/docs/cli-reference/momentic/commands/run#run-group-id-rungroupid)
for the flag reference.

Every invocation uploads independently, including deferred
`momentic results upload` calls. After Momentic indexes the uploads, their
physical runs appear in the same run group.

This is an eventually consistent group, not a finalized batch:

* Use the same UUID and consistent suite, project, and Git metadata for every
  invocation.
* Upload each result directory separately; do not merge the archives first.
* After submitting every upload, start triage immediately with the shared UUID.
  Triage waits for normal upload indexing, not for the run group to assemble.

Every uploaded run shows:

* **Status**: pass, fail, flaky, quarantined, cancelled
* **Duration** and **cost**: time the run took plus AI token usage
* **Environment** and **branch**: which env and Git branch the run targeted
* **Trigger**: CLI, API, scheduled, or manual

### Filtering

Filter runs by test name or label, environment or branch, status, time range, or
trigger type. Saved filters live in the left sidebar.

### Drilling into a run

Each run page shows every step with its status, duration, and artifacts. Click a
step to view:

* Video replay and screenshots.
* Traces (DOM, network, console).
* [Auto-heal](https://momentic.ai/docs/reliability/auto-maintenance.md#locator-auto-healing) traces when
  healing fired.
* AI reasoning.

For steps that used element location, the detail pane also includes a **Cache**
section showing whether the step used cache, missed cache, busted cache before
use, or had no cache, along with the reason when available.

In the dashboard, the **Cache** section of a cached step also lets you inspect
and invalidate the entry without leaving the run. This works for web and mobile
runs, however they were triggered:

* Expand **Cached value** to read the stored locator or assertion result.
* Choose **Clear step cache** to drop the entry; the next run re-resolves the
  step with AI. A run on a feature branch clears the entry for that branch only;
  a run on your main branch clears it everywhere.

The result tree keeps nested and repeated step structures compact:

* Conditional rows read as `If ...` and show the evaluated outcome inline as
  `= true` or `= false`.
* Retried steps collapse to one final row with a retry count; expand it to see
  each `Attempt N`.
* While loops expand into `Iteration N` groups so each pass through the body is
  inspectable.

You can also inspect the same run UI locally against a folder of run results
using [`momentic results view`](https://momentic.ai/docs/cli-reference/momentic/commands/results#view)
(or
[`momentic-mobile results view`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/results#view)
for mobile).

### Sharing

Each run has a shareable URL. Team members with workspace access can open it
directly.

## Generating local reports

Pass `--reporter` to `run` to emit a standardized report file into the
[`reporterDir`](https://momentic.ai/docs/configuration/momentic-config#reporterdir) (defaults to
`./reports`):

```bash Web theme={null}
npx momentic run --reporter junit
```

```bash Mobile theme={null}
npx momentic-mobile run --reporter junit
```

Supported formats:

| Format | Web | Mobile | Notes |
| - | - | - | - |
| `json` | Yes | Yes | Momentic JSON report with structured run results and classifications. |
| `junit` | Yes | Yes | JUnit XML. Drops into any CI system that surfaces JUnit. |
| `allure` | Yes | Yes | [Allure](https://allurereport.org/) result directory. |
| `allure-json` | Yes | Yes | Allure JSON results (one file per test). |
| `playwright-json` | Yes | No | Playwright-style JSON report. |
| `buildkite-json` | Yes | Yes | [Buildkite Test Analytics](https://buildkite.com/docs/test-analytics) JSON format. |
| `newrelic` | Yes | No | Pushes custom events to [New Relic](https://momentic.ai/docs/guides/reporting.md#push-run-results-to-new-relic) instead of writing a file. |

See [`momentic run`](https://momentic.ai/docs/cli-reference/momentic/commands/run#reporter-reporter) and
[`momentic-mobile run`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/run#reporter-reporter)
for the full CLI flag reference.

Real output from
`npx momentic run login.test.yaml --reporter junit --reporter json` against a
one-test project:

```xml reports/<project>.xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" failures="0" errors="0" skipped="0">
  <testsuite name="docs-demo" timestamp="2026-09-14T05:04:47" time="7.017" tests="1" failures="0" errors="0" skipped="0">
    <properties>
      <property name="startedAt" value="2026-09-14T05:04:47.152Z"/>
      <property name="finishedAt" value="2026-09-14T05:04:54.169Z"/>
    </properties>
    <testcase name="login" classname="login" file="login.test.yaml" time="5.93">
      <properties>
        <property name="id" value="demo-login"/>
        <property name="base_url" value="https://practicetestautomation.com/practice-test-login/"/>
        <property name="run_url" value="https://app.momentic.ai/runs/6262de8f-b695-4df9-a0c5-d45f285293d9"/>
        <property name="started_at" value="2026-09-14T05:04:47.404Z"/>
        <property name="finished_at" value="2026-09-14T05:04:53.334Z"/>
        <property name="attempts" value="1"/>
      </properties>
    </testcase>
  </testsuite>
</testsuites>
```

```json reports/<project>.momentic.json theme={null}
{
  "version": 1,
  "runGroup": {
    "startedAt": "2026-09-14T05:04:47.152Z",
    "finishedAt": "2026-09-14T05:04:54.172Z",
    "durationMs": 7020
  },
  "summary": {
    "total": 1,
    "executed": 1,
    "skipped": 0,
    "passed": 1,
    "failed": 0,
    "cancelled": 0,
    "quarantined": 0,
    "recovered": 0
  },
  "runs": [
    {
      "runId": "6262de8f-b695-4df9-a0c5-d45f285293d9",
      "testId": "demo-login",
      "testName": "login",
      "filePath": "login.test.yaml",
      "labels": [],
      "status": "PASSED",
      "startedAt": "2026-09-14T05:04:47.404Z",
      "finishedAt": "2026-09-14T05:04:53.334Z",
      "durationMs": 5930,
      "attempts": 1,
      "quarantined": false,
      "recovered": false,
      "parameters": {},
      "failure": null,
      "classification": null
    }
  ],
  "skipped": []
}
```

Each testcase carries a pointer back to the full run: `run_url` in JUnit is the
dashboard link directly; `runId` in JSON is the identifier, so build the link as
`https://app.momentic.ai/runs/<runId>`.

To receive each web CLI test's final result before the run group finishes,
configure a
[test-result hook](https://momentic.ai/docs/configuration/momentic-config.md#cli-test-result-hooks).

## Live run progress

While a run is in flight, `momentic run` and `momentic-mobile run` write a
`progress.json` file to the top of the
[`--output-dir`](https://momentic.ai/docs/cli-reference/momentic/commands/run#output) (defaults to
`./test-results`). It is updated as steps complete, so you can poll it to track
long runs (for example, to report that a test has finished "53 of 70 steps") or
forward it to your own reporting pipeline.

The file holds an aggregate roll-up plus one entry per test run:

```json theme={null}
{
  "schemaVersion": "1.0.0",
  "runGroupId": "3f1a6b0c-9d84-4d1e-8f0a-2c7b5e6d9a11",
  "status": "RUNNING",
  "totalRuns": 2,
  "completedRuns": 1,
  "completedSteps": 123,
  "totalSteps": 140,
  "startedAt": "2026-06-13T03:11:00.000Z",
  "updatedAt": "2026-06-13T03:12:04.000Z",
  "runs": [
    {
      "runId": "01J...",
      "testId": "abc123",
      "testName": "checkout/happy-path",
      "directory": "checkout",
      "status": "PASSED",
      "completedSteps": 70,
      "totalSteps": 70,
      "startedAt": "2026-06-13T03:11:00.000Z",
      "updatedAt": "2026-06-13T03:11:48.000Z"
    },
    {
      "runId": "01J...",
      "testName": "checkout/coupon",
      "status": "RUNNING",
      "completedSteps": 53,
      "totalSteps": 70,
      "startedAt": "2026-06-13T03:11:48.000Z",
      "updatedAt": "2026-06-13T03:12:04.000Z"
    }
  ]
}
```

Notes on the counts:

* `totalSteps` initially counts the run's resolved top-level `before`, main, and
  `after` steps. `completedSteps` counts terminal step results and excludes
  steps added by failure recovery. If completed results exceed the initial
  total, the writer raises `totalSteps` to match; treat it as progress, not a
  fixed percentage for every nested or retried flow.
* The file is written atomically and updated on a short throttle, so a reader
  always sees a complete, valid JSON document.
* When tests are sharded across multiple machines, each shard has its own
  `--output-dir` and therefore its own `progress.json`. When tests run across
  parallel workers on a single machine, the parent process writes one merged
  `progress.json` covering all workers.

## CI integration

Every [CI/CD template](https://momentic.ai/docs/running-tests/ci/github-actions.md) uploads results by
default. See your CI provider's page for the ready-to-paste config.

## Artifacts

Failed runs include:

* **Video**: enable via
  [`recordVideo`](https://momentic.ai/docs/configuration/momentic-config#recordvideo) in
  `momentic.config.yaml`
* **Trace**: always captured on failure
* **Screenshots**: captured at each step
* **Auto-heal traces**: shown in the run viewer when
  [auto-heal](https://momentic.ai/docs/reliability/auto-maintenance.md#locator-auto-healing) fires

Uploaded artifacts are visible in the dashboard. Local run archives live under
[`outputDir`](https://momentic.ai/docs/configuration/momentic-config#outputdir), which defaults to
`./test-results`; standardized report files live under
[`reporterDir`](https://momentic.ai/docs/configuration/momentic-config#reporterdir).

Each run's `metadata.json` includes a `usage` object with the credits used and
`stepsExecuted`, a weighted step count. Counted steps within an AI action have a
weight of 2. Use these fields to total usage per test in a script. Requires
`momentic` `3.61.0` or `momentic-mobile` `1.35.0`:

```json metadata.json theme={null}
{
  "usage": { "creditsUsed": 3, "stepsExecuted": 3 }
}
```

## Viewing runs outside the dashboard

The result viewer that powers `momentic results view` also ships as a static
bundle you can host yourself. Use it to serve run results from your own
infrastructure. See
[Self-host the result viewer](https://momentic.ai/docs/guides/reporting.md#self-host-the-result-viewer).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.