title: Cypress: how to mark a single test as failed but continue to run other tests?
body: <p>Currently when a single test in <code>it()</code> block fails Cypress halts completely.</p>
  
  <p>I want Cypress to continue running subsequent tests regardless if a previous test failed or not (but I still want to mark the failed tests so I know which one failed).</p>
  
  <p>I tried to intercept the fail event in <code>beforeEach</code>:</p>
  
  <pre><code>beforeEach(() =&gt; {
          Cypress.on('fail', (error, runnable) =&gt; {
              cy.log('this single test failed, but continue other tests');
              // don't stop!
              // throw error; // marks test as failed but also makes Cypress stop
          });
  </code></pre>
  
  <p>But it appears I cannot use any <code>cy</code> commands inside this handler because when I do it returns an error due to Cypress weird internal promise logic:</p>
  
  <blockquote>
    <p>CypressError: Cypress detected that you returned a promise from a
    command while also invoking one or more cy commands in that promise.</p>
    
    <p>The command that returned the promise was:</p>
    
    <blockquote>
      <p>cy.wait()</p>
    </blockquote>
    
    <p>The cy command you invoked inside the promise was:</p>
    
    <blockquote>
      <p>cy.log()</p>
    </blockquote>
    
    <p>Because Cypress commands are already promise-like, you don't need to
    wrap them or return your own promise.</p>
    
    <p>Cypress will resolve your command with whatever the final Cypress
    command yields.</p>
    
    <p>The reason this is an error instead of a warning is because Cypress
    internally queues commands serially whereas Promises execute as soon
    as they are invoked. Attempting to reconcile this would prevent
    Cypress from ever resolving.</p>
    
    <p><a href="https://on.cypress.io/returning-promise-and-commands-in-another-command" rel="noreferrer">https://on.cypress.io/returning-promise-and-commands-in-another-command</a></p>
  </blockquote>
  
  <p>If I leave the <code>Cypress.on('fail')</code> block empty all tests are going to be marked as passed even if they fail.</p>
  
  <p>If I uncomment <code>throw error</code> Cypress will halt completely on any failed test.</p>