0
votes

I am using Cypress for end to end testing, and I would like to be able to see all run test suites, in the browser, even after they are run. Currently, after each test suite is completed (test which are stored in separate files), the browser reloads and I cannot see previously run tests, and after the final test suite, the browser closes. Is there an option to change this behavior so that I can run all test files, have all the results visible in the browser and that the browser doesn't close at the end?

I am currently running tests using this command: ./node_modules/.bin/cypress run --headed --spec 'cypress/integration/tests/*' where /tests is the folder where I currently have my files.

I have added --no-exit but in this case cypress doesn't move to the next test file and only the first one runs.

2

2 Answers

0
votes

Have you read the doc :) ?

Cypress has a lot of possible command with a lot of possible config too. Read this.

And if you use npm just run like this :

npm run cypress:open

and in your package.json :

"scripts": {
   "cypress:open": "cypress open"
}
0
votes

A workaround solution could be to generate reports with Mochawsome, for each Test Spec, and then merge and view those rendered reports. The reports will contain the results from the tests, test bodies, any errors that occurred and some other bits of information.

If you read through the page in the link it shows you how to generate individual reports then combine them together, and then render them as HTML. These can then be viewed in the browser.

This command can be used to install what's needed npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generator and then add the Reporter configuration to the cypress.json:

{
  "reporter": "mochawesome",
  "reporterOptions": {
    "reportDir": "cypress/results",
    "overwrite": false,
    "html": false,
    "json": true
  }
}

Keep in mind that it may not give you the level of detail that is contained in the Cypress Dashboard in the browser, for example, what was yielded from a request.