You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.promisify seems to work perfectly well if used anywhere in an it block, but a before and beforeEach will exit early if .promisify is used in a before or beforeEach block and is not the last chain.
Example (doesn't work):
describe('when used with beforeEach',()=>{beforeEach(async()=>{awaitcy.wrap('foo').promisify()cy.get('body').should('not.exist')// assertion shows in the test, instead of the beforeEach hook})it('should not run any beforeEach commands in this block',()=>{cy.wrap('bar').should('equal','bar')})})
Example (works, but added await to every command after first await):
describe('when used with beforeEach',()=>{beforeEach(async()=>{awaitcy.wrap('foo').promisify()awaity.get('body').should('not.exist').promisify()// works as expected})it('should not run any beforeEach commands in this block',()=>{cy.wrap('bar').should('equal','bar')})})
Switching the first example to use before results in a Cypress error:
CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The text was updated successfully, but these errors were encountered:
.promisify
seems to work perfectly well if used anywhere in anit
block, but abefore
andbeforeEach
will exit early if.promisify
is used in abefore
orbeforeEach
block and is not the last chain.Example (doesn't work):
Example (works, but added
await
to every command after firstawait
):Switching the first example to use
before
results in a Cypress error:The text was updated successfully, but these errors were encountered: