title: How to use condition statement when we want to check that class exist or not?
body: <p>In the Cypress I want to create a condition to check if a class was created or not, and make same steps if yes.</p>
  
  <p>I saw a documentation at:</p>
  
  <p><a href="https://docs.cypress.io/guides/core-concepts/conditional-testing.html#A-B-campaign" rel="nofollow noreferrer">https://docs.cypress.io/guides/core-concepts/conditional-testing.html#A-B-campaign</a></p>
  
  <p>I wrote an example:</p>
  
  <pre><code> cy.get('.footerWrapper').then((div) =&gt; {
          if (div.find('.TestClass')) {
              cy.log('xxx')
  
          } else {
              cy.log('yyy')
          }
      })
  </code></pre>
  
  <p>But the condition is always true, even when I use find() and children() and 'TestClass' class not exist. 'TestClass' is child of 'footerWrapper' class </p>
  
  <p>How should it be written? Does anyone have any idea?</p>