cypress wait element then perform next action

Viewed 142

i have a page which loads after 6secs before buttons appeared.

I want the script does not fail, wait for the button then perform clicks.

the cypress documentation stated "wait for an aliased resource" ,

i am not sure what is this and how to integrate to current script:

cy.contains('Button A').click()
1 Answers

You can add a timeout for 6 seconds and more.

cy.contains('Button A',{ timeout: 6000 }).should('be.visible').click()
Related