Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent adding default supportFile on migration (#21985)
* fix: prevent adding default supportFile on migration * Update unit tests Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
- Loading branch information
1 parent
ae8d4b2
commit e0e5a60
Showing
10 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
system-tests/projects/migration-e2e-custom-supportFile-default-value/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## Migration E2E Custom SupportFile with default value | ||
|
||
An e2e project with a custom `supportFile` named `cypress/support/index.js`. It uses the default `supportFile`. We will not | ||
update the config file to show the supportFile because it is the same as the default one | ||
|
||
The following migration steps will be used during this migration: | ||
|
||
- [x] automatic file rename | ||
- [ ] manual file rename | ||
- [x] rename support | ||
- [x] update config file | ||
- [ ] setup component testing | ||
|
||
|
||
## Automatic Migration | ||
|
||
Unless the user skips this step, after this step, the filesystem will be: | ||
|
||
| Before | After| | ||
|---|---| | ||
| `src/basic.test.js` | `src/basic.cy.js` | | ||
|
||
## Manual Files | ||
|
||
This step is not used. | ||
|
||
## 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: | ||
|
||
|
||
The expected output is in [`expected-cypress.config.js`](./expected-cypress.config.js). |
3 changes: 3 additions & 0 deletions
3
system-tests/projects/migration-e2e-custom-supportFile-default-value/cypress.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"supportFile": "cypress/support/index.js" | ||
} |
Empty file.
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
...-tests/projects/migration-e2e-custom-supportFile-default-value/expected-cypress.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { defineConfig } = require('cypress') | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents (on, config) { | ||
return require('./cypress/plugins/index.js')(on, config) | ||
}, | ||
}, | ||
}) |
Empty file.
e0e5a60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
e0e5a60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
e0e5a60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: