Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the enhancement request #3100 "Update Cypress to latest version (10)" to update Cypress to version 10.11.0, which is currently the latest available version.
A side effect of this update is to allow Cypress to support the the Apple M1 ARM architecture natively without requiring Rosetta to run.
See Cypress Changelog.
The PR replaces the closed PR #3137 for Cypress 10.10.0 which was withdrawn due to builds not working on M1. If the build did not work, then Cypress could not test. In the meantime there have been npm package updates and it has been confirmed that M1 builds are working.
Impact
Cypress 10 introduces breaking changes due to the new functionality of component testing which is added alongside the existing end-to-end testing (e2e). For instance, new folders are introduced, so that the existing
cypress/integration
folder is migrated tocypress/e2e
. Also test specs are renamed:app_to_web.js
becomesapp_to_web.cy.js
. See the Cypress Migration Guide for more detail.In Cypress 10 the "Run all specs" is no longer available in the UI. Only individual tests can be run from the UI. To run all tests the CLI needs to be used. See Discussion: 'Run all specs' removal in Cypress 10.
Migration steps
The following steps have been carried out by this PR:
Install Cypress 10
npm install -D cypress@latest
(installs cypress@10.11.0 - see Changelog)npx cypress open
Migration tool
In the migration tool which automatically starts in the Cypress UI:
Post installation
integration
toe2e
i.e.spec: cypress/e2e/*.js
headed
syntaxcypress:open
script in package.json to usee2e
and browser Chrome i.e."cypress:open": "cypress open --e2e --browser chrome"
open
command.cypress/downloads/
to.gitignore
Verification
After fetching the branch MikeMcC399:cypress-10 execute
npm ci
to install Cypress 10.11.0.Execute the following and check that all tests pass:
Execute
npm run test:open
and check that the list of
e2e
test specs is shown immediately and the default browser is Chrome.Select and run one of the tests listed, such as
mime.cy.js
.Test on:
Note that there is currently an issue with a warning message "Couldn't find tsconfig.json. tsconfig-paths will be skipped". See issue 22273 in cypress-io/cypress#22273. This warning can be ignored.
Test the workflow .github/workflows/cypress-test-prod.yml and ensure that it passes.
Internal Tracking ID: EXPOSUREAPP-14080