You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 set reporter: 'json' and reporterOptions: { 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 named reporterOptions. 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:
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.
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: