So I am trying to migrate our existing protractor test suite to cypress. For one of the tests, we have scenario where we can have two expected conditions which easier to handle in protractor. But I was wondering if there is any similar cypress command function to achieve that?? sharing the code snippet
confirmation.getConfirmButton().click().then(() => {
// We will either get a successful cancellation OR an alert modal with an OK
// button saying that the contract cannot be cancelled yet
browser.wait(ExpectedConditions.or(
ExpectedConditions.textToBePresentInElement(this.getViewAllFirstStatus(), "Cancelled"),
ExpectedConditions.elementToBeClickable(this.getModalOkButton())
), 5000);
this.getModalOkButton().isPresent().then((present) => {
if (present) {
this.getModalOkButton().click().then(() => {
browser.sleep(8000).then(() => {
this.cancelFirstContract();
});
});
}
});
});