Docs
JUnit & Jenkins Integration

JUnit & Jenkins Integration

DeploySentinel automatically appends debug links into the stacktrace of JUnit reports so you can easily go from JUnit reports to DeploySentinel. To get started, you'll need to configure Cypress and optionally your Jenkins pipeline to produce and consume JUnit reports.

If JUnit is already set up, DeploySentinel will automatically append debug links without additional configuration.

DeploySentinel Debug URLs Appended to JUnit Reports in Jenkins:

Jenkins Demo with JUnit

Note: The JUnit integration does not currently work with cypress-multi-reporters, please contact support@deploysentinel.com for more assistance with multiple reporters.

Cypress Configuration

You'll need to enable the JUnit reporter inside of Cypress, the below config works for Cypress 10+, for Cypress 9 users - see instructions below.

cypress.config.js

const { defineConfig } = require('cypress');
 
module.exports = defineConfig({
  // ...
  reporter: 'junit',
  reporterOptions: {
    mochaFile: 'cypress/results/[hash].xml',
    toConsole: true,
  },
  // ...
  e2e: {
    // ...
  },
});

Jenkins Pipeline Configuration

If you're using Jenkins, you'll need to configure your Jenkins pipeline to consume the outputted JUnit reports. If you're consuming JUnit reports elsewhere, you'll need to ensure it can read reports from the results directory.

Jenkinsfile

pipeline {
  stages { ... }
  post {
    always {
      junit allowEmptyResults: true, testResults: '**/results/*.xml'
    }
  }
}

Cypress 9 Users

In Cypress 9, the configuration values are exactly the same as Cypress 10, but just defined in your cypress.json config file instead of a cypress.config.js file.

cypress.json

{
  "...": "...",
  "reporter": "junit",
  "reporterOptions": {
    "mochaFile": "cypress/results/[hash].xml",
    "toConsole": true
  }
}