> 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/getting-started/other-frameworks/others.md).

# JUnit

Integrate Currents with any framework by using JUnit compatible XML reporters

Currents has flagship integrations with various testing frameworks via the dedicated reporters (like Playwright, [Jest](/getting-started/other-frameworks/jest.md), [@currents/node-test-reporter](/resources/reporters/currents-node-test-reporter.md) and [Cypress](/getting-started/other-frameworks/cypress.md)), and framework-specific instructions for [Vitest](/getting-started/other-frameworks/vitest.md).

Integration with other frameworks is possible by uploading a JUnit XML (or compatible) test results report to Currents using our CLI utilities from [@currents/cmd](/resources/reporters/currents-cmd.md) package.

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2F4OSkXqAXDtov9kbU1k6n%2FJunit%20XML%20reporter.png?alt=media&amp;token=57efd7ca-fbd5-4e86-9338-5c68ed8f3f84" alt=""><figcaption><p>Send results from any framework that supports JUnit XML format</p></figcaption></figure>

> JUnit is an XML document used to represent the outcomes of automated tests. It is widely adopted for test reporting in CI/CD pipelines, allowing CI tools like Jenkins, GitHub Actions, and others to parse and display test results.
>
> JUnit reports typically contains information about:
>
> * Test suites - groups of test cases (e.g., a set of related tests)
> * Test cases - individual test scenarios with details like execution time, status (pass/fail), and optional logs (e.g., errors or skipped messages)
>
> See a detailed [example of a complete JUnit XML file](https://github.com/testmoapp/junitxml?tab=readme-ov-file#complete-junit-xml-example).

### Overview

A typical workflow for reporting JUnit XML results to Currents:

{% stepper %}
{% step %}

#### Configure testing framework

Configure your testing tool to generate the results in JUnit XML format
{% endstep %}

{% step %}

#### Run the tests

Run the tests and save the test results at a known location
{% endstep %}

{% step %}

#### Convert and upload the results to Currents

Run `currents run upload --input-format junit` with `--input-file` and `--framework` to convert the JUnit XML report to the Currents format and send it to Currents. See [Upload JUnit XML reports](/resources/reporters/currents-cmd/currents-convert.md).
{% endstep %}
{% endstepper %}

### Setup

* Install [@currents/cmd](/resources/reporters/currents-cmd.md) package

```bash
npm i @currents/cmd
```

### Run the tests

Refer to your framework documentation or contact Currents support for help with enabling JUnit reporter for your framework

<table><thead><tr><th width="232">Framework</th><th>Instructions</th></tr></thead><tbody><tr><td>Vitest</td><td><a href="/getting-started/other-frameworks/vitest.md">Vitest</a></td></tr><tr><td>NodeJS Test Runner</td><td><a href="https://nodejs.org/api/test.html#test-reporters">https://nodejs.org/api/test.html#test-reporters</a></td></tr><tr><td>WebdriverIO</td><td><a href="https://webdriver.io/docs/junit-reporter/">https://webdriver.io/docs/junit-reporter/</a></td></tr><tr><td>Cypress</td><td><a href="https://github.com/michaelleeallen/mocha-junit-reporter">https://github.com/michaelleeallen/mocha-junit-reporter</a></td></tr><tr><td>Postman (Newman)</td><td><a href="https://github.com/postmanlabs/newman?tab=readme-ov-file#junitxml-reporter">https://github.com/postmanlabs/newman?tab=readme-ov-file#junitxml-reporter</a></td></tr></tbody></table>

When running the tests, make sure to save the results at a known location - you will need to provide path to the generated files later.

### Convert and upload the results

`currents run upload --input-format junit` converts the JUnit XML report to the Currents format and uploads it. Get a [Record key](/guides/record-key.md) and [Project ID](/dashboard/projects.md) from the Currents dashboard. See [Upload JUnit XML reports](/resources/reporters/currents-cmd/currents-convert.md) for the supported frameworks.

```bash
npx currents run upload \
  --project-id=xxx \
  --key=yyy \
  --input-format=junit \
  --input-file=junit-file.xml \
  --framework=postman \
  --framework-version=v11.2.0
```

### Example

Check out the [example repository](https://github.com/currents-dev/currents-junit-xml-example) that demonstrates how to generate and report test results from various testing frameworks to Currents.

* [Postman](https://github.com/currents-dev/currents-junit-xml-example/tree/main/packages/postman)
* [Vitest](https://github.com/currents-dev/currents-junit-xml-example/tree/main/packages/vitest)
* [NodeJS Test Runner](https://github.com/currents-dev/currents-junit-xml-example/tree/main/packages/nodejs-test-runner)
* [WebdriverIO](https://github.com/currents-dev/currents-junit-xml-example/tree/main/packages/wdio)


---

# 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/getting-started/other-frameworks/others.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.
