cypress

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


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


Solution

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

    As @Constance says, reinstated in v11.20.

    But still a very handy technique if you want to run a pre-defined subset of your tests.