Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Intermittent Cypress HTTP failures become tractable when you first identify which request path failed and whether Cypress received an HTTP response at all. A direct cy.request() runs from Cypress’s Node process; an application request observed with cy.intercept() runs through the browser path. A received 4xx/5xx status, a transport-level network error, and a timeout require different fixes.

Use the workflow below to preserve the first failure, classify it, then change only the setting that addresses that class of failure. Examples follow the current Cypress documentation checked September 29, 2026; verify defaults against the Cypress version installed in your project.

Start by capturing the exact failure

Before increasing retries or timeouts, record the command, complete error text, Cypress version, browser, environment, URL, method, elapsed time, response status (if any), response body and headers, and whether the failure is local, CI-only or environment-specific. This first record prevents a non-2xx response from being mislabeled as a network failure.

  • HTTP response: the server answered with a status such as 401, 404 or 503.
  • Network error: Cypress could not complete the connection or transport.
  • Timeout: the operation exceeded the applicable waiting period.
  • Test retry: Cypress reran the entire test after a failure; this is different from request retries and assertion retry-ability.

Keep the initial failed attempt and any later retry artifacts. A passing rerun proves intermittency, not its cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Choose the correct Cypress request path

Direct API calls with cy.request()

Use cy.request() when the test itself should call an endpoint. It executes from Cypress’s Node process, not from the application’s browser context. Cypress uses the host from a previous cy.visit() when applicable, or the configured baseUrl if the request is the first command that needs a host.

Browser traffic with cy.intercept()

Use cy.intercept() to observe, wait for or stub requests made by the application in the browser. It does not spy on cy.request(); Cypress documents these as separate paths (FAQ). Trying to intercept a direct request will therefore produce a misleading “no match” diagnosis.

Fix expected 4xx and 5xx responses from cy.request()

By default, cy.request() fails when the response status is outside the 2xx and 3xx ranges because failOnStatusCode is true. If the purpose of the test is to verify an expected error, allow the response through and assert it explicitly:

it('rejects an invalid token', () => {
  cy.request({
    method: 'GET',
    url: '/api/account',
    headers: { Authorization: 'Bearer invalid-token' },
    failOnStatusCode: false
  }).then((response) => {
    expect(response.status).to.eq(401)
    expect(response.body).to.include({ error: 'unauthorized' })
  })
})

Do not use failOnStatusCode: false to hide an unexpected outage. Assert the status and the meaningful response fields so a 500 cannot silently pass as an intended 401.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Check the host and request context

Confirm that the URL resolves to the intended service, credentials and test data belong to that environment, and a prior cy.visit() has not supplied an unexpected host. A missing or incorrect baseUrl can look like an intermittent service failure when the test is actually calling the wrong address.

Separate network retries from status-code retries

The current cy.request() documentation states that retryOnNetworkFailure defaults to true and Cypress retries a network failure up to four times. Retries for received status codes are different: retryOnStatusCodeFailure defaults to false and, when enabled, retries up to four times.

cy.request({
  method: 'GET',
  url: '/api/report',
  retryOnNetworkFailure: true,
  retryOnStatusCodeFailure: true,
  failOnStatusCode: false
}).then((response) => {
  expect(response.status).to.be.oneOf([200, 503])
})

Enable status retries only after capturing the first response and deciding that repeating the operation is safe. A retry may repeat side effects for an endpoint that is not idempotent, and it can conceal a server defect. The documented four-attempt limit is a Cypress request behavior, not evidence that any particular service is healthy.

Use the relevant timeout

For a slow direct request, investigate responseTimeout, the timeout relevant to receiving the response. Raising an unrelated command timeout does not explain why a server or CI environment was slow. Set a larger value only when the endpoint’s legitimate response time warrants it, and continue collecting server-side timing data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Intercept and diagnose browser requests

Register the route before the UI action that triggers it, match the method and URL, assign an alias, and wait for that alias. Cypress’s network guide and cy.intercept() API describe this pattern:

it('shows an API error in the UI', () => {
  cy.intercept('POST', '**/api/orders').as('createOrder')

  cy.get('[data-cy=submit-order]').click()

  cy.wait('@createOrder', { requestTimeout: 10000, responseTimeout: 30000 })
    .then((interception) => {
      expect(interception.request.body).to.have.property('items')
      expect(interception.response.statusCode).to.eq(422)
    })

  cy.contains('Correct the highlighted items').should('be.visible')
})

If no request matches, verify that the click or other action really triggers a request, that the method is correct (for example, POST rather than PUT), that the URL pattern covers the actual host and path, and that interception was installed early enough. If a response is present, assert its status and relevant payload. If Cypress reports a network error instead, correlate the run with browser, proxy, service and CI logs rather than treating it as an HTTP status.

Deliberately test network-error handling

For a controlled failure-state test, force a network error instead of waiting for an unreliable outage:

cy.intercept('GET', '**/api/profile', { forceNetworkError: true }).as('profileFailure')
cy.visit('/profile')
cy.wait('@profileFailure')
cy.contains('Unable to load your profile').should('be.visible')

forceNetworkError is useful for verifying the application’s recovery UI; it does not diagnose why a real environment failed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Choose live responses or deterministic stubs deliberately

When to call the real service

Keep real responses on critical end-to-end paths where the client-server contract matters. These tests can reveal authentication, schema and deployment problems, but they require seeded data and are exposed to service latency and dependency variability.

When to stub

Stub a route when you need a deterministic status, body, headers or delay, or when creating the live condition is impractical. A stub can reliably exercise validation, rate-limit and outage UI states. It cannot prove that the live service is available or returns the same contract.

cy.intercept('GET', '**/api/invoices', {
  statusCode: 503,
  body: { error: 'temporarily_unavailable' },
  headers: { 'retry-after': '30' },
  delay: 250
}).as('invoicesDown')

cy.visit('/billing')
cy.wait('@invoicesDown')
cy.contains('Try again later').should('be.visible')

A balanced suite uses live checks for contract-critical journeys and stubs for edge-state coverage; making every test live increases variability, while stubbing every test removes assurance that the service works.

Do not confuse request retries with test retries

Request-level options affect one cy.request(). Cypress test retries rerun the failed test, and command assertions have their own retry-ability. A test that passes only on its second run is a signal to inspect artifacts and environment logs, not a resolution. Determine whether the request never left the browser, timed out, reached the server and received a status, or encountered data and state contamination. Cypress introduced test retries in its Cypress 5.0 article; consult the current retry configuration for your installed release before changing project settings.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A practical troubleshooting decision tree

  1. Did Cypress receive an HTTP status? If yes, handle an expected 4xx/5xx with failOnStatusCode: false and assertions. If no, continue.
  2. Was the command cy.request()? Check host resolution, credentials, service availability and network retry behavior. If it was browser traffic, continue with interception checks.
  3. Did the browser route match? Install the intercept before the action, then verify method, URL, query string and host. Wait on the alias.
  4. Was it a timeout? Inspect responseTimeout for requests and the request/response stages of cy.wait() (documentation). Compare elapsed time with service and CI logs before increasing limits.
  5. Is the operation safe to repeat? Only then consider retryOnStatusCodeFailure. Do not apply it reflexively to writes or state-changing calls.
  6. Is the failure reproducible only with live dependencies? Add a deterministic stub for the UI error case, while retaining at least one live contract path.

Common intermittent-failure symptoms and fixes

Symptom Likely classification Targeted action
Test stops on an expected 401 or 422 Received HTTP status Set failOnStatusCode: false; assert status and payload.
cy.intercept() alias never receives cy.request() Different execution paths Use cy.request() assertions for direct calls; intercept only browser requests.
Alias wait says no request matched Matcher or timing problem Register earlier; verify method, URL, host and triggering action.
Occasional connection reset or DNS error Network failure Inspect environment and service logs; Cypress network retries are enabled by default, up to four attempts.
Occasional 503 response Status-code failure Capture the first response; decide whether a safe, opt-in status retry is appropriate.
Request exceeds wait limit Timeout Inspect responseTimeout or the applicable cy.wait() timeout and investigate server latency.

Performance, reliability and cost considerations

Every live request adds dependency on service startup, data preparation, network distance and shared-environment load. Parallel CI runs can amplify collisions in mutable test data. Use isolated fixtures, idempotent setup and cleanup, and record correlation IDs when your service supports them. Keep request and test retries bounded so a failing build does not consume a large portion of the CI job while hiding the original evidence.

Stubs usually make feedback faster and repeatable, but they shift correctness responsibility into the fixture. Validate that stubbed schemas remain aligned with the API, and retain scheduled or release-gate tests against the real service. A timeout increase changes waiting behavior; it is not a capacity fix.

Or skip the browser setup

If you need a clean visual record of a Cypress page or test environment, ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks, blank pages, failed loads, timeouts and cache hits are not billed, and response headers identify the page verdict and billing result.

One GET request is enough (see the ScreenshotNeo documentation):

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://docs.cypress.io -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://docs.cypress.io"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://docs.cypress.io' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
const body = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', body);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. It supports full-page and element captures, device and viewport settings, dark mode, custom CSS/JavaScript, waits, request blocking, headers, cookies, authorization, geolocation, PDFs, signed links, asynchronous jobs, bulk capture of up to 100 URLs per call and more. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

FAQ

Should I assert the response body on every failure?

Assert the fields that define the behavior under test. For an error contract, status plus a stable error code or message is usually more useful than matching volatile timestamps or request IDs.

Can a stubbed 503 replace an end-to-end outage test?

No. It verifies the application’s handling of a 503. A separate live-service check is needed to establish that the deployed dependency can answer.

Why does a rerun pass when nothing changed?

Transient network, dependency, timing or test-data conditions can disappear on the second attempt. Preserve both attempts and correlate them with service and CI evidence before labeling the cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.