testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

xunit and json reporters does not work when specifying an output file

Open pablorivera opened this issue 9 years ago • 5 comments

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

Running testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color -r xunit:report.xml returns "ERROR The provided "xunit:report.xml" reporter does not exist. Check that you have specified the report format correctly."

Running testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color -r json:report.json returns "ERROR The provided "json:report.json" reporter does not exist. Check that you have specified the report format correctly."

Without the :report.format string the reports are shown correctly in the stdout.

What is the expected behavior?

report.xml and report.json files with the sdout should be generated

How would you reproduce the current behavior (if this is a bug)?

testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color -r xunit:report.xml testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color -r json:report.json

Specify your

  • operating system: MacOs Sierra 10.12.6
  • testcafe version: 0.17.2
  • node.js version: v8.1.2

pablorivera avatar Oct 13 '17 19:10 pablorivera

Hello @pablorivera !

This feature is not supported in 0.17.2. It is implemented in 0.18.0, so try to upgrade your installation.

AndreyBelym avatar Oct 16 '17 10:10 AndreyBelym

Hi @pablorivera,

I'd like to clarify @AndreyBelym's answer. xunit and json reporters are supported in the previous TestCafe versions. In the 0.18.0 version we've introduced the feature which allows to output test results to multiple channels and specify the output file with the -r option.

So, for the 0.17.2 version the correct syntax is: testcafe chrome test.js -r xunit > report.xml (standart output redirection is used here). Since 0.18.0 you can use: testcafe chrome test.js -r xunit:report.xml or testcafe chrome test.js -r xunit:report.xml,json:report.json (built-in TestCafe syntax is used here).

Feel free to reopen the issue if you still have some problems here.

AlexanderMoskovkin avatar Oct 16 '17 22:10 AlexanderMoskovkin

Hi guys, thanks for the clarification. Upgrading to 0.18.1 worked!

pablorivera avatar Oct 17 '17 14:10 pablorivera

You are always welcome!

AlexanderMoskovkin avatar Oct 18 '17 12:10 AlexanderMoskovkin

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

lock[bot] avatar Mar 28 '19 20:03 lock[bot]