Cypress Automation

Problem Statement

Some entrepreneurs in America operating in Real Estate inspection services wanted to improve the quality of the web-based application which they have developed so that their users can use it hassle free which will increase their revenue generation. So, for that they have provided some critical flows which need to be performed every day at a particular time. By doing this the flows which fail in their execution can be attended and rectified by looking into the code and changing it. We proposed a solution that would make it easier for them to find a solution to this problem.

Solution Overview

The solution was to create some scripts which can be automated using some automation tools and run like a scheduler every day at a particular time so the health of their application can be monitored on a regular basis. We opted for cypress tool which is a popular end to end testing framework used for web applications. Cypress is easy to install and set up. It comes with a simple installation process, and you can get started quickly. Cypress tests are written in JavaScript. This makes it accessible to a broad audience, especially those who are familiar with web development. Keeping all these things in mind, the critical flows were converted into automated scripts and were executed on daily basis.

Tech Stack leveraged

We are using mocha framework in cypress script automation. Mocha is a feature-rich JavaScript test framework that is commonly used for both server-side (Node.js) and client-side (browser) testing. Mocha organizes tests into hierarchical structures with test suites and test cases. A test suite is defined by the “describe” function, and individual test cases are defined by the “it” function.

Mocha itself does not include an assertion library. Instead, it allows you to use any assertion library of your choice. Commonly used assertion libraries include Chai, Should.js, and Expect.js. Mocha supports various reporters that generate test output in different formats. Examples include the default “spec” reporter, “dot” reporter, and “json” reporter.

Cypress integrates well with popular IDEs such as Visual Studio Code, providing features like code completion and IntelliSense for a better development experience. We have integrated Cypress into our continuous integration pipeline, choosing a CI system such as Jenkins or GitHub Actions. Docker has been used to containerize the testing environment, making it easier to manage dependencies and run tests consistently across different environments.

Benefits Delivered

After successfully implementing the automation process of critical flows it saved several minutes of manual entry plus it also improves the quality of the application by raising the potential bugs in form of reports so that it can be attended as soon as possible by the developers for provide the fix.