Cypress

A guide for generating JUnit test reports for Cypress tests

1. Generate JUnit

Update your Cypress config to output JUnit reports:

cypress.config.js
const { defineConfig } = require('cypress')

module.exports = defineConfig({
  reporter: 'junit',
  reporterOptions: {
    mochaFile: 'results/junit.xml',
    toConsole: true,
  },
})

2. Output Location

The JUnit report location is specified by the mochaFile property in your Cypress config. In the above example, the file will be at results/junit.xml.

Next Step

JUnit files generated with Cypress are compatible with Trunk Flaky Tests. See CI Providers for a guide on how to upload test results to Trunk.

Last updated