Cypress is one of the best tools for end-to-end testing, offering a fast, developer-friendly experience with built-in waiting, an intuitive API, and great debugging capabilities. However, like any tool, it has its limitations. Some of these are intentional design decisions, while others feel like omissions that would significantly improve the native test runner.
Fortunately, the strong Cypress community has developed plugins, workarounds, and best practices to help overcome these challenges. Below, I’ll outline seven features I wish Cypress had natively and the ways to work around these shortcomings.
1. Parallel Test Execution (without Cypress Cloud)
Cypress supports parallel test execution, but only if you use the Cypress Cloud Service. While Cypress Cloud is a fantastic, paid feature that provides a slick visual dashboard for improved debugging, analytics, and overall test health, parallelization bundled with the service feels like an unnecessary variable in today’s testing world. With other major testing competitors offering this feature out-of-the-box and considering how high-importance executing tests simultaneously is, this limitation is a big blocker for many teams. Thankfully, there are plugin workarounds to achieve parallel test execution without Cloud.
Workarounds:
- cypress-split — easy installation and use. Updated frequently.
- cypress-parallel — similar to split but frequently less updates.
2. Extended Test Filtering
Native Cypress CLI commands only allow filtering by spec files, meaning there is no built-in way to tag or filter tests based on test name or labels like @smoke
or @regression
. This is limiting for those that want to avoid organizing their test specs and folders entirely based off of test runs. Additionally, teams may need to run subsets of tests within the same spec file at different points in the Software Development Lifecycle. Once again, there are plugins to help achieve this.
Workarounds:
- Install the @cypress/grep plugin to enable filtering on titles or tags
- Install the cypress-grep plugin. Similar to
@cypress/grep
but more frequently updated. - Install the cypress-cli-select plugin to easily execute specific specs by file, name or tag in the cli. Built off of
cypress-grep
.
3. Test Runner Filtering (Live Filtering in UI)
Continuing the filtering trend, there’s no easy way to execute a single test or group of tests within the Test Runner itself. The workaround to this is to go into your code and add a .only
to the it
or describe
methods but this requires back and forth between the test runner and the code. For those encouraging non-QA engineers to run Cypress tests locally, having a way to filter tests without knowing the test code is useful. Simply, the Test Runner does not offer a UI-based way to filter tests dynamically while running them.
Workarounds:
- Install the cypress-plugin-grep-boxes plugin to start filtering within the test runner without code changes. Built off of
cypress-grep
. - Install the cypress-plugin-last-failed plugin to easily re-run the last failed test(s). Also supports CLI. Built off of
cypress-grep
.
4. Official Safari/WebKit Support
Cypress officially supports Chrome, Edge, and Firefox, but not Safari or WebKit, making it difficult to test apps in an environment closer to Apple’s ecosystem. However, despite a lack of official support, there’s experimental support built on top of the playwright-webkit
plugin.
This is a great option that is better than nothing but there are still a handful of known issues that could be blockers for a complicated test suite, such as missing cy.origin
support.
Workarounds:
- Install playwright-webkit and add experimentalWebKitSupport: true to your config file. Run Cypress as usual using the
--browser webkit
cli param. - Pray you don’t need to test against Safari…kidding but sometimes hard-blockers require alternative testing tools as a last result.
5. Multi-Browser Support
Cypress is designed to run within a single browser tab, making it difficult to test workflows that involve multiple tabs or popups. There’s no easy command to switch between multiple tabs or browser contexts to accomplish multi-user functionality such as a chat box. That being said, Cypress has a ton of workarounds that still provide full-test confidence without needing to truly simulate two browser context.
Workarounds:
- Use
cy.request
to simulate receiving requests from another user. - Use @cypress/puppeteer plugin to support switching to a new tab
- Validate the new tab without truly redirecting to the new tab
6. Real User Interactions
Cypress primarily relies on synthetic events for interacting with the DOM, which typically achieve most common, user interactions. However some events, such as simulating hover states and drag-and-drop actions, aren’t easily achievable with this default behavior. Once again, the community has provided a handful of useful plugins to make user interactions a bit easier.
Workarounds:
- Utilize the cypress-real-events plugin to fire real, native events such as
realHover
andrealClick
. Only works for chromium-based browsers. - For drag and drop, use cypress-drag-drop or manually dispatch
mousedown
/mousemove
/mouseup
events.
7. Command Retry Logic
Cypress has fantastic built-in assertion retry-ability but currently does not support retries for non-query actions, such as commands. On theme, there are a handful of workarounds to extend the default Cypress functionality including a must-use plugin.
Workarounds:
- Use the cypress-wait-until plugin for retrying non-query logic. Adds waiting power to literally everything.
- Utilize the cypress-recurse plugin to retry custom commands until a predicate function returns true. Another great alternative.
- Convert your custom command into a custom query instead which supports retrievability. Cypress v12 and above, not recommended for every command.
Conclusion
While Cypress is an incredibly powerful testing tool, it has limitations that can sometimes slow down test automation efforts. Thankfully, the strong community and ecosystem of plugins provide workarounds for most missing features. It just requires a bit of searching and additional setup.
As Cypress continues to evolve, I hope to see more of these features become natively supported. Until then, hopefully this list serves as a useful conglomeration of workarounds to help make the most of your Cypress test automation efforts.
As always, happy testing!🚀
Top comments (0)