'Run all specs' removal in Cypress 10 #21628
Replies: 101 comments 131 replies
-
While I wouldn't say it was particularly important, I would use the run by a filtered set fairly regularly. Usually when I updated a test and wanted to run other tests for a given area just as a small sanity check. We tend to break out tests into more spec files in my current setup, as opposed to more 'it' blocks in a file, so that is another reason this is likely more useful. I'm also wondering if the change for this is partly from concerns that running many tests at once can cause memory issues with all the DOM snapshots and perhaps other data that gets saved in a run? Mostly curious. And I guess I would just emphasize again that I'm much more concerned with running some subset of tests as opposed to running 'all tests'. I still like a lot of the suggestions in issue #1586 :) |
Beta Was this translation helpful? Give feedback.
-
From my perspective, it's something that affects the workflow, it was a nice feature that helped when I wanted to run my entire regression test suite (visually tracking the execution). |
Beta Was this translation helpful? Give feedback.
-
Part of our team workflow is testing using the |
Beta Was this translation helpful? Give feedback.
-
I'm a little confused - i read the ticket linked in the description #1586 but it didn't clear up the reason that "Run all specs" was removed. You mentioned brining parity with running specs during I often run all of my tests locally so I can get a visual indication on what tests failed and have the results immediately available to look at & interact with. Granted, i have a small test suite so I haven't run into any performance issues that may be affecting larger projects. One reason I may want to run all specs interactively is that I may have made a change to my codebase that would affect multiple test suites, and i'm using cypress actively while I develop. It's nice to just hit "run all tests" to make sure i didn't break anything. Version 10 is looking really cool, and I hope that I can get the component testing working with my Next.js project soon. |
Beta Was this translation helpful? Give feedback.
-
Why have you implemented this horrible idea to remove filtered specs and run all specs ?
|
Beta Was this translation helpful? Give feedback.
-
First of all, thank you for Cypress 10! This is crazy cool! But I ask you to please revert "Run all specs" back. How can I run my 200+ tests with Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Yeah! we need this back - be able to run a single/set of tests. |
Beta Was this translation helpful? Give feedback.
-
I think removing this features is a huge loss. My workflow is that I start Cypress.exe in global mode so I'm able to use just one instance of Cypress over a variety of Cypress projects (and switch between them very easily). I don't see the point of starting a new instance with "cypress run" and fiddling around with "cypress run --spec ...". Most of the time I just need to analyze and run a single test (i.e. if it's flaky) or a group of tests within the same folder. With the possibility to just type a partial name of the test in the input field, which filters the specs, it is extremely handy and quick to do so. Alltough there is an issue when filtering specs with for example "my test" Cypress can't run the filtered tests using "Run X integration specs" (probably because of different filtering mechanics in the UI and with the "specs" option?).. but at least you can start each spec on it's own. I rarely use "cypress run" locally; I'd rather run all the specs via "cypress open" so I can analyze errors directly in the command log. Screenshots and videos are often not enough; it just gives an idea what you probably have to fix. But to get the full picture I always rerun the test via "cypress open". I only use "cypress run" when running the tests in CI. Please bring this feature back ❤ |
Beta Was this translation helpful? Give feedback.
-
This functionality was simple & great and it being removed is making me regret upgrading, even though I love many of the changes in Also I'd love it if this functionality can be added again so we can upgrade our other projects 🔥 |
Beta Was this translation helpful? Give feedback.
-
In my opinion, this feature is a must have in most project. Now we either have to run a Thanks alot for all the effort you guys put in the new version though ! It is pretty impressive ! |
Beta Was this translation helpful? Give feedback.
-
I think this was a terrible decision to remove a feature without offering any alternative, as though no-one used that feature at all. I heavily relied on being able to filter and run specific spec files when I'm changing functionality that'll affect a group of tests. I can hit one button and run everything I need. Now, I have to run each one individually... what a waste of time, and two steps backward. |
Beta Was this translation helpful? Give feedback.
-
I'd love to see this feature being added back. Being able to filter test for a specific subset and run them all together was very useful. |
Beta Was this translation helpful? Give feedback.
-
Bring back "Run all tests", I don't want to click on every spec separately. This is tedious and terrible UX! 👎 |
Beta Was this translation helpful? Give feedback.
-
I'm so annoyed by this. We have a series of ordered test (first being a primer kind of test to get the CMS pages warmed up), then like 30 subsequent tests. We don't have any CI, the tests are just manually kicked off when there might be a major breaking change (CMS\ORM upgrade). Why would you remove such a useful obvious feature because some people might not use it, very clearly lots of us relied on that (a more manual) workflow. |
Beta Was this translation helpful? Give feedback.
-
"Run filtered tests" was a pretty important feature for us too. We have a large amount of spec files. Combined with the search this is really, really powerful. Would be great to have it back - the button is neither annoying, nor does it take much space... |
Beta Was this translation helpful? Give feedback.
-
I am considering migrating from Cypress v9 to V10, but I need this feature at least in the terminal. |
Beta Was this translation helpful? Give feedback.
-
Please bring back this feature. For smaller projects (like personal projects) or just in general this is a great feature to have. One example is i like to run my tests locally before pushing them to PR as i dont want to have to wait for all the CI tests (BE and FE) to run just to check the part i'm responsible for not breaking (FE). |
Beta Was this translation helpful? Give feedback.
-
I've posted an update in the opening thread (above) documenting the new |
Beta Was this translation helpful? Give feedback.
-
Just tried it out, the search/filtering algorithm seems to be partially broken.. (just get the old code.. this one worked fine :-P) it's behaving the same in the runner UI. I was expecting to be able to click "run all" on the first search UI, but this is minor inconvenience. I think the big, white search UI is superior (bigger, easier to read.. more screen estate is used compared to the tiny search area in the runner UI) Update |
Beta Was this translation helpful? Give feedback.
-
Who else would like this feature or something much like it for component testing? |
Beta Was this translation helpful? Give feedback.
-
Will there be a v12 release that includes the |
Beta Was this translation helpful? Give feedback.
-
Please register my displeasure :/ |
Beta Was this translation helpful? Give feedback.
-
Last update is from 6/21/2022. Can we get an update on prioritization for adding a "Run all tests" option back in. Version 12 still requires the hacky workaround. Edit: As of versions 11 and 12 you can manually re-enable it. In const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: {
experimentalRunAllSpecs: true
}
}); This too, should be documented in the main post on this page so people don't need to randomly stumble upon it in the weeds of the dozens of replies this has. |
Beta Was this translation helpful? Give feedback.
-
The experimental "Run X Specs" seems to be working great for me with the addition of the setting in cypress.config.ts:
e2e: {
...
experimentalRunAllSpecs: true
...
}
...in Cypress 12.3.0 and 12.4.0, at least.
Thank you for this feature, by the way! :-)
… On Feb 1, 2023, at 11:51 AM, The Jared Wilcurt ***@***.***> wrote:
Last update is from 6/21/2022. Can we get an update on prioritization for adding a "Run all tests" option back in.
Version 12 still requires the hacky workaround.
—
Reply to this email directly, view it on GitHub <#21628 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAUHRNUWBDZTOKWHAGBQ3X3WVKWCHANCNFSM5W5VG4QQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
https://dev.to/jprealini/extended-run-all-specs-feature-for-cypress-10-303c |
Beta Was this translation helpful? Give feedback.
-
We depend on the ability to run filtered specs (and will have to use Gleb's workaround as we're upgrading to the latest Cypress) because of #17940. If y'all fix that bug, I'd love to get away from having to split our tests that switch back and forth between superdomains into groups of similarly-named files. Until then, it's a bit of a pain to have to maintain multiple files and the extra file needed for each group as part of the workaround instead of just being able to run filtered specs like we could prior to Cypress 10. |
Beta Was this translation helpful? Give feedback.
-
Please bring it back! |
Beta Was this translation helpful? Give feedback.
-
the testIsolaion mess and this now, I am thinknig to seriosly switch to Playwright |
Beta Was this translation helpful? Give feedback.
-
Please bring this feature back... |
Beta Was this translation helpful? Give feedback.
-
Is there still a plan to roll out 'Run All Specs' for component testing? I've got a suite of ~250 that I would really like to just be able to run through quickly, saw this was on the roadmap for Q1 2023, but all seems to have gone quiet since. |
Beta Was this translation helpful? Give feedback.
-
We’re excited to share that Cypress 10.0 will soon be released. It’s packed with new features, like first-class support for Component Testing.
The ability to 'Run all specs' or 'Run filtered specs' will be removed in Cypress 10.0. We have long had plans to improve the experience of 'Run all specs' as detailed in this issue: #1586
The motivation behind these changes have been many, but we want to bring parity with running specs during
cypress run
and also make considerations for the architecture and performance of the new Cypress App in 10.0 to run all end-to-end or component tests.We’d like to hear your feedback on the usefulness of this feature to your workflow. What is the value for your team to 'Run all specs' or 'Run filtered specs' locally?
Please share your thoughts below. Your feedback will help us prioritize features to make writing Cypress tests even easier.
Update (11/21/22)
Updates provided by https://github.com/brian-mann
We have an experimental flag coming out in our next release tomorrow
11.2.0
introducing theexperimentalRunAllSpecs
flag that will restore the previous behavior seen in versions < 10.Many of the core issues as documented and described below still need to be solved for, but this new experimental flag will provide an escape hatch for users who desired this behavior and weren't experiencing the tradeoffs/downsides.
We're still working towards an official GA release that incorporates the changes mentioned below and makes this behavior officially supported without any downsides or problems.
Update (6/21/22)
Updates provided by https://github.com/brian-mann
Hello, everyone! Thank you for all the feedback. While you may have seen some of our team members engaging in the discussion, we know that many of you are awaiting a more official response on what's to come. I'm updating Jennifer's original thread to float this update to the top of the discussion. I'll shed some light on the reasoning behind these changes, touch on possible workarounds, and share some plans for the near future.
The first two weeks since the release of Cypress 10.0 has been exciting, insightful, and humbling. We've kept busy with a handful of patch releases that we hope resolve some of the issues our users have experienced after migrating to v10. We know it's not everything everyone wants, and we understand that can be frustrating.
Regarding the 'Run all specs' capability, we've certainly been listening and learning about the various use-cases you all have. While we believe that the functionality as it existed was flawed and misleading, it's become clear that it provided value to several of you; albeit in an imperfect state.
Why did we remove this?
Why was the feature broken?
“Run all specs” or “run filtered specs” used a naive and cheap “hack” to achieve this behind the scenes. It worked by combining multiple specs together into a single bundle and included a single “supportFile” to run with many specs in that bundle
However, running an individual spec in open mode
cypress open
or utilizing the normal run all mode withcypress run
would build each spec in complete isolation, and serve thesupportFile
once for each isolated spec even when passing a glob option to--spec **/*.cy.js
This lead to specs running asymmetrically in a way that was problematic; for instance if you had a root level hook such as a
before
,beforeEach
,afterEach
, orafter
defined outside of adescribe
orcontext
block, then that hook in a single spec would run for all specs that were served in the bundle.Besides hooks, any code that operated “globally” could leak into other specs and affect them. Reproducing these issues outside of the regular open mode or run mode was impossible because they only happened when running “all specs” or “filtered specs”. See issues here:
Additionally while in open mode, Cypress adds specific debuggability features that can lead to excessive amounts of memory being allocated as well as performance degradation based on how many tests you have running at the same time. Serving multiple specs together lead to these situations being regularly aggravated.
Serving multiple specs together in a single bundle also masked the individual specs being run. As you can tell from our UI - the individual spec header above the tests (called the reporter) indicates which spec you’re in and allows you to click on it from within the UI to open the spec directly in your IDE. By combining these, and not offering another visual indicator meant that tests were all merged into the same root tree without being able to visibly discern them from each other.
See issues:
What it take to bring this back?
Being able to run arbitrary, multi specs at the same time (correctly) is an incredibly powerful feature that we plan to bring back; and build it correctly. It is a nontrivial change however that requires at least 5 major changes to the UI and architecture to do so.
Changes Necessary
The specs list currently uses “a single select” link which runs the spec you’ve just clicked. This needs to become a multi-select variant.
The secondary specs list panel currently uses “a single select” link which runs the spec you’ve just clicked. This needs to become a multi-select variant.
The reporter has to become “multi spec” aware. Currently we use a single top level divider to indicate the spec. This needs to be upgraded from a “has one” to “has many” specs. We’d need a divider for each spec and there is additional navigation complexity with collapsing or traversing the reporter across many specs.
The individual specs even in multi-spec mode must utilize the same bundle/architectural guarantees as “cypress run” and cannot be combined into a single bundle. This would prevent state leaking from one spec to another.
We’d need to move some of (or most of) the debuggability features of Cypress in open mode out of the browser (to avoid hefty and potentially exhaustive memory allocation) and store them in indexdb in the node process. This would additionally not only help achieve multi-spec mode, but it would also improve the performance of single spec runs with many tests. The config option
numTestsKeptInMemory
would then be obviated and could be removed. However - the challenge with this is that while many of the debuggable snapshots we create could be serialized to indexDB, not all things could be. For instance usingcy.stub(...)
orcy.spy(...)
would lose references to individual functions which are helpful toconsole.log(...)
when clicking on their command logs. Those would need to stay in memory or we’d lose that feature and functionality.What new workflows would this unlock?
The above set of changes is a considerable amount of work, which is why it was cut from the original v10 scope
However, creating a proper “run all specs” mode would unlock new powerful features and workflows that isn’t possible to achieve today
We’d be able to move from watching a single spec to watching many specs and utilize the dependency graph available especially for component testing to bidirectionally watch specs and their source code. This would enable you to make a change in a src file and us automatically run all the specs that are importing and testing that src file. This would potentially have the power to negate the need to move around the UI manually and instead let your source code changes automatically drive “switching” to the specs that are affected.
Will we bring this back?
Are there any current workarounds?
Beta Was this translation helpful? Give feedback.
All reactions