https://cypress.io logo
Great tips! Thank you for your help. I came up wit...
# help
b
Great tips! Thank you for your help. I came up with something like this. Its ugly but it works 😄 Yours is cleaner will definitely use it 🙂
Copy code
var found = false
    function checkButton() {     
      cy.wait(500) 
      cy.get('body').then(($body) => {
        if ($body.find('.startButton').filter(':visible').length) {
          found = true
        }
    })
      console.log(found)
      return found;
  };

    cy.get('mat-panel-title').should('be.visible')
    .then(
      each(
        ($el) => {
          console.log(found)
          if (found === false) {
            cy.wrap($el).click();
          }
        },
        () => checkButton() === true,
      ),
    )
2 Views