This document describes updating the examples in this repository to use the latest Cypress version.
The examples directory contains examples of the use of Cypress (Current) Configuration which applies to Cypress 10 and later. These examples test and demonstrate the use of cypress-io/github-action.
The examples make use of npm, pnpm, Yarn 1 (Classic) and Yarn Modern to define and install the packages being used. For Yarn Modern the recommended Corepack is used as a Yarn version manager.
The previous examples/v9 are archived in the v5 branch. This directory contains examples which were set up to use Cypress 9.7.0
, the last version using Legacy Configuration, covering Cypress 9 and below. These v9
examples are no longer maintained.
-
A local system running Ubuntu, Microsoft Windows or Apple macOS.
-
Node.js as described in the CONTRIBUTING document.
-
git distributed version control system.
-
pnpm installed through:
npm install pnpm@latest -g
- Visual Studio Code or other editor
Under Microsoft Windows it may be necessary to also execute the following preparatory command:
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" --location user
When a new version of Cypress is published, the examples can be updated.
From the root of a local clone of the repository, execute:
npm run update:cypress
This updates all examples to cypress@latest.
.github/workflows/example-install-only.yml contains a hard-coded Cypress version number. This can be updated by hand.
After updating the examples locally, they can be committed with git and a pull request opened on GitHub.
The script /scripts/update-cypress-latest-yarn.sh (which is invoked through npm run update:cypress
to update the Yarn examples) runs Yarn 1 (Classic) as an npm
global install, runs Yarn Modern through Corepack and returns Corepack to its default disabled state on completion.