Creating automated tests for your website, web application or mobile application was never an easy task.
Most of the companies started using Selenium WebDriver for test automation, which was a game changer 5-7 years when first started getting traction, but it came with few challenges like:
The new testing frameworks are trying to improve most of the above issues, while offering a more integrated testing framework, easier to use and get started without the test flakiness the developers were experiencing while running Selenium WebDriver tests.
Prerequisites Chrome browser needs to be installed locally to run tests on Chrome.
How to install npm install testcafe –save-dev
How it works
Cypress works by controlling the browser via proprietary automation APIs and needs a new driver for every supported browser.
Cypress supports Chrome and family (Chromium, Electron), Firefox is still under development.
Cypress runs your actual test code in the browser process and communicates with the app via HTTP or executing shell commands.
Cypress uses jQuery selectors, also can use the useful extra capabilities like :parent and :first.
Cypress goes one further by having a dedicated Electron app that shows your tests side by side with the site under test. Hovering over a test step shows a snapshot of the DOM for that step which makes debugging easier.
Cypress uses (a fork of) Mocha as its test runner with Chai for assertions and Sinon for mocking.
fast & reliable
jQuery selectors (extra capabilities like :parent and :first)
synchronization done by the framework
Easy debugging in the CypressIO UI
JS errors caught by the framework
Screenshots & Video recording
possibility to go back to previous states
open source (MIT licensed)
parallel execution not supported
no cross browser support: only supports Electron and Chrome at the moment
no integration with BrowserStack or SauceLabs
error reporting need improvements
Overall, TestCafe and Cypress, are both good options to go forward in your organisation.
Cypress, on the other hand, offers a more user oriented approach, when you select the element you want to interact with and you have to do the assertion on the spot, this approach can be a little cumbersome at the beginning.