-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress json reporter does not generate output file. #27636
Comments
Facing the same problem: (running Cypress v13.3.0) |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
The issue is still existing in Cypress v13.7.1. |
Any updates on this? Thanks. |
there is a plugin to solve this problem https://github.com/bahmutov/cypress-json-results but it would be far better that the "output" reporterOptions was respected |
Also, compared to a standard Mocha test, the generated output is missing the "file" property, which is generally required by tools consuming the tests result |
Current behavior
Run cypress e2e tests with a json reporter and define an output file according to the mocha documentation. The output file will not be generated, but the json output will be printed to the console.
Desired behavior
When setting --reporter json --reporterOptions output=results.json, the output file should be generated and contain the results from the test run in JSON format.
Test code to reproduce
Create a new cypress e2e project with a single test and run the e2e suite.
Configure the
cypress.config.js
and setreporter: 'json'
andreporterOptions: { output: 'testFile.json' }
.Or from the command line:
cypress run --reporter json --reporter-options "output=testFile.json"
Or check out this repository with a single e2e test and the correct configuration.
Cypress Version
12.17.4
Node version
v.18.10.0
Operating System
macOs 13.0
Debug Logs
No response
Other
The broken json reporter has quite a history, e.g. #18014, from previous issues I could not see it working for anyone. Previously there was some misunderstanding as the property to set the output file on the mocha side was renamed to
reporterOption
while the cypress configuration is namedreporterOptions
. Although mocha has made some fixes in their project, the output file still does not work. In my opinion this is because the mocha version in packages/server/package.json is set to 7.1.0. In mocha 7.1.0 the output file is not supported.The text was updated successfully, but these errors were encountered: