Cypress is an open source testing tool.
- The
scripts
section defines 2 jobs:yarn test
- runs two parallel processes:
yarn start
, which is a wrapper to./run local
, and runs the local applicationyarn cypress
, which opens cypress using chrome against the local instance
- runs two parallel processes:
yarn test:ci
- to be run in pipelines/actions
- runs cypress headless against the branch-specific instance of the application
- can also be used locally to run the test suite in the terminal (requires you to run ./run local separately)
cypress.config.js
may use any of these config options.
To run cypress tests locally you will go to the root of the project and you'll need an updated .env with variables for the state user and admin user passwords. To accomplish this there are multiple options.
-
If you have a 1Password account and 1Password CLI installed locally you can run
./run update-env
to pull values from 1Password and create an updated .env -
Alternatively, if you do not have a 1Password account you can copy the contents of the
.env.tpl
file to a.env
file at the top level of the repo and reach out to the team for appropriate values to be populated by hand. -
When you have an updated
.env
file can run tests from the top level of the repo using theyarn test
command.
If you run into errors after trying to run the cypress test command:
- run
yarn
in this folder - run
nvm use
in the root directory