Cypress debugging on the command line
In this section, we will explore how to use the command line debugging properties of Cypress to troubleshoot the problems that we may encounter when running our tests. We will also explore the different debugging options that Cypress offers through the command line.
Cypress has a built-in debug module that can be exposed to users by passing debug commands before you run the tests using either cypress run
or cypress open
. To receive debugging output from the Terminal, the DEBUG
environment variable needs to be set prior to the Cypress test runs in Mac or Linux environments.
The following scripts can be found in the chapter-03/
root directory's package.json
file and are used to show debug output when the commands are executed. The first script can be used to show debug output when the cypress open
command is used to run tests, while the second script can be used to show debug output when the cypress run
command is used to run tests: