Stop cy commands from running and allow interaction with the application under test. You can then "resume" running all commands or choose to step through the "next" commands from the Command Log.
This does not set a
debuggerin your code, unlike.debug()
.pause()
.pause(options)
cy.pause()
cy.pause(options)
Correct Usage
cy.pause().getCookie('app') // Pause at the beginning of commands
cy.get('nav').pause() // Pause after the 'get' commands yield
options (Object)
Pass in an options object to change the default behavior of .pause().
| Option | Default | Description |
|---|---|---|
log |
true |
Displays the command in the Command log |
.pause() yields the same subject it was given from the previous command. cy.get('a')
.should('have.attr', 'href')
.and('match', /dashboard/)
.pause()
cy.get('button').should('not.be.disabled')
.pause() can be chained off of cy or off another command. .pause() is a utility command. .pause() will not run assertions. Assertions will pass through as if this command did not exist. .pause() cannot time out. .click() commandcy.get('#action-canvas')
.click(80, 75)
.pause()
.click(170, 75)
.click(80, 165)
.click(100, 185)
.click(125, 190)
.click(150, 185)
.click(170, 165)
The commands above will display in the Command Log as:
When clicking on "Next: 'click'" at the top of the Command Log, the Command Log will run only the next command and pause again.
© 2017 Cypress.io
Licensed under the MIT License.
https://docs.cypress.io/api/commands/pause