mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-16 12:10:05 -06:00
BREAKING CHANGE: removed experimentalSessionAndOrigin flag. testIsolation defaults to strict
Migration
This is the "kitchen sink" of migrations. It has E2E and Component Testing, a bunch of specs, a complex cypress.json, and requires all the steps.
The following migration steps will be used during this migration:
- automatic folder rename of cypress/integration to cypress/e2e
- manual file rename
- rename support
- update config file
- setup component testing
Automatic Migration
- The project has a custom
testFilesglob, so we will not attempt to rename their specs to use the.cyextension. They ARE using the defaultintegrationFolder,cypress/integration, which we can automatically rename tocypress/e2e. - Their
specPatternwill be inserted in step #4 for bothcomponentande2e.
Unless the user skips this step, after this step, the filesystem will be:
| Before | After |
|---|---|
integration/app_spec.js |
e2e/app_spec.js |
integration/bar.spec.js |
e2e/bar.spec.js |
integration/blog-post-spec.ts |
e2e/blog-post-spec.ts |
integration/company.js |
e2e/company.js |
integration/homeSpec.js |
e2e/homeSpec.js |
integration/sign-up.js |
e2e/sign-up.js |
integration/someDir/someFile.js |
e2e/someDir/someFile.js |
Manual Files
The user will need to rename and/or move their only component spec, Radio.spec.js to its new location.
Rename supportFile
The project has a default support file, cypress/support/index.js. We can rename it for them to cypress/support/e2e.js.
| Before | After |
|---|---|
cypress/support/index.js |
cypress/support/e2e.js |
Update Config
We can migrate to the new cypress.config.js. The expected output is in expected-cypress.config.js. The main points are:
specPatternis nested undere2eandcomponent, and formed byintegrationFolder+testFilesfor E2E andcomponentFolder+testFilesfor component. We do NOT use the new default of.cy.{js,jsx,ts,tsx}because the project already has specified a custom testFiles pattern.pluginsFileis gone - it's now required inside ofsetupNodeEvents.componentFolderis gone.
The expected output is in expected-cypress.config.js.