Free tools Windows power users keep installed
One-click scans. No signup required.
To retry a failed test automatically, set Cypress’s retries option; retries are off by default. To rerun a spec after a run has finished, select it with --spec. For recorded CI runs, Cypress Cloud can also optimize reruns to repeat failed specs—or, with the required version and setup, only tests that did not pass.
Choose the right kind of retry
| What you need | Use | When it happens |
|---|---|---|
| Repeat a failed test automatically | Cypress test retries | During the same cypress run or cypress open execution |
| Run one spec again after the run ends | CLI --spec |
In a new Cypress execution |
| Rerun a recorded CI build while skipping work that passed | Cypress Cloud Re-run optimization | After the original recorded CI run completes |
These options differ in timing and granularity. A retry is another attempt at a test that failed; a rerun starts work again after a run has completed.
As an Amazon Associate I earn from qualifying purchases.
Configure automatic test retries
Cypress retries are disabled by default: both runMode and openMode default to 0. Set a number to specify how many additional attempts Cypress may make after the initial attempt. Thus, retries: 2 allows up to three attempts in total. See Cypress’s Test retries guide and configuration reference.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Set one count for both modes
In the project’s Cypress configuration file, set a single number to use the same retry count in interactive and headless modes:
#1 Best Overall
const { defineConfig } = require('cypress')
module.exports = defineConfig({
retries: 2,
})
Set separate counts for run and open
Use an object when you want different behavior for CI/headless runs and interactive debugging. For example, this permits two additional attempts in cypress run but none in cypress open:
const { defineConfig } = require('cypress')
module.exports = defineConfig({
retries: {
runMode: 2,
openMode: 0,
},
})
For a TypeScript configuration, import defineConfig from cypress and use the same retries object. Keep the syntax consistent with the project’s module format.
Override retries for a targeted test
Cypress also supports retry configuration for an individual test. Use that when a specific case needs a different policy, rather than raising the retry count globally for every test. The guide covers per-test configuration alongside global settings.
Know which hooks run again
When Cypress retries a test, its beforeEach and afterEach hooks run again. A failure in a suite-level before or after hook does not trigger a test retry. Account for this when setup or teardown changes shared state.
Rank #2
Rerun one failed spec from the command line
From the project root, run the spec again with --spec:
npx cypress run --spec "cypress/e2e/my-spec.cy.js"
Replace the example path with the spec you want to execute. The path must match the project’s configured specPattern; a valid file that does not match that pattern will not be selected. The CLI option accepts a file or glob and can select multiple comma-separated spec paths. See the Cypress CLI reference.
Pass the option through an npm script
If an npm script wraps the Cypress command, put -- before Cypress options so npm passes them through:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →npm run e2e:chrome -- --spec "cypress/e2e/my-spec.cy.js"
Use the script name defined in your project’s package.json. The command starts a new run of the selected spec; it does not resume the prior run or restrict execution to only the individual failed test inside that file.
Rank #3
Rerun failed work in Cypress Cloud CI
Cypress Cloud’s Re-run optimization is for rerunning a recorded CI build. It compares the rerun with the latest completed run in its rerun group, called the anchor run, and can skip work that passed there. Its behavior depends on the Cloud tier, project and organization settings, CI provider, runner version, and rerun grouping; check the current Re-run optimization documentation for availability and setup.
Choose failed specs or failed tests
- Run only failed specs: reruns each spec containing a failure. Other tests in those specs can run again even if they passed in the anchor run.
- Run only failed tests: is more selective and reruns tests that did not pass. This mode requires Cypress 15.21.0 or later.
The documentation lists Business or Enterprise Cloud tiers and a free trial for this feature. Confirm the current plan eligibility and project settings before relying on it.
Check CI provider and rerun grouping
Documented supported providers include GitHub Actions, Azure Pipelines, CircleCI, Bitbucket Pipelines, and GitLab CI; provider support can have version conditions. For other CI providers, Cypress documents manual setup with CYPRESS_RERUN_GROUP_ID. Before expecting passed work to be skipped, verify that the provider and runner meet the documented conditions, the project has the feature configured, and the rerun is associated with the intended group.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsInvestigate a recorded failure from the terminal
For recorded CI failures, Cypress Cloud CLI can retrieve run status and failure details, including screenshots and Test Replay data. Cypress documents it as available on Cloud plans including Starter at no additional cost. See Cloud CLI: Debug CI failures from your terminal.
Rank #4
Distinguish test retries from query retry-ability
Cypress has two different retry mechanisms. Linked queries and assertions retry together while Cypress waits for a condition; non-query commands execute once. By contrast, retries reruns a failed test attempt. See Retry-ability in Cypress.
If an assertion races a changing page, increasing test-level retries may conceal a synchronization or assertion problem. Check whether the test uses retryable queries and asserts the condition that actually indicates the page is ready.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Diagnose common problems
The failed test ran only once
Check the effective retry configuration for the mode you used. A configured runMode does not set the interactive openMode count, and vice versa; zero means no additional attempts.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →A hook failed, but Cypress did not retry
Test retries are triggered by test failures, not failures in before or after hooks. Inspect suite-level setup or teardown separately; retrying the test will not address that hook failure.
The CLI says no specs were found
Confirm the working directory, exact path or glob, and configured specPattern. If you invoke Cypress through an npm script, ensure the options follow the script’s -- separator.
Cloud rerun executes more tests than expected
If the selected mode is failed specs, all tests in each failing spec may execute, including tests that passed previously. Failed-test-only reruns require Cypress 15.21.0 or later. Also verify Cloud eligibility, provider support, project settings, and rerun-group configuration.
A later attempt passes, but the failure returns
A pass on retry is evidence of a flaky test, not proof that the underlying issue is fixed. Review the failed attempt’s logs, screenshots, and environment-dependent conditions; repeated retries increase execution work and can make persistent failures less visible.
Recommended Free Tools
Or skip the browser setup
If your task is to capture a page screenshot while debugging a test or documenting its state, ScreenshotNeo provides a one-request screenshot API. It is not a Cypress retry or rerun mechanism.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners and consent notices, newsletter popups, and chat widgets are removed before capture; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up free for ScreenshotNeo.
Frequently Asked Questions
Does Cypress retry tests by default?
No. The default retry count is 0 in both run and open modes.
Does a retry rerun the entire spec?
A test retry is an additional attempt at the failed test. A CLI spec rerun runs the selected spec in a new execution.
Can Cypress retry a failed before hook?
No. Failures in suite-level before and after hooks do not trigger a test retry.
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.




