# Detox reporter

Source: https://docs.qualflare.com/docs/reporters/detox · Last updated: 2026-10-29

Install @qualflare/detox in the Jest config Detox uses, then upload its qualflare-results folder and Detox artifacts with the Qualflare CLI.

`@qualflare/detox` is the Qualflare reporter for Detox 20 or later: it writes each run's results, with retries, steps and the iOS or Android platform, to `./qualflare-results`, and `qf <identifier> collect --artifacts-dir ./artifacts` uploads them with Detox's screenshots, videos and logs.

| Fact                 | Detail                                                                                       |
| -------------------- | -------------------------------------------------------------------------------------------- |
| Package              | [`@qualflare/detox`](https://www.npmjs.com/package/@qualflare/detox) on npm                  |
| Works with           | Detox 20 or later, Jest 29 or later, Node.js 18 or later                                     |
| qf                   | (requires qf 0.1.32 or later) for `--artifacts-dir`                                          |
| License              | Apache-2.0                                                                                   |
| Source               | [Qualflare/qualflare-detox](https://github.com/Qualflare/qualflare-detox) on GitHub          |
| Without the reporter | `--format detox` with [Detox's Jest JSON](https://docs.qualflare.com/docs/cli/formats#detox) |

## Before you begin

* The Qualflare CLI, `qf`: [Install the CLI](https://docs.qualflare.com/docs/cli/installation).
* A saved login: `qf login <identifier>` with a project access token whose creator still holds the project role that uploads need (requires the Editor role or higher in the project) ([Authenticate with qf login](https://docs.qualflare.com/docs/cli/authentication)).
* The **Identifier** of the environment the results belong to ([Environments](https://docs.qualflare.com/docs/runs/environments#identifier)).

## Install

```bash
npm install --save-dev @qualflare/detox
```

It brings `@qualflare/jest` with it.

## Configure

Add the reporter to the Jest config Detox uses, usually `e2e/jest.config.js`, and keep Detox's own reporter.

```javascript
module.exports = {
  rootDir: '..',
  testMatch: ['<rootDir>/e2e/**/*.test.js'],
  testTimeout: 120000,
  verbose: true,
  reporters: ['detox/runners/jest/reporter', '@qualflare/detox/reporter'],
  globalSetup: 'detox/runners/jest/globalSetup',
  globalTeardown: 'detox/runners/jest/globalTeardown',
  testEnvironment: 'detox/runners/jest/testEnvironment',
};
```

| Option | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `platform` | `string` | `detected` | No | `ios` or `android` from the Detox session. Set it for a device driver whose type starts with neither, or the Jest default `web` applies. |

Every other option is the [Jest reporter's](https://docs.qualflare.com/docs/reporters/jest#configure).

Every reporter shares the other settings: see [Reporter configuration](https://docs.qualflare.com/docs/reporters/configuration).

Set `environment` to the environment's Identifier: a name such as `Staging` fails the upload with HTTP 400 ([Environment](https://docs.qualflare.com/docs/reporters/configuration#environment)).

## Run and upload

```bash
detox test --configuration ios.sim.debug --take-screenshots failing --record-videos failing
qf <identifier> collect ./qualflare-results --artifacts-dir ./artifacts
```

Screenshots upload by default. Videos and device logs upload with `--upload-artifacts video,trace`.

`--artifacts-dir` takes the Detox artifacts root or one run inside it, and nothing is scanned without it: see [Attach Detox artifacts](https://docs.qualflare.com/docs/cli/artifacts#detox-artifacts-dir).

## Run in CI

```yaml
- name: Upload results to Qualflare
  if: ${{ !cancelled() }}
  env:
    QF_TOKEN: ${{ secrets.QF_TOKEN }}
    QF_BRANCH: ${{ github.head_ref || github.ref_name }}
    QF_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
  run: |
    npm install -g @qualflare/cli
    qf login ci --force
    qf ci collect ./qualflare-results --artifacts-dir ./artifacts
```

`if: ${{ !cancelled() }}` uploads the results when tests fail, and `QF_BRANCH` and `QF_COMMIT` record a pull request's own branch and commit ([Pull request branches](https://docs.qualflare.com/docs/cli/ci-cd#pull-request-branches)). For GitLab CI/CD, Jenkins and Azure Pipelines, see [Run the upload when tests fail](https://docs.qualflare.com/docs/cli/ci-cd#run-when-tests-fail).

## Sharding and retries

Artifacts attach to the test, not to each attempt: a retried test's files all attach to the one test, with the attempt in each file name. To upload several CI jobs as one launch, see [Merge sharded CI jobs into one launch](https://docs.qualflare.com/docs/cli/sharding#merge-sharded-ci-jobs).

## What gets uploaded

* Statuses, durations and the history of each retried attempt.
* Steps and your own metadata.
* The platform, `ios` or `android`.
* Detox's screenshots, videos and device logs, matched to tests by test name.

The metadata calls are `@qualflare/jest`'s, re-exported:

```javascript
import { qualflare } from '@qualflare/detox';

it('signs in', async () => {
  qualflare.label('suite', 'auth');
  await qualflare.step('tap login', async () => {
    await element(by.id('login')).tap();
  });
});
```

`qf` doesn't read the branch, commit, language or milestone from the report: set them on the upload ([Branch, commit, language and milestone](https://docs.qualflare.com/docs/reporters/configuration#upload-metadata)).

## Troubleshooting

* No artifacts: pass `--artifacts-dir`; `./artifacts` is never guessed.
* Two tests with the same full name get each other's artifacts.
* `--artifacts-dir is not supported for <format> reports`: the report isn't a Detox or Jest report.
* Multi-device runs and `detox test --device-name` are untested.
* `environment "Staging" does not exist in this project`: use the environment's Identifier, or pass `--environment` on the upload ([Environment](https://docs.qualflare.com/docs/reporters/configuration#environment)).
* Screenshots can't be downloaded: `qf` is older than 0.1.24. [Upgrade qf](https://docs.qualflare.com/docs/cli/installation#upgrading).

## Related

* **Guides:** [Reporters](https://docs.qualflare.com/docs/reporters) · [Upload results with qf collect](https://docs.qualflare.com/docs/cli/collect) · [Sharded runs and result directories](https://docs.qualflare.com/docs/cli/sharding) · [Upload screenshots, videos and traces](https://docs.qualflare.com/docs/cli/artifacts) · [Attach Detox artifacts](https://docs.qualflare.com/docs/cli/artifacts#detox-artifacts-dir)
* **Reference:** [Reporter configuration](https://docs.qualflare.com/docs/reporters/configuration) · [Detox format](https://docs.qualflare.com/docs/cli/formats#detox)
* **More:** [Detox test reporting in Qualflare](https://qualflare.com/detox-test-reporting/)
