Exports results from Cypress test run and merges them into an XML file, which can be uploaded to Ibutsu.
npm install mocha-ibutsu-reporter
In your Cypress config file, set the reporter
option to mocha-ibutsu-reporter
. Files are by default
exported to cypress/results/
directory and can be set by user using the outputDir
option, the path
is relative to the cypress config file.
const { defineConfig } = require('cypress')
module.exports = defineConfig({
reporter: 'mocha-ibutsu-reporter',
reporterOptions: {
project: 'my-project',
component: 'my-component',
outputDir: 'results/',
},
})
import { defineConfig } from 'cypress'
export default defineConfig({
reporter: 'mocha-ibutsu-reporter',
reporterOptions: {
project: 'my-project',
component: 'my-component',
outputDir: 'results/',
},
})
{
"reporter": "mocha-ibutsu-reporter",
"reporterOptions": {
"project": "my-project",
"component": "my-component",
"outputDir": "cypress/results/"
}
}
Results are merged using the merge-results
command. If no output file is set, results are by default
exported to .ibutsu.xml
file with UUIDv4 set as its name, and can be found in the directory with
individual result files. Any options set in the cypress config file can be overriden by passing
options to the CLI program.
Option | Shorthand | Description |
---|---|---|
config | c | Cypress config file |
project | p | Name of the project |
component | m | Name of the component |
outputDir | d | Directory with tests results |
source | s | Source from which test is run |
environment | e | Environment the test is run in |
output | o | Name of the merged file |
verbose | v | Print merged results to console |
help | h | Prints usage of the command |
NOTE: For more information about the purpose of each field, see Ibutsu’s documentation
merge-results -c cypress.json -e local -o ~/results/exported_results.xml