If you are looking to move your Cypress "installation" directory which is being created when executing cypress open
or cypress run
, I suggest to follow this steps:
1) Run cypress with --project <directory>
flag where directory is where you would like cypress to be installed. In my case I chose test directory:
cypress open --project test
2) Cypress should now create its startup directory in /test/cypress
folder. Add your cypress.json
file directly under /test
(!) directory. If you are using TypeScript, you can add your tsconfig.json
file there too.
3) In your cypress.json
you can relatively configure your tests subdirectories. My file is:
{
"projectId": "XXXXXX",
"fixturesFolder": "cypress/fixtures",
"integrationFolder": "ui",
"screenshotsFolder": "cypress/screenshots",
"videosFolder": "cypress/videos"
}
which means that my tests are under /test/ui directory and the rest within /cypress. I keep only fixtures, plugins, screenshots, videos, support dirs and the rest removed.
Works without issues. I hope that helps.