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

Cypress json reporter does not generate output file. #27636

Open
lukasdo opened this issue Aug 23, 2023 · 3 comments
Open

Cypress json reporter does not generate output file. #27636

lukasdo opened this issue Aug 23, 2023 · 3 comments

Comments

@lukasdo
Copy link

lukasdo commented Aug 23, 2023

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 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.

@ctschacher
Copy link

Facing the same problem:
JSON output visible in command line (unfortunately mixed with standard text output) but no JSON file is created

(running Cypress v13.3.0)

@cypress-app-bot
Copy link
Collaborator

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.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Mar 27, 2024
@lukasdo
Copy link
Author

lukasdo commented Mar 28, 2024

The issue is still existing in Cypress v13.7.1.

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants