I have an anchor in an Angular app which is disabled until the page content loads, which takes some time. Is there any way to click it only after it stops being disabled?
I tried with:
const myItems = cy.get('whatever-selectors');
myItems.contains('some text', {timeout: 10000}).should('not.be.disabled').click();
This doesn't work.
The documentation states that Cypress will retry clicking until the should condition is fulfilled or the timeout is exceeded, but it fails after less than half the time.
Any suggestions?
You should apply the timeout: 10000 with cy.get()
cy.get('whatever-selectors', {
timeout: 20000
}).should('be.enabled').click();