typescript-book
typescript-book copied to clipboard
Execute synchronous code in the cypress command execution pipeline
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.
})