Move cypress folder from the root of the project

Gleb Kost picture Gleb Kost · Mar 9, 2018 · Viewed 8.2k times · Source

When I install and run cypress, it scaffolds a cypress/ folder in the root of my project.

The problem is that all other test related data is stored in the test/ folder. Is there an easy way to move it to test/cypress and configure cypress to look there?

Answer

Gleb Kost picture Gleb Kost · Mar 9, 2018

Cypress has a few configuration options to specify custom folder structure.

For that you will need to have cypress.json file in the root of your project and specify the following structure there for cypress to properly pick up the files in test/cypress/:

{
  "fixturesFolder": "test/cypress/fixtures",
  "integrationFolder": "test/cypress/integration",
  "pluginsFile": "test/cypress/plugins/index.js",
  "screenshotsFolder": "test/cypress/screenshots",
  "videosFolder": "test/cypress/videos",
  "supportFile": "test/cypress/support/index.js"
}

More info in the cypress docs.