Here is a simplified version of what I'm doing:
it.only("replicate issue", () => {
cy.wrap(1).then((num) => {
return new Cypress.Promise((resolve) => {
expect(num).to.equal(1);
cy.wrap(num)
.then(() => {
// THIS DOES NOT GET LOGGED
console.info("...well... then...");
return 2;
})
.then(resolve);
});
});
//.then(... I want to do more stuff with the value resolved by the promise)
});
Everything seems to go well until cy.wrap(num) where the chained .then() method's callback never gets called. I get cy.then() timed out after waiting 4000ms.
How come this happens, and what can I do to make Cypress continue execution?