Installations
npm install cypress-junit-reporter
Releases
Unable to fetch releases
Developer
DKnA
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.11.1
NPM Version
6.4.0
Statistics
1 Stars
110 Commits
2 Forks
5 Watching
1 Branches
1 Contributors
Updated on 03 Dec 2018
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
6,099,914
Last day
8.6%
8,997
Compared to previous day
Last week
8.2%
46,120
Compared to previous week
Last month
8.1%
193,638
Compared to previous month
Last year
-11.1%
2,244,701
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
JUnit Reporter for Cypress
Produces JUnit-style XML test results.
Installation
1$ npm install cypress-junit-reporter --save-dev
or as a global module
1$ npm install -g cypress-junit-reporter
Usage
Run mocha with cypress-junit-reporter
:
1$ mocha test --reporter cypress-junit-reporter
This will output a results file at ./test-results.xml
.
You may optionally declare an alternate location for results XML file by setting
the environment variable MOCHA_FILE
or specifying mochaFile
in reporterOptions
:
1$ MOCHA_FILE=./path_to_your/file.xml mocha test --reporter cypress-junit-reporter
or
1$ mocha test --reporter cypress-junit-reporter --reporter-options mochaFile=./path_to_your/file.xml
or
1var mocha = new Mocha({ 2 reporter: 'cypress-junit-reporter', 3 reporterOptions: { 4 mochaFile: './path_to_your/file.xml' 5 } 6});
Append properties to testsuite
You can also add properties to the report under testsuite
. This is useful if you want your CI environment to add extra build props to the report for analytics purposes
<testsuites>
<testsuite>
<properties>
<property name="BUILD_ID" value="4291"/>
</properties>
<testcase/>
<testcase/>
<testcase/>
</testsuite>
</testsuites>
To do so pass them in via env variable:
1PROPERTIES=BUILD_ID:4291 mocha test --reporter cypress-junit-reporter
or
1var mocha = new Mocha({ 2 reporter: 'cypress-junit-reporter', 3 reporterOptions: { 4 properties: { 5 BUILD_ID: 4291 6 } 7 } 8})
Results Report
Results XML filename can contain [hash]
, e.g. ./path_to_your/test-results.[hash].xml
. [hash]
is replaced by MD5 hash of test results XML. This enables support of parallel execution of multiple cypress-junit-reporter
's writing test results in separate files.
In order to display full suite title (including parents) just specify testsuitesTitle
option
1var mocha = new Mocha({ 2 reporter: 'cypress-junit-reporter', 3 reporterOptions: { 4 testsuitesTitle: true, 5 suiteTitleSeparatedBy: '.' // suites separator, default is space (' ') 6 } 7});
If you want to switch classname and name of the generated testCase XML entries, you can use the testCaseSwitchClassnameAndName
reporter option.
1var mocha = new Mocha({ 2 reporter: 'cypress-junit-reporter', 3 reporterOptions: { 4 testCaseSwitchClassnameAndName: true 5 } 6});
Here is an example of the XML output when using the testCaseSwitchClassnameAndName
option:
value | XML output |
---|---|
true | <testcase name="should behave like so" classname="Super Suite should behave like so"> |
false (default) | <testcase name="Super Suite should behave like so" classname="should behave like so"> |
You can also configure the testsuites.name
attribute by setting reporterOptions.testsuitesTitle
and the root suite's name
attribute by setting reporterOptions.rootSuiteTitle
.
Full configuration options
Parameter | Effect |
---|---|
mochaFile | configures the file to write reports to |
includePending | if set to a truthy value pending tests will be included in the report |
properties | a hash of additional properties to add to each test suite |
toConsole | if set to a truthy value the produced XML will be logged to the console |
useFullSuiteTitle | if set to a truthy value nested suites' titles will show the suite lineage |
suiteTitleSeparedBy | the character to use to separate nested suite titles. (defaults to ' ') |
testCaseSwitchClassnameAndName | set to a truthy value to switch name and classname values |
rootSuiteTitle | the name for the root suite. (defaults to 'Root Suite') |
testsuitesTitle | the name for the testsuites tag (defaults to 'Mocha Tests') |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More