I know it works most of the time, but on a web page I tested, on following line
cy.get('button[title="Query"]').click()
Cypress runner passed get but hung on the click action till timeout. If I modify the code to
cy.get('button[title="Query"]').as('query')
cy.wait(500)
cy.get('@query').click()
The test succeeds.
Obviously arbitrary wait is a bad practice. Automatic waiting, retry-ability - as claimed by Cypress as features, are suppose to prevent above scenario from happening but failed in my case.
Furthermore, Cypress has no should('be.clickable') assertion. How could I instruct Cypress to wait for a button to be clickable before clicking it, or if clicking hung, then retry with a interval until success?