0.0.2 • Published 5 months ago

mocha-ibutsu-reporter v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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

OptionShorthandDescription
configcCypress config file
projectpName of the project
componentmName of the component
outputDirdDirectory with tests results
sourcesSource from which test is run
environmenteEnvironment the test is run in
outputoName of the merged file
verbosevPrint merged results to console
helphPrints 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
0.0.2

5 months ago

0.0.1

1 year ago