I am currently working on integrating Cypress e2e tests in our existing CI/CD pipeline (I’m not an automation engineer but a developer). Our application is a fintech app which involves the typical process of registering a new business, and after the business has been registered, to go through the process of requesting a credit with it.
So far we only have a few e2e tests for registering the business, which are fine. And then we are creating a few e2e tests for the business credit request flow. But then, we want to create other tests that comprises the whole flow of creating a business + requesting a credit. However I’m just wondering what is the best way to reuse the code from the tests where the business is created instead of repeating the code in the new tests.
Just wondering what is the most elegant way to do it, either if Cypress itself offers some sort of functionality to reuse that, or just encapsulate the test code in utility functions that can be called from several tests.
Source: Read More