What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use Cypress.stop() to stop the remaining tests in the current spec, control the Cypress command queue to end one test early, or configure Cypress Cloud Auto Cancellation to stop assigning new specs after a failure threshold. These mechanisms have different scopes and outcomes: Cypress.stop() does not cancel an entire parallel Cloud run, and a passing test cannot have a partial-pass status.
Choose the stop mechanism by scope
First decide what should stop and what result the test should have. A test can pass, fail, or be pending/skipped; Cypress does not provide a separate “partially passed” outcome for ending a test successfully at a condition.
As an Amazon Associate I earn from qualifying purchases.
| What should stop? | Use | Effect |
|---|---|---|
| Remaining tests in the current spec | Cypress.stop() |
In cypress run, Cypress skips the rest of that spec. In cypress open, execution stops and the app remains open for inspection. |
| Optional commands in one test | Conditional command-queue control | Leave the test passing by not queueing the optional commands. Commands queued elsewhere are not cancelled. |
| One test that should fail or be skipped | Throw an error, or call Mocha’s this.skip() |
Failing early records a failure; skipping records a pending/skipped outcome. |
| New specs across a recorded Cloud run | Cypress Cloud Auto Cancellation | After the configured failure threshold, Cloud stops assigning new specs and marks the run cancelled. Specs already running finish. |
Stop the remaining tests in the current spec
To stop after a test fails, use Cypress.stop() in an afterEach hook. The documented pattern is:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →afterEach(function () {
if (this.currentTest.state === 'failed') {
Cypress.stop()
return
}
})
The return prevents later statements in that same hook from running after the stop call. Without it, code later in the hook can still execute. This hook stops the current spec’s remaining tests; it does not stop all specs in a parallel Cloud run.
In cypress run, remaining tests in the spec are skipped. In cypress open, execution stops and the app is left open so you can inspect it.
End one test early without failing it
Cypress commands are queued. A return from a .then() callback prevents commands inside that callback from being queued after the return, but it cannot cancel commands that the test already queued elsewhere. Put conditional follow-up work inside the callback when it may need to be skipped.
it('checks for a dashboard link when one is available', () => {
cy.get('a').then(($links) => {
const hasDashboard = [...$links].some(
(el) => el.innerText.trim() === 'Dashboard'
)
if (hasDashboard) {
return
}
// Queue any conditional follow-up commands here.
cy.get('[data-cy="fallback-content"]').should('be.visible')
})
})
Here, finding the Dashboard link returns from the callback before the fallback check is queued. If commands that you meant to avoid were queued outside the callback, they still run; reorganize the test so those commands are only queued in the branch that needs them.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choose failure or skip when that is the intended result
- Fail early: throw an error from the callback when the condition means the test has failed. The test is recorded as failed.
- Skip at runtime: call
this.skip()in a regularfunction () {}Mocha test callback. Do not use an arrow function for that callback, because Mocha bindsthisfor the skip operation.
Cancel a recorded Cloud run after a failure threshold
For a recorded Cypress Cloud run, Auto Cancellation is the run-wide option. It applies across machines: after the threshold is reached, Cloud stops handing out new specs and marks the run cancelled, while specs already in progress finish. The Cypress documentation lists a default threshold of one genuine failure. You can configure a different threshold or disable the project setting for an individual run.
npx cypress run --record --key YOUR_RECORD_KEY --auto-cancel-after-failures 5
To disable the project setting for one run, pass false for the option:
npx cypress run --record --key YOUR_RECORD_KEY --auto-cancel-after-failures false
Auto Cancellation is documented for Cypress Cloud Business and Enterprise plans. Plan availability and Cloud settings can change, so verify current availability in your project’s Cypress Cloud settings before relying on it.
Rank #4
When not to cancel the whole run
Keeping the full suite running can be useful when a branch or scheduled workflow needs results from every spec—for example, to establish release readiness or gather broad audit or coverage results. In that case, disable Auto Cancellation for that run or choose a higher threshold rather than treating a cancelled run as a complete suite result.
Retries do not stop the suite
Retries rerun a failing test; they are not a stop mechanism. Cypress reruns that test’s beforeEach and afterEach hooks, which adds execution time. Failures in before and after hooks do not trigger retries. A configured retry count means additional attempts beyond the initial attempt.
Best Value
Cypress documents retries as zero by default in both run mode and open mode. Set retry behavior intentionally for each workflow, and avoid using a large retry count as a substitute for deciding when a spec or run should stop.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the common scope and queue mistakes
- Other specs keep running after
Cypress.stop(). That call stops the current spec, not the whole parallel Cloud run. Use Auto Cancellation for a recorded run-wide threshold. - Statements later in the hook still execute. Return after calling
Cypress.stop()if the rest of that same hook must not run. - Commands run even after an early return. They were likely queued outside the
.then()callback. Move optional follow-up commands inside the callback and queue them only in the branch that needs them. this.skip()cannot access the test context. Use a regular function callback rather than an arrow function so Mocha can bindthis.- Auto Cancellation does not stop an active spec immediately. It stops Cloud from assigning new specs once the threshold is met; specs already in progress finish.
- Retries make a failing run take longer. Check configured retries and remember that each failed test attempt reruns its
beforeEachandafterEachhooks.
Or skip the browser setup
For a website screenshot—not for controlling Cypress test execution—ScreenshotNeo offers a one-request capture through its website screenshot API. See the ScreenshotNeo documentation for API options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie banners are accepted and removed before capture; known consent platforms, newsletter popups, and chat widgets can also be removed, with each step configurable.
- Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; response headers identify the page verdict and billing status.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




