What is Cypress?
Cypress framework is the popular end-to-end automation framework. It is built on NodeJS and provides the ability to write the automation scripts using JavaScript and Typescript programming languages. Cypress quickly gained users because of its unique features such as debuggability, stable test runs, time travel, automatic waiting, and screen capture.
But like any other automation framework, Cypress also has some limitations like iFrame Support, multiple window support, cross-origin restriction, etc. Cypress is an open-source framework that comes with an MIT license. One can just install Cypress npm node packages and start testing.
Cypress Features:
Beginner friendly setup
Tests are easy to read and understand
Not dependent on Selenium Webdriver
Interactive test runner
Built-in wait and retries
API testing support
Limitation:
Limited browser support
cross-origin restrictions
Multi-tab and multi-windows not supported
Built-in parallelization not supported
What is WebdriverIO?
WebdriverIO framework is an end-to-end testing framework, owned by a non-profit organization called OpenJS foundation and follows W3 recommendations for architectural designs. It is a NodeJS based application that provides the ability to test applications using JavaScript/TypeScript.
WebdriverIO can be configured to use Webdriver Protocol or ChromeDevTools Protocol. Mostly WebdriverIO is used with WebdriverProtocol since it provides rich features like cross browser testing. WebdriverIO is completely open-source. Unlike Cypress, it doesn’t offer any commercial option.
WebdriverIO Features:
Beginner friendly setup (customized)
Tests are easy to understand for JS users
User custom implementation of Webdriver
CLI test runner only
Built-in wait and retries
Need external Libraries.
Limitations:
Async-await syntax can be confusing for beginners
Difficult to debug tests
no paid features
lots of customization can be overwhelming
Difference Between Cypress and WebdriverIO
Features Cypress WebdriverIO
Browser support | Supports chromium family(chrome, Edge, Electron, Brave) and Firefox | Supports all major browser (Chrome , Firefox, Edge, IE and safari) |
Native Mobile Support | No Support | Possible using Appium |
Locators support | CSS Selector (XPath Plugin) | CSS Selector, XPath |
IFrame Support | Difficult to work | Easy to switch to IFrame |
Google Lighthouse | External Plugin | Built-in (DevTools Service) |
Test Framework | Mocha, Cucumber(external) | Mocha, Jasmine, Cucumber |
Parallelization | Possible with paid plan | Built-in |
Documentation | Intuitive and opinionated | Good Documentation |
Community Support | Growing Community | Decent Community Support |
Reporters | Spec, Mocha, Custom | Spec, Allure, Report Portal etc. |
Which one to Choose?
If the requirement is to run tests in Chrome and Safari as that’s where the majority of the users are then probably it’s better to go with WebdriverIO. Or, may be you one suite for Web and Mobile, then again it’s a better choice to go with WebdriverIO.
On the other hand, if the requirement, is to execute tests on chromium based browsers only and you need a good dashboard that can give you an overview of all your tests, then probably its better to go with Cypress if the team is ok to go with a paid option.
Both frameworks are great and have their own pros/cons but its up-to you to look at what exactly you need for your next automation project based on your project requirements and then make a decision accordingly
Read more:
The Tech Platform
Comments