Skip to content

Latest commit

 

History

History
99 lines (67 loc) · 4.94 KB

others.md

File metadata and controls

99 lines (67 loc) · 4.94 KB
description icon
Integrate Currents with any framework by using JUnit compatible XML reporters
grid

Others

Currents has flagship integrations with various testing frameworks via the dedicated reporters (like playwright, jest, currents-node-test-reporter.md and cypress).

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 package.

Send results from any framework that supports JUnit XML format

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, ands other 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.

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 %}

Conver JUnit XML file

Run currents-convert.md command to convert JUnit XML report to a format compatible with Currents {% endstep %}

{% step %}

Upload the results to Currents

Run currents-upload.mdcommand to send the results to Currents for processing {% endstep %} {% endstepper %}

Setup

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

FrameworkInstructions
Vitesthttps://vitest.dev/guide/reporters#junit-reporter
NodeJS Test Runnerhttps://nodejs.org/api/test.html#test-reporters
WebdriverIOhttps://webdriver.io/docs/junit-reporter/
Cypresshttps://github.com/michaelleeallen/mocha-junit-reporter
Postman (Newman)https://github.com/postmanlabs/newman?tab=readme-ov-file#junitxml-reporter

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 the JUnit XML report

Use currents-convert.md command to convert JUnit format to internal Currents format. Refer to currents-convert.md documentation for the list of supported formats and frameworks.

For example:

npx currents convert \
  --input-format=junit \
  --input-file=junit-file.xml \
  --output-dir=.currents \
  --framework=postman \
  --framework-version=v11.2.0

Upload the results

Use currents-upload.md command to send the results to Currents. Get a Record key and Project ID from Currents dashboard.

npx currents upload --project-id=xxx --key=yyy

Example

Check out the example repository that demonstrates how to generate and report test results from various testing frameworks to Currents.