typescript-book icon indicating copy to clipboard operation
typescript-book copied to clipboard

Execute synchronous code in the cypress command execution pipeline

Open basarat opened this issue 7 years ago • 0 comments

cy.then is not the same as a promise then, so don't use it with async/await.

The key usecase for then is to inject synchronous code into the cypress command execution pipeline.

e.g.

cy.something()
cy.then(()=>{
  // This code will only execute after something is done. 
})

basarat avatar Oct 25 '18 04:10 basarat