Cypress is considered as an open source test automation tool that can be used for the long run. It is used for front end test automation. This tool will is mainly developed resolve all issues that the teams encounter.
Cypress will help to achieve
-Configure tests
-execute tests
-Identify the errors
Selenium and cypress are compared in terms of their functionalities. Cypress is different in architecture and features. It resolves some of the issues we face selenium. Cypress will be based on the javascript and run the tests within the browser. It also helps to develop the tests which include
-Unit tests
-End-end tests
-integration tests.
Features
The important features
- It supports the test driven development
- It also provides Dashboards services
- Efficient debugging with the debugger tools accompanied with the generation of stack trace and errors.
- Provides the screenshots for failed tests.
- This not required to add waits to stop the execution for some time.
- It can monitor and control the characteristics of server response, functions, and timers. These are essential for unit testing.
- Check and manage network traffic.
- Allows the multi browser support.
- It is in-built feature to capture videos of execution will be available.
- Can be integrated with continuous integration tools.
- Page responsiveness with viewport sizing
- Reloads change applied to tests by default.
Cypress architecture
The main source will be above diagram is https://www.tutorialspoint.com/cypress-architecturetest-automation. Automation tools like Selenium can function by running outside the browser. The cypress will have different architecture.It will run within the browser. Cypress will be basically based on the Node.js. It has a continuous interaction of cypress with Node.js and they work in coordination with each other. Cypress can utilized for testing both the front and backend of the application. Cypress manage the tasks performed as time on the UI an simultaneously will perform in the browser.
Disadvantages
There are some disadvantages of Cypress
- It will be based on the java script
- A relatively new tool and hence the community support will not be extensive.
- It cannot perform mobile testing.
- Shadow Document Object Model will not be accessed.
- Tabs windows are managed by workarounds.
Difference between Cypress and Selenium:
Cypress | Selenium |
---|---|
It is based on the java script | It is depend on the C#,python and javascript |
It is having a small community support | It has a big community support |
It has builtāin video capture feature | There is no video capture feature |
There is no API are available to handle tabs windows. | API are available to handle tabs windows. |
No parallel execution is performed | here parallel execution is performed |
Cypress will support the cascading style sheets selectors to recognise elements. It can also perform with Xpath with the help of the cypress-Xpath.
There are rules of CSS expression
The rules of cascading style sheets expression as follows
- There are syntax with attribute āid and also tagname#id-the css expression will be input#gsc-i-id2
- Syntax of attribute class and also tagname will be the tagname.class-The css expression is-input.gsc-input.
- There is a syntax-with attribute value and tagname is tagname[attribute=āvalueā the css expression should be input[title=āsearch].
- The css expression should be ātr td for parent to child traversal.
Cypress will give main feature of open selector playground an arrow gets visible. We have to click on it and move to recognise the elements automatically. This CSS expression is more in the field cy.get available just to right arrow.
As open selector will be opted for playground an arrow gets visible.we can click it and move it to the element, which we have to identify.
Questions
1. What is cypress tool?
2. Why this cypress tool is used?