vendredi 16 avril 2021

How to use Cypress.io for E2E testing when back end and front end are in separate repos?

I have a project with a NextJS front end and a FeathersJS/Node back end. Both of these apps/codebases are separate repos. I would like to start using Cypress for E2E testing, but I'm not sure what the best approach is to do that with my set up. Ideally, the tests would run as part of CI for every back end AND front end change. I am currently using GitHub actions for my CI, I'm not sure if that would help or hurt me here.

I've seen some people mention putting Cypress in its own repo with its own docker-compose that would handle spinning up the front end and back end to run the tests. However, I don't understand how this would work as part of CI. How would new code, pre-merge, make its way into this repo to run as part of CI? I think there would be a lot of issues with this approach.

One approach I thought of is to just include Cypress as part of the front end NextJS app and have it run against a "staging" or "test" instance of the back end that gets seeded with every new back end deploy. One of the issues here is that the tests would not run when the back end changes, but that's not necessarily an issue, I suppose.

Any thoughts?

Aucun commentaire:

Enregistrer un commentaire