Special debugging commands
If jumping through commands is not your thing, or you are finding it difficult to understand how travelling back in time shows you the order of execution in a test, Cypress has got your back. Cypress includes commands that are helpful for debugging and even gives you the options that you would have when using normal code debuggers. The two commands that we will be exploring in this section are as follows:
cy.debug()
cy.pause()
Using these Cypress debug commands, we can understand how to debug Cypress from the tests themselves. These two special debugging commands will allow us to directly control the debug process as we execute our tests. Having the ability to stop execution within the tests themselves gives us the advantage of only having to debug the specific sections that are throwing errors in Cypress.
cy.debug
The cy.debug()
command is, by default, the debugging command that Cypress offers out of the box. The command will log...