Start and restart a server from the plugin file
Advent day 12: How to run a server under test from the Cypress plugin file
In the blog post “Server Running Inside Cypress Plugin Process“, I show how you can run a server to be tested (in my case an ExpressJS server) right inside the Cypress plugin process. Bonus: you can customize the server and send the info to the spec file via cy.task
and before
hook combination. Bonus 2: you can check multiple properties in an object using my cy-spok plugin which is very convenient when doing API testing.