title: Cypress: interrupt all tests on first failure
body: <p><strong>How to interrupt all Cypress tests on the first test failure?</strong> </p>
  
  <p>We are using semaphore to launch complete e2e tests with Cypress for each PR. But it takes too much time.</p>
  
  <p>I'd like to interrupt all tests on the first test failure. </p>
  
  <p>Getting the complete errors is each developer's business when they develop. I just want to be informed ASAP if there is anything wrong prior to deploy, and don't have to wait for the full tests to complete.</p>
  
  <p>So far the only solution I came up with was interrupting the tests on the current spec file with Cypress.</p>
  
  <pre><code>afterEach(() =&gt; {
          if (this.currentTest.state === 'failed') {
              Cypress.runner.end();
          }
      });
  </code></pre>
  
  <p>But this is not enough since it only interrupts the tests located on the spec file, not ALL the other files. I've done some intensive search on this matter today and it doesn't seem like this is a thing on Cypress.</p>
  
  <p>So I'm trying other solutions.</p>
  
  <p>1: with Semaphore</p>
  
  <pre><code>fail_fast:
    stop:
      when: "true"
  </code></pre>
  
  <p>It is supposed to interrupt the script on error. But it doesn't work: tests keep running after error. My guess is that Cypress will throw an error only when all tests are complete.</p>
  
  <p>2: maybe with the script launching Cypress, but I'm out of ideas
  Right now here are my scripts</p>
  
  <pre><code>"cy:run": "npx cypress run",
  "cy:run:dev": "CYPRESS_env=dev npx cypress run",
  "cy:test": "start-server-and-test start http-get://localhost:4202 cy:run"
  </code></pre>