Run the following command on your project : npm i cypress --save-dev
At first launch (with command run npm cypress:open
), a wizard help you to configure Cypress
The following commands have to be writed in the scripts
section of your package.json
:
"cypress:open": "cypress open"
: allow you to run tests with UI"cypress:run": "cypress run"
: allow you to run all the tests in the CLI. Use this commands in your CI.
- Create a
tsconfig.json
- Rename
cypress.config.js
tocypress.config.ts
- Rename
commands.js
tocommands.ts
- Rename
e2e.js
toe2e.ts
In the cypress
folder add a e2e
folder. You are ready to create your first !
You just have to add a *.spec.ts
file in the previous folder created.
This is the core of the tests. These files will gather all the scenarios and stages that compose them.
These are the input data placed by the developer for testing purposes.