Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mocha-junit-reporter system-out and system-err doesn't work #4245

Closed
zainfathoni opened this issue May 19, 2019 · 6 comments
Closed

mocha-junit-reporter system-out and system-err doesn't work #4245

zainfathoni opened this issue May 19, 2019 · 6 comments
Assignees
Labels
stage: needs investigating Someone from Cypress needs to look at this topic: reporters 📄

Comments

@zainfathoni
Copy link

zainfathoni commented May 19, 2019

Current behavior:

I have this line in spec.js file.

this.test.consoleOutputs = ['consoleOutputs test']

While using junit reporter, which is actually using mocha-junit-reporter behind the scene, it generated this results/my-test-output.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="0.025" tests="1" failures="0">
  <testsuite name="Root Suite" timestamp="2019-05-19T20:48:15" tests="0" failures="0" time="0">
  </testsuite>
  <testsuite name="page" timestamp="2019-05-19T20:48:15" tests="1" failures="0" time="0.025">
    <testcase name="page works" time="0.025" classname="works">
    </testcase>
  </testsuite>
</testsuites>

Desired behavior:

As described here, mocha-junit-reporter should have generated <system-out> into the XML result file. i.e.

<system-out>consoleOutputs test</system-out>

This is the expected complete file, taken from the result file generated by mocha test.
results/mocha-test-output.xml

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="0" tests="1" failures="0">
  <testsuite name="Root Suite" timestamp="2019-05-19T21:13:41" tests="0" failures="0" time="0">
  </testsuite>
  <testsuite name="page" timestamp="2019-05-19T21:13:41" tests="1" file="/Users/nvuser/Code/zainfathoni/cypress-test-tiny/cypress/integration/spec.js" failures="0" time="0">
    <testcase name="page works" time="0" classname="works">
      <system-out>consoleOutputs test</system-out>
    </testcase>
  </testsuite>
</testsuites>

Steps to reproduce: (app code and test code)

  1. Clone this repo
  2. Run npm install
  3. Run npm run cypress:run to get the current behavior from Cypress test
  4. Run npm run mocha:test to get the desired behavior from Mocha test

Versions

  • Cypress: 3.3.0
  • mocha-junit-reporter: 1.22.0
@MoritzMeinhardt
Copy link

Is this issue going to be investigated?
I stumbled upon the same problem.

@WarpRat
Copy link

WarpRat commented Sep 9, 2022

We're having the same issue using cypress 9.5.4 which appears to include mocha-junit-reporter 2.0.0. This also seems to affect attachments.

@EmreCihanbeyoglu
Copy link

Any update?

@warrensplayer
Copy link
Contributor

@EmreCihanbeyoglu You commented on a really old issue. Can you provide any details in your case? A simple reproduction would be most helpful. Also, please make sure you are using a recent version of Cypress.

@mike-plummer
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@mike-plummer mike-plummer closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
@ashinga48
Copy link

still the same problem. Used the basic mocha-junit-reporter reporter and reporterOptions.

Properties are being appended.

https://www.npmjs.com/package/mocha-junit-reporter#append-properties-to-testsuite

But this is not working

this.test.consoleOutputs = ['consoleOutputs test']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this topic: reporters 📄
Projects
None yet
Development

No branches or pull requests

9 participants