bahmutov / cypress-json-results

Saves Cypress test results as a JSON file
9 stars 4 forks source link

The result is overwriting previous result #31

Open aaksu13 opened 1 year ago

aaksu13 commented 1 year ago

I want to report in json format using the cypress-json-results plugin, but results are overwritten the json file for every run command sent from the local. How can I prevent this? Is it possible to open a new section in the json file for the result of each run command ?

bahmutov commented 1 year ago

I am sorry, I don't understand. What do you mean by "every run command sent from the local"? Are you doing something like

npx cypress run
// writes json results
npx cypress run
// overwrites json results

or do you mean that json results from one spec overwrite json results from previous spec?

aaksu13 commented 1 year ago

I mean is that json results from one spec are overwritten with json results from the previous spec. Is there any way to keep all results in json file without overwriting ?

bahmutov commented 1 year ago

I don't think this is true. Look at the CI for this repo, for example https://github.com/bahmutov/cypress-json-results/actions/runs/6341068720/job/17223878339 It shows two specs results in the same results JSON file

Screenshot 2023-09-29 at 08 50 33