What is the best way to run a cypress test when initiating a merge request? (before approval)

What is the best way to run a cypress test when initiating a merge request? (before approval)

In this case, I have a question as to what is the ‘need’ environment to run the cypress test (merge request and before approval)?

Cypress is currently in docker images. But since the backend and frontend have not been deployed, I have a problem that in the merge request, on which environment should the cypress test be run?

I want to check whether my merge request affects the existing functions before approving the merge request.

Hi,

This is not really GitLab-related question. This depends on you and your application needs.
If you can run your tests without an actual application running, you should do that. If you need to have an app deployed prior to running tests → then do that. Make a job that automatically deploys this version of application, and then in the next job run your tests against that application instance. Once tests are done, don’t forget to destroy the temporary application as well in another job.

1 Like