title: Cypress: Conditional AssertionError
body: <p>Is there a way to NOT abort a test run if an <code>AssertionError</code> appears?</p>
  <p>My test case is dependent on CSS values and if I write a condition like the one below, <code>cypress</code> stops with an <code>AssertionError</code>:</p>
  <pre class="lang-js prettyprint-override"><code>let dialog = cy.get('#privacy_dialog')
  if (dialog.should('have.css', 'display', 'block')) {
    // confirm the dialog if it is displayed
    cy.get('#dialog_btn').click()  
  } else {
    // process with login, because css in this case is &quot;display: none;&quot;
    cy.get('#login_btn').click()
  }
  </code></pre>
  <p>It also wouldn't work this way, because then I get another error <code>TypeError $dialog.should is not a function</code>:</p>
  <pre class="lang-js prettyprint-override"><code>cy.get('#privacy_dialog').then(($dialog) =&gt; {
    if ($dialog.should('have.css', 'display', 'block')) {
      cy.get('#dialog_btn').click()
    } else {
      cy.get('#login_btn').click()
    }
  })
  </code></pre>