This repository is now archived and read-only.
For the latest examples and updates, please visit our new repository:
Executing an async task for each Cypress spec file
before method of cypress/support/e2e.js is automatically included in each spec file. The method invokes an async cy.task that runs in NodeJS, and can be used to spin up a testing environment, or execute any other setup task e.g. seeding a DB.
Take a look at cypress.config.js that defines the setup task within setupNodeEvents function.