0.0.2 • Published 5 months ago
mocha-ibutsu-reporter v0.0.2
Mocha Ibutsu reporter
Exports results from Cypress test run and merges them into an XML file, which can be uploaded to Ibutsu.
Table of contents
Installation
npm install mocha-ibutsu-reporter
Usage
Generating test results
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.
JS configuration
const { defineConfig } = require('cypress')
module.exports = defineConfig({
reporter: 'mocha-ibutsu-reporter',
reporterOptions: {
project: 'my-project',
component: 'my-component',
outputDir: 'results/',
},
})
TS configuration
import { defineConfig } from 'cypress'
export default defineConfig({
reporter: 'mocha-ibutsu-reporter',
reporterOptions: {
project: 'my-project',
component: 'my-component',
outputDir: 'results/',
},
})
JSON configuration
{
"reporter": "mocha-ibutsu-reporter",
"reporterOptions": {
"project": "my-project",
"component": "my-component",
"outputDir": "cypress/results/"
}
}
Merging files
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.
Options
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
Example
merge-results -c cypress.json -e local -o ~/results/exported_results.xml