Files
cypress/system-tests/projects/migration-e2e-component-default-everything
Lachlan Miller 66c1e6ccf9 chore: improve migration flow test coverage (#20576)
* add an extra test for migration

* refactor: use async tools to deal with files

Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
2022-03-14 12:46:13 +10:00
..

Migration E2E Component Default Everything

A project with E2E and CT, both using default integrationFolder, componentFolder, testFiles, etc. None of the breaking configuration options are modified. They are all defaults.

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

Unless the user skips this step, after this step, the filesystem will be:

Before After
integration/foo.spec.ts e2e/foo.cy.ts
integration/spec.ts e2e/spec.cy.ts
component/button.spec.js component/button.cy.js

Manual Files

The user will need to rename and/or move their only component spec, button.cy.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. There is no such cypress/support/component.js created here - that's going to part of the component testing reconfiguration workflow.

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.

Second flow

A project with E2E and CT, both using default folders. Everything is default.

The following migration steps will be used during this migration:

  • automatic folder rename of cypress/integration to cypress/e2e

Automatic Migration

User skips tries to skip this step, so, we rename just the folder:

Before After
integration/foo.spec.ts e2e/foo.spec.ts
integration/spec.ts e2e/spec.spec.ts
component/button.spec.js component/button.spec.js