What are the limitations of Cypress?

Blog
September 8, 2021

Cypress is a free, open-source JavaScript-based frontend end-to-end testing framework built for the modern web. It’s built on top of Mocha which makes asynchronous testing simple and convenient. It’s used extensively on web frameworks such as React, Vue.js, or Angular. Cypress can also be configured to use Cucumber as well.

One important thing to also note is that Cypress is not based on Selenium and therefore, works perfectly in the browser DOM elements. It is also known to possess more speed*, durability, and reliability as compared to Selenium-based tools. It is easy to install by just running a simple NPM command which makes for an easy onboarding process.

Christian Marchildon, an Automation Engineer at Q4 Inc. stated in his chat with us that “In the world of software testing, most developers and quality assurance testers have become accustomed to ‘writing code’ in tools like Selenium or Cypress to run test scripts. As the software grows and/or changes, maintaining a large number of scripts, therefore, becomes quite challenging. This increases development time and thus countermands the principles of DevOps which is shortening the development life cycle with continuous delivery.”

Yuki Shinohara, CTO at Money Forward Kessai, Inc., shared his experience with us about ensuring quality across all team members. He stated “On the subject of productivity, it’s not easy to incorporate the front-end into an iterative development model. Some companies manage E2E tests with code using tools like Cypress, but the code can break and hinder the iterative process. That’s why we couldn’t work on E2E tests. The least we could do was to check if it worked after deploying.”

Developers have stated that the limitations of Cypress are causing frustration. We will discuss those limitations plus offer solutions to get around them.

What are the limitations of Cypress?

There are some fundamental limitations of Cypress that make it not suitable to run serious test automation. From the way the tests are loaded to the running of such tests, Cypress has been known to have some technical limitations. We’ll be discussing a few of these limitations which include:

1. Write Tests in JavaScript

JavaScript is the world’s most famous programming language, and it’s no surprise that Cypress can only use Node.JS which is not suitable for test automation. You would be required to have some advanced JavaScript knowledge which includes Promises, jQuery, asynchronous JS, and other advanced JavaScript methodologies.

JavaScript Promise is an async programming model in JavaScript which can be complex for anyone without the basic knowledge of JS. It’s been known to cause confusion for automated testing.

While Cypress differs from Selenium in that it does not use a variety of programming languages; it does require the test automation engineer to “write code” in JavaScript. Therefore, if a QA tester does not know how to write JavaScript, they either must learn or be disqualified for the job. With Autify, however, there is no code required. If you can point and click a mouse, you can also use our tool.

This limitation to JavaScript also brings about the compulsory installation of all the NPM packages in the package.json file as is known with all NPM frameworks. This manages the dependencies associated with the Cypress framework, and even though this is the behavior for applications, it makes no sense for automated testing. There can sometimes be errors when running a Mocha test if the correct dependencies are not installed.

The node modules folder is quite large too, which makes it a limitation to its speed when running automated tests.

2. No multi-tab support

Because Cypress runs inside the browser, you wouldn’t be able to support multiple tabs when running tests. There is a workaround, however, as a recent customer of Autify, Chastain Marchildon, Automation Engineer for Q4 Inc. stated, “Since we switched to Autify vs Cypress, there’s not been a lot of bottlenecks that we’ve found with Autify. Our Virtual Events platform requires multi-tab support to simulate user interaction. Cypress provides a solution to that, but we didn’t have time to figure it out. In Autify, being able to open a new tab was easier. It speeds things up an extreme amount. I can’t imagine using anything else for Q4 Inc.”

3. *Cypress is slower

Cypress tests execution speed is okay at the initial stage of initiation which may be suitable for a demo, but this would get slower as the app scales. Cypress is based solely on Chrome DevTools Protocol (CDP) which is a protocol developed to enable a debugger inside Chromium-based browsers.

For a partly small test suite, it’s been found that Cypress is about the same speed, or slightly slower than Selenium WebDriver. This is also noticeable on a medium or large test suite. It is inefficient and very difficult to maintain test automation with Cypress.

4. Maintenance

In the quality assurance and test automation industry, as with most other professional industries, the view of an inexperienced test automation engineer would be quite different from that of an expert. There are laid down rules and specifications when it involves industry-standard UI testing which an expert should know.

Tests happen rapidly as the application grows, and this is most often time large scale of automated UI tests. It has been found that Cypress does a bad job of keeping up with maintenance. It is quite easy to create tests than to maintain with Cypress. Industry-standard automation testing means keeping up with one’s automated tests in real-time as the application changes which happens very frequently.

It’s the ease to use that matters when it comes to automated testing, as it’s not just a programmer-facing technology, but also open to the general public, and if it’s so difficult to maintain tests than to create them, then there’s an unbalance somewhere.

This makes it difficult to rely solely on Cypress for automated testing as much more effort is geared towards enhancing and stabilizing it than running the automated tests itself.

5. Complex and Inconsistent Syntax

When promoting Cypress, the makers and marketers dwell on its “Good syntax” as one of the reasons to use it but in the actual sense, having tested the framework across different scenarios and products, Cypress syntax is quite inferior.

There is a level of syntactic ambiguity in Cypress which makes it difficult to use and understand. As compared with some other testing frameworks, the level of complexity experienced with Cypress is multiplied because of the sole reliance on JavaScript. Asynchronous programming can be a challenging process and when integrated with automated testing, there usually is a lot of trade-offs. Non-engineers or any stakeholder asides from the engineers in a software development life cycle (SDLC) cannot be a part of the testing process because of this fact.

How to Solve Cypress Limitations?

According to research, DevOps QA teams are not excited with the process of their automated testing and therefore, search for better software all year round. You would naturally have to check for all the facts before selecting any test automation tool, as well as the pros and cons of each tool.

When selecting Cypress, sometimes, a Proof of Concept (PoC) is needed to ensure that it’s a good fit. This also takes a lot of time and makes the whole process longer.

Users have found Autify to be the best alternative to Cypress

Although it does not support testing desktop applications, regarding web and mobile apps, it is superior in many ways to Cypress. Autify is an AI-powered codeless test automation software platform, i.e., it does not require any form of coding knowledge in any particular programming language to create test scripts.

The major advantage of this is that non-engineers can create test scripts without extensive training. When it involves scaling and maintenance too, test scripts are automatically maintained by artificial intelligence. Autify algorithms track changes in UI, scale those changes, run test scripts and scenarios on large applications, and rather than break or fail as the application grows, Autify ensures every test is performed.

This saves valuable time and resources and lets the team focus on the most important thing which is building the product. It is compatible with cross-browser platforms and integrates perfectly with Slack, Jenkins, and more.

Reporting in Autify is also enabled by default, therefore you’re sure to get all the important information associated with your testing process.

Conclusion

Although Cypress can be a good tool for automation, its limitations greatly exceed the pros which make it difficult to use for scaling applications. You can try out these alternatives if you’ve been having problems using Cypress.

Run AI-Powered Test Automations Tailored to QA Teams with Autify!
Ditch your high cost manual work and start your no code FREE 14 day trial testing journey with Autify now!
Try Autify!
No credit card required. No auto-billing after trial.