> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/resources/reporters/currents-cmd/currents-convert.md).

# Upload JUnit XML reports

Convert JUnit XML reports of Cypress, Postman, Vitest, WebdriverIO or the Node.js test runner, or Cypress run results, to the Currents format and upload them with currents run upload

`currents run upload --input-format junit` converts JUnit XML reports to the Currents format, then uploads them. Use it for test frameworks that write JUnit XML and have no Currents reporter.

## Supported frameworks

| Framework                                                                                                          | `--framework` value |
| ------------------------------------------------------------------------------------------------------------------ | ------------------- |
| Cypress (see [Upload Cypress 13+ Results](/getting-started/other-frameworks/cypress/upload-cypress-13-results.md)) | `cypress`           |
| Postman                                                                                                            | `postman`           |
| Vitest                                                                                                             | `vitest`            |
| WebdriverIO                                                                                                        | `wdio`              |
| Node.js test runner (see [@currents/node-test-reporter](/resources/reporters/currents-node-test-reporter.md))      | `node`              |

For Cypress, `--input-format cypress-json` uploads Cypress's run results instead of JUnit reports, with every attempt, screenshot and video. See [Upload Cypress 13+ Results](/getting-started/other-frameworks/cypress/upload-cypress-13-results.md).

To request support for another framework, contact [support](/resources/support.md).

## Usage

```bash
npx currents run upload \
  --key <record-key> \
  --project-id <project-id> \
  --ci-build-id <ci-build-id> \
  --input-format junit \
  --input-file "./reports/*.xml" \
  --framework vitest
```

Quote the `--input-file` patterns, so that the command expands them and not the shell. Without quotes, a pattern that matches several files becomes several arguments, and the command fails with `error: too many arguments`.

The command saves the converted reports to `--output-dir`, or to `--report-dir`, or to a new folder in `.currents`, then uploads them. A folder you name must be empty, not exist, or hold only the reports being converted. The command fails on a folder that holds other files.

## Options

`run upload` takes these options in addition to the [upload options](/resources/reporters/currents-cmd/currents-upload.md#options).

| Option                          | Description                                                                                                                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--input-format <format>`       | The format of the reports to convert. Choices: `junit`, `cypress-json`. `cypress-json` requires `@currents/cmd` 2.3.0+.                                                              |
| `--input-file <patterns>`       | Comma-separated glob patterns of the report files, for example `"reports/*.xml,other.xml"`. Required with `--input-format`.                                                          |
| `--framework <framework>`       | The test framework that wrote the reports. Choices: `cypress`, `postman`, `node`, `vitest`, `wdio`. `cypress` requires `@currents/cmd` 2.3.0+. Required with `--input-format junit`. |
| `--framework-version <version>` | The version of the test framework that wrote the reports.                                                                                                                            |
| `-o, --output-dir <folder>`     | The folder to save the converted reports to. It must be empty, not exist, or hold only the reports being converted.                                                                  |

## Artifacts

Artifacts are files linked to a spec file (`instance`), a `test` or an `attempt`, according to the [#artifact-level](#artifact-level "mention") of the artifact.

The command reads artifacts from `<properties>` tags in the JUnit XML file:

```xml
<properties>
      <property name="currents.artifact.{level}.path" value="./artifacts/manual/coverage.json" />
      <property name="currents.artifact.{level}.type" value="coverage" />
      <property name="currents.artifact.{level}.contentType" value="application/json" />
      <property name="currents.artifact.{level}.name" value="Test Coverage" />
</properties>
```

An artifact at the attempt level also includes the attempt index:

```xml
<properties>
      <property name="currents.artifact.attempt.{n}.path" value="./artifacts/video.mp4" />
      <property name="currents.artifact.attempt.{n}.type" value="video" />
      <property name="currents.artifact.attempt.{n}.contentType" value="video/mp4" />
      <property name="currents.artifact.attempt.{n}.name" value="Test Video" />
</properties>
```

* For `instance` level artifacts, put the `<properties>` tag in a `<testsuite>` tag.
* For `test` and `attempt` level artifacts, put the `<properties>` tag in a `<testcase>` tag.

See [Data Format Reference](/resources/reporters/data-format-reference.md#artifact) for the data structure, and the [JUnit example in the repository](https://github.com/currents-dev/currents-reporter/blob/main/examples/junit/junit-attempts.xml).

#### Level <a href="#artifact-level" id="artifact-level"></a>

* `attempt`: an attempt (retry) of a test.
* `test`: a test.
* `instance`: the tests of a spec file.

#### Type <a href="#artifact-type" id="artifact-type"></a>

Each level accepts these artifact types:

* `attempt`: `video`, `screenshot`, `attachment`
* `test`: `attachment`
* `instance`: `coverage`, `attachment`, `stdout`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/resources/reporters/currents-cmd/currents-convert.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
