Let me start out by saying thank you to the contributors of this blog Omkar Kulkarni and Mohit Agarwal. I owe it to them for sharing their in depth knowledge about Cypress and also for their flawless implementation of Cypress UI & API test cases.
I know we all have heard of Cypress UI test automation and Cypress API test automation, but independently. Have you ever thought of combining them and implementing this together? Certainly, sounds cool, but is it that simple to implement?
The answer is Yes, Of Course! We have made this possible. In this blog post, I will share our experience with Cypress Hybrid automation technology integrated with BDD.
We had used Cypress in our previous Cypress Automation projects, and were fascinated by the following automation features:
Before we deep dive into the process of integrating Cypress hybrid automation technology with BDD, let us first get ourselves acquainted with Cypress.
Cypress is a free, open-source, locally installed Test Runner and Dashboard Service that is used for recording your tests. It is a frontend and backend test automation tool built for the next generation of modern web applications. It is useful for developers as well as QA engineers to test real-time applications developed in Node and other front-end technologies.
We have defined our API test cases for performing CRUD operations (C: Create, R: Read, U: Update, D: Delete).
The Cypress structure that we have used for current automation is as follows:
In this hybrid automation, we have implemented all the following aspects to perform in the best way as per the business needs:
Following were the technologies used in development:
Following were the technologies used in testing:
Jenkins Freestyle Project is a repeatable build job, script, or pipeline that contains steps and post-build actions. It is an improved job or task that can span multiple operations. It allows you to configure build triggers and offers project-based security for your Jenkins project. It also offers plugins to help you build steps and post-build actions.
The types of actions you can perform in a Jenkins build step or post-build action are quite limited. However, there are many standard plugins available within a Jenkins Freestyle Project to help you overcome this problem.
In this project, we have created a Jenkins job, installed the required packages and entered window batch commands. Upon triggering the job, we can check the execution on Console.
The build execution can also be checked on local:
1. Run following commands as per environment:
2. Cypress Open opens the Cypress Runner with the list of installed browsers in the system. We can choose the feature files to run:
3. After running the feature file, we can see the tests on left and the execution on the right.
Whenever we do test execution, it is also required to understand the output of the execution. Whether it is manual execution or an automated, the output of the same must be in format, which immediately depicts the overall results of the execution. Hence, our framework also has the same capability to create output or generate test execution reports. We can see the reports for the build (the feature files and scenarios). We can see the build execution time and also navigate to details of each scenario.
Cypress records a video for each spec file when running tests during cypress run. Videos are not automatically recorded during cypress open. Videos are stored in the videos folder which is set to cypress/videos by default.
To view the execution video, go to Cypress > Reveal in File Explorer > Cypress > Videos.
See what I mean? Integrating Cypress with BDD truly isn’t as complicated as it seems. So, give it go and stay tuned for the upcoming Whitepaper, where we will be sharing the details of how we implemented the Hybrid feature.
And until then, reach out to us at Nitor Infotech to know more the advantages of integrating Cypress hybrid automation with BDD and take a look at our BDD whitepaper which further elaborates on the various aspects of BDD.
Subscribe to Our Blog