Cypress is open source testing framework which is based on javascript. It creates powerful, robust and maintainable test suites. Cypress provides better, faster, and more reliable testing for anything that runs in a browser
Using Cypress, you can create below tests
- End-to-end tests
- Integration tests
- Unit tests
Advantages of Cypress
- Use the Page Object pattern
- Write tests with multi data sets (data-driven)
- Run tests in parallel
- Test APIs
- It can be executed from Jenkins or any other CI tool
- There is no need for driver binaries in Cypress and execution happens on the real browser.
- It has support for BDD and TDD style testing.
- Cypress runs much, much faster
Limitations of Cypress
- It doesn’t provide support for multi-tabs
- Cypress only supports JavaScript for creating test cases
- Cypress doesn’t provide support for browsers like Safari and IE at the moment.
Framework Structure
Main Components of the framework
- Configs: Stores the test data for the test cases in json files. This test data is then imported to test cases. So, same test case can be executed with multiple data and multiple times.
- Constants: This section of the automation framework acts as the object repository. Unique identifier for each object or web-element on UI is identified and captured here. These object properties are used by the code to identify the element on the web page.
- Support: This is the backbone of the framework. This section imports all the object properties or identifiers and use them to create the methods or commands that are used in test cases for test execution. This in other words can be explained as glue in cucumber terminology.
- Integration: These are the actual test cases. Each test case is stores in .js format and calls the methods or commands in the sequential order to execute test cases.
Executing Test
- Test can be executed from GUI and from Command Line
- Test can be executed in browser and in headless mode
Leave a Reply