https://cypress.io logo
<@781454753737211904> try this `Cypress.Commands.a...
# e2e-testing
a
@early-article-61542 try this
Copy code
Cypress.Commands.add('yourCustomCommand', () => {
  cy.wait(4000)
  cy.get('body')
    .then($body => {
      if (${elementYouWantToClick/wait}.length) {
        return true;
      }

      return false;
    })
    .then(boolean => {
      if(boolean){
        cy.get(${elementYouWantToClick).click();
      } else {
        cy.wait(100)
      }
  });
})