mocha-junit-reporter always sets name="<fullTitle>" and classname="<title>" regardless of testCaseSwitchClassnameAndName option value.
Option is described here: https://github.com/michaelleeallen/mocha-junit-reporter
Here is mocha-junit-reporter code: https://github.com/michaelleeallen/mocha-junit-reporter/blob/c55dc223886ec2cd050d5011e6e61c52d75d4371/index.js#L190
should switch name and classname when testCaseSwitchClassnameAndName is true
cypress.json:
{
"reporter": "junit",
"reporterOptions": {
"mochaFile": "results/[hash].xml",
"testCaseSwitchClassnameAndName": true
}
}
Cypress: 3.0.2
Browser: Electron 59 (headless)
@Karolis92 Why is it that you have reporter option set to junit and not set to mocha-junit-reporter?
@jennifer-shehane because that's what Cypress documentation states: https://docs.cypress.io/guides/tooling/reporters.html#Reporter-Options
Also documentation sates this reporter is built into Cypress, if I set reporter to "mocha-junit-reporter", I get error: Could not load reporter by name: mocha-junit-reporter
Found a problem, Cypress uses v1.13.0, but this option was added only in v1.14.0....
Will have to add mocha and mocha-junit-reporter as project dependencies for now.
So this version update should be qualified as feature request? Maybe reporters should not be bundled if you don't update them? It's probably nothing wrong for each project to include what it only needs :)
Let's see shall we! I opened a PR to bump the package dependency. https://github.com/cypress-io/cypress/pull/2224
Need to add a test case to ensure testCaseSwitchClassnameAndName option is working as expected and ensure no other tests break.
We will update the reporter, but just so you know you can always use your own reporters.
This update went out in Cypress 3.0.3, could you confirm this is fixed in that issue?
@Karolis92 Any update? We will close this issue if you do not respond.
Sorry, not working with that project anymore :) But like I said, we have put reporter dependencies to our project to be independent from cypress updates :)
@brian-mann I am installing the last version of mocha-junit-repoter but it's ignored and cypress still uses the one on it's folder.
Is possible for the cypress team to remove this dependency? I truly need the "attachment" feature wich is on the last version of mocha-junit-reporter.
I think the issue it's on this line:
Can you run the cypress command with the DEBUG logs enabled and print them here so we can see which reporter is it finding.
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.