I want to make a code to check if certain items in the list are clickable. If they are not, you want to go over them and look further in the list of other items that may be clickable. Well, I wish that when the "remove allocation" button doesn't exist, I can skip it and the code goes on.
It's about the sequence cy.contains('Remove allocation') In this moment with my code, at this line i have error "Timed out retrying after 4000ms: Expected to find element: [title="Remove Allocation"], but never found it."
it('Find transaction for refund', function() {
cy.wait(1500)
for(let count=7; count<=10; count++) {
cy.get('.text-center').eq(count).click()
cy.wait(1500)
if(cy.contains('Remove allocation')) {
cy.get('.js-delete').eq(count).click()
cy.contains('Yes').click()
cy.wait(1000)
cy.scrollTo(500, 0)
count=count+1;
cy.wait(1000)
} else {
count=count+1;
}
}
}