TroubleShooting

Let’s have a look at some more testing features available in Cypress.

We'll cover the following

screenshot command

Cypress has a few ways to let us monitor testing. First off, each step in a test produces a snapshot that we can look at in the test runner and also inspect via the browser console that we are using. We can also trigger a screenshot to the cypress/screenshots directory by using the screenshot command.

We can send an arbitrary message to the browser console log with cy.log("message"), and we can have Cypress log the result of any chain of messages by placing debug() at the end of the chain. In the next chapter, we go into the specifics of using the Cypress test runner to debug Cypress tests.

Get hands-on with 1200+ tech skills courses.