Introduction to Cypress Testing
‘Technology make our life easier’, but how about the people who are behind the success of this Technology. Yes, the developers and testers also want to make their lives easier. Even though there exist many tools to speedup the development /testing process, many say that Cypress has made it much easier.
What is Cypress? What makes Cypress so unique?
Lets us check on the pros and cons of this End-End testing framework.
The main advantage of Cypress is that it can basically test anything that runs on the browser. You do not need any remote commands through the network. It runs in the same loop as your application and hence cypress can be termed as Fast, Easy and more reliable .So, Cypress is purely a non-selenium framework. You don’t have to take the pain of multiple installations/dependencies before you start the work. Cypress comes out as an all-in-one framework, just run the .exe and that’s it. You are ready to start the work.
Cypress helps to automate
- Unit Tests
- Integration Tests and
- End-End tests.
Cypress Testing Services:
When you go through the Cypress.io website, we find that cypress provides two services.
- Cypress Test Runner, which is free and can be locally installed. It is open source and no limitations.
- Dashboard service is like a web application, which gives more insight into the test runs. It provides features like parallelization across machines, automated load balancing etc., There are a variety of plans in Dashboard service, a free plan, open source plan and paid plans.
But, the locally installed Cypress Test Runner would serve the purpose in most of the cases.
Cypress Test Runner:
The Cypress Test Runner allows you to see the commands as well as the application at once.
The Dashboard gives an overall view of runs, setting up the projects etc.,
What makes Cypress Unique?
We have listed a few points to claim that Cypress is unique in its own way. Here is the list, though it is not complete.
- Free: Cypress is Open source and no limitations/restrictions.
- Architecture: Complete new architecture built from the ground up that can overcome many shortcomings found in the existing open source tools.
- Target Audience: It is made especially for developers and QA engineers.
- Time Travel: Cypress takes screen shots at every step .So, you can go back and see what happened at each step.
- Debugging: Time travel makes it easy to find out where the failure occurred and debugging can be done by the familiar chrome dev tools.
- Automatic Waiting: No need of any sync/wait statements as Cypress automatically waits for commands/assertions before moving on to the next step.
- Installation: Fast and easy set up and you do not have to install any dependencies separately as cypress is fully baked and ready to serve.
- Documentation: A very well written documentation is available on the cypress website which makes it easy to understand.
Cons of Cypress Testing
- Cross-Browser Support: Cypress works only for one browser i.e. Chrome. But, the cross browser support will be an upcoming feature as per the Cypress website.
- Only one Testing Framework ‘Mocha’ is allowed.
Cypress, on the other hand, may not fulfil the general purpose of the automation testers.
You may not be able to use cypress for indexing the web, scripting 3rd party sites, performance testing etc., you cannot do much outside the browser, like connecting to the database. Though there are a few workarounds, still it is a painful job compared to the ease that cypress gives with the front-end automation.
Cross-browser testing is something which is expected out of automation scripts. We should wait on this feature to be completely developed in Cypress. Still, for small companies where the users need general end-end testing with only one browser (chrome) cypress can be implemented.