How to debug an existent Test

In case a test need to be debugged you can use one of the next methods:

.debug()

In this case you just need to add a .debug() to your cy.get(), so you can watch what's happening with that selector in runtime, for example:

it('debug test', () => {
cy.visit('/my/page/path')
‚Äč
cy.get('.selector')
.debug()
})

So, once you run your tests, you'll be able to watch the behavior of the selector inside the console in developer tools:

.pause()

Also .pause() can be used in any moment, so if you want to watch a selector or something in the developer tools you can add it before the moment you want to debug, just like this:

it('adds items', () => {
cy.pause()
cy.get('.new-todo')
// more commands
})

Guides

For more information about cypress, you can find all the guides provided by them here.