Cypress 10 - How to run all tests in one go?

Viewed 3550

I used to use Cypress 9 on previous projects. By default, when running cypress open or cypress open --browser chrome used to run all tests for all React components.

However I installed Cypress 10 for the first time on a project that didn't have e2e tests yet. I added test specs, but I don't see any option to run all tests altogether.

It seems I have to run the tests one by one, clicking on each of them.

Can anyone please suggest how do I run all the tests automatically?

enter image description here

3 Answers

It's been removed in Cypress v10, here are the change notes related

During cypress open, the ability to "Run all specs" and "Run filtered specs" has been removed. Please leave feedback around the removal of this feature here. Your feedback will help us make product decisions around the future of this feature.

The feedback page to register your displeasure is here


You can create a "barrel" spec to run multiple imported specs.

I can't vouch for it working the same as v9 "Run all tests", but can't see any reason why not.

// all.spec.cy.js

import './test1.spec.cy.js'    // relative paths
import './test2.spec.cy.js'
...

If Cypress Test Runner is not a must, I suggest to utilize the CLI/Node Cmd approach

You can trigger all the test(s) by npx cypress run(Still the video recording & screenshot on failed steps would be saved in the respective folders) to run all or with any other cypress flags to filter out specific spec files, or browser etc.

As per the feedback discussion there is a workaround the same as @Fody's answer that will achieve the same result as v9. Also worth noting though is the section on Continuous Integration and the Update 1 that includes a fix for preventing this workaround creating issues with the cypress run command.

Are there any current workarounds?

  • Yes. If you are impacted by the omission of this feature, it is possible to achieve the same level of parity as 9.x with a workaround Gleb Bahmutov explains here: https://glebbahmutov.com/blog/run-all-specs-cypress-v10/
  • This will still inherit the same problems as the previous implementation (which is why it was removed) but it will work in certain cases where the previous implementation was not problematic for your use case

https://github.com/cypress-io/cypress/discussions/21628#discussion-4098510

Related