The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Reliable Cypress tests are independent, select elements through stable test attributes, wait for observable application state instead of guessed delays, and make CI wait until the app is ready. Retries can expose intermittent failures, but they do not make an unstable test reliable.
Make each test pass on its own
A test should establish the state it needs, exercise a behavior, and verify the result without depending on another test’s order or side effects. Cypress recommends that tests run independently and still pass. See Cypress best practices and writing and organizing Cypress tests.
In end-to-end testing, testIsolation: true is the default. Before a test, Cypress visits about:blank and clears cookies, localStorage, and sessionStorage. It also resets aliases, clock mocks, intercepts, spies, stubs, and viewport changes between tests. Do not assume every browser store is cleared: IndexedDB and other storage mechanisms persist. Component testing resets the rendered component and the named stores, and Cypress says the testIsolation configuration is not supported for component testing. Details are in Cypress test isolation documentation.
Keep setup explicit
Set up the relevant user, records, or server state for the test that needs it. If repeated UI login is unnecessary, use cy.session() or programmatic setup, while making the state requirements clear. Disabling isolation can save setup time, but increases the risk of leaked state; only consider it after confirming tests pass independently.
Choose selectors that survive interface changes
Use dedicated data-* attributes, such as data-cy, for elements that tests need to find. They are independent of styling and application behavior. A CSS class or generic tag may change during a redesign even when the tested behavior does not.
Use visible text when the wording itself is part of the behavior you intend to verify—for example, checking that a button says “Save changes.” Avoid using changeable copy as a generic locator when the test only needs to click the control. Cypress notes that the cypress/require-data-selectors rule in eslint-plugin-cypress can enforce data attributes. See the selector guidance.
Example
// In the application markup:
<button data-cy="submit-order">Place order</button>
// In a Cypress test:
cy.get('[data-cy="submit-order"]').click()
cy.get('[data-cy="order-confirmation"]').should('be.visible')
The selector identifies the control by its test-specific contract; the assertion checks the resulting UI state.
Synchronize on state, not a guessed sleep
Cypress retries linked queries and assertions while waiting for the UI to reach the expected state. A fixed delay such as cy.wait(2000) is both slower when the page is fast and still vulnerable to racing when it is slow. Prefer an assertion on the state the user cares about. Read the limits of this mechanism in Cypress retry-ability.
Recommended Free Tools
Queries retry; actions run once
Retry-ability is not a blanket guarantee that Cypress will repeat every command safely. Queries and their linked assertions retry; non-query commands such as .click() execute once. Because an action changes state, generally end the query chain at the action, then start a fresh query to assert its effect.
cy.get('[data-cy="save"]').click()
cy.get('[data-cy="save-status"]').should('have.text', 'Saved')
Do not base a test on a conditional guess about a changing page. Cypress notes that conditional testing is reliable only when the relevant application state is known to have settled; see conditional testing.
Rank #4
Use test retries as a diagnostic signal
Cypress test retries are off by default. They can help surface flaky tests or reduce disruption from transient failures, but a test that passes only on a retry has still demonstrated instability. Track which tests need retries and investigate race conditions, uncontrolled state, or unstable dependencies instead of treating a retry-pass as clean evidence. See Cypress test retries.
Retries also add time to a failing run. Set a deliberate policy for the suite, and keep retry results visible so intermittent failures do not disappear into an apparently green build.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
Make CI wait for the application to be ready
Starting a background server and immediately invoking Cypress creates a race: the tests may start before the application responds. Use a readiness check rather than an arbitrary sleep. The Cypress CI guide describes the GitHub Action’s start and wait-on options for starting a server and waiting for it without extra packages.
- Configure the workflow to start the application or test server.
- Wait for the server’s response using a readiness check, such as the action’s
wait-onoption where applicable. - Run Cypress only after readiness succeeds.
- Run the suite on pushes or pull requests so failures are visible during development.
Readiness checks address startup timing; they do not compensate for tests that share state or depend on arbitrary timing.
Troubleshoot intermittent failures systematically
- A test fails when run alone but passes in the suite: inspect order dependencies and shared state. Make its setup self-contained and check whether persistent storage, including IndexedDB, is involved.
- A selector breaks after a visual redesign: replace styling- or structure-dependent selectors with a dedicated
data-cyattribute, unless the visible wording is what the test is meant to verify. - A test fails intermittently around a UI update: remove guessed delays and assert on the expected state with a retryable query. Ensure actions are followed by a fresh query and assertion.
- A test passes on retry: treat it as evidence of instability. Identify the affected test and examine timing, setup, and dependencies rather than assuming retries repaired it.
- CI fails before the page loads: check that the server is started and responding before Cypress begins; do not rely on a fixed-duration pause.
- A failure occurs only in CI or one browser: use the available screenshots, video, or Test Replay to inspect it, reduce it to a smaller reproducer, and compare the failing browser and local-versus-CI conditions. Cypress’s troubleshooting guide covers these investigation paths.
Or skip the browser setup
If you need a website screenshot rather than an interactive test, ScreenshotNeo is a screenshot API and MCP server for developers. One GET request can return an image or PDF. For example, using cURL:
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 parameters. It can accept cookie or consent banners and remove 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month, with no card 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.




