Why Cypress Sucks for Real Test Automation? (Part 2: Limitations)
Many limitations of Cypress makes it not suitable for serious test automation
A repost of my old (still valid) article published on Medium in 2021.
I have received some positive feedback on my “Why Cypress Sucks for Real Test Automation” (Part 1) article. A few readers wanted to clarify it a bit more. Yes, the article was more focused on why there is really no need to use Cypress, as there is a much better tool (in almost every way) Selenium WebDriver. In this follow-up article, I will focus on the limitations of Cypress.
Table of Contents:
∘ 1. Technical limitations of Cypress
∘ 2. Cypress is actually slower
∘ 3. Cypress tests are hard to maintain
∘ 4. Cypress can only use Node.JS, which is not suitable for test automation
∘ 5. Cypress wrongly added “retry-ability”, which shall be a CT feature
∘ 6. Complex and Inconsistent Syntax
∘ 7. Not Future-Proof
1. Technical limitations of Cypress
For the specific technical limitations of Cypress, please read this article, “My Thoughts on Cypress.io” by Alister Scott on 2019–07–16. I will just highlight the comments section here:
“There are technical limitations to the way Cypress loads and runs the tests, which are covered in https://www.cypress.io/how-it-works Some of the limitations will be removed (iframes, shadow DOM support) as we continue, and some limits will probably be there for many years.”
- Gleb Bahmutov, distinguished engineer at cypress
and the reply from Alister Scott:
I did hear this line “if it’s on the web, Cypress can test it” which I still have a problem with as my recent apps I have worked on have both used iFrames can Cypress can’t test them — including WordPress.com which is a super high volume web application.
- Alister Scott, Excellence Wrangler at Automattic (WordPress)
Gleb and Alister exchanged their opinion professionally here. Alister had problems testing iframes with Cypress, and the distinguished engineer at Cypress confirmed it. Cypress’ false claim (“if it’s on the web, Cypress can test it”) was from Cypress’s marketing team, don’t take it seriously. One sure thing is, even Cypress die-hard fans would agree: Cypress has technical limitations.
Frames have been in HTML for as long as I can remember. For > 60% of projects (yes, iframes are being less used in modern websites, yet still, there are many of them, such as Microsoft Dynamics 365, SharePoint, WordPress, …, etc. In fact, most of the applications under test are enterprise-type), I had to drive iframes with Selenium WebDriver, which was totally fine. About 2 years ago, a so-called ‘Cypress tester’ mentioned that he was unable to test frames or upload files with Cypress. I thought it was absurd! He simply lacked a basic understanding of test automation. If unable to test one operation on a web page, then it pretty much means the application cannot be tested. This is simply the nature of UI test automation. How come Cypress, with such severe limitations, became ‘popular’ in the past few years, puzzled me. (Update in 2023, cypress.io is dying).
A real test automation engineer will never say this: “Sorry, the test framework/tool unable to automate testing your web application”
To qualify for a web test automation framework, it shall not have serious technical limitations, not even one. This is common sense, isn’t it? After all, people will use it for verification. I never had a ‘limited’ feeling with Selenium WebDriver.
I know some would argue: “I can do with cypress-iframe plugin now (in 2020)”. Yes, it might be the case (frankly, I didn’t want to waste time verifying that after finding so many limitations with Cypress). This is a very wrong mindset: finding reasons to use one product, no matter what the real situation is (iFrame in HTML standard and is still widely used). Cypress was released not supporting iFrames, this behaviour would be regarded insane in other engineering industries, as a test framework, that’s even more crazy. Let me ask you a question, “would a car manufacturer release a car that will break down on rainy days?”
Then, how about other limitations (listed on Cypress’s official documentation), such as
…, etc.
For each of the above limitations, I had at least one case to use in recent projects. With Selenium WebDriver, no problems at all.
Gleb Bahmutov, probably the man with the most Cypress knowledge on earth, acknowledged that “some limits will probably be there for many years”. Will your project have ‘many years’ to wait? Unless you want only a fancy demo, do not use it for real test automation.
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.