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

A Cypress test is an automated specification that opens an application in a browser (or mounts a component in one), performs actions, and checks the resulting behavior with assertions. Cypress places those commands on an asynchronous command queue, runs them in order, and automatically retries linked queries and assertions while the application is still rendering. It is not Selenium, its commands are not awaitable Promises, and its optional test retries are different from the normal command-retry mechanism.

What a Cypress test is

Most Cypress tests are written in JavaScript or TypeScript. A test describes a behavior a user or an API client should observe, so the file acts as an executable specification rather than a collection of low-level browser instructions.

describe('checkout', () => {
  it('submits a valid order', () => {
    cy.visit('/checkout')
    cy.get('[data-cy=email]').type('sam@example.com')
    cy.get('[data-cy=submit]').click()
    cy.get('[data-cy=confirmation]')
      .should('be.visible')
      .and('contain', 'Order received')
  })
})

The example visits a page, finds an input, types into it, clicks a button, and verifies the confirmation. Cypress can run this as an end-to-end test against a local or deployed application. It can also mount an individual UI component in a real browser for component testing, call an API directly with cy.request(), and control network traffic with interception and stubbing.

How Cypress executes commands

Cypress coordinates a browser-side runner with a Node server process and executes close to the application in the same run loop. Commands are placed into a central asynchronous queue and are executed serially; writing a command does not execute it immediately.

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.

The queue is not a Promise chain

Cypress states that “Cypress commands are not Promises and cannot be awaited.” Do not write const value = await cy.get(...). Instead, place dependent work in a .then() callback or make the next Cypress command consume the yielded subject.

cy.get('[data-cy=total]').invoke('text').then((text) => {
  expect(text).to.match(/$[0-9]/)
})

// Keep the value in the Cypress chain when possible:
cy.get('[data-cy=total]').should('contain', '$')

A Cypress command may yield a subject to the next command, but that subject is not returned synchronously to the surrounding JavaScript function. Mixing ordinary Promises and Cypress commands without understanding this scheduling is a common source of confusing results.

A typical end-to-end sequence

  1. cy.visit() loads the application URL.
  2. cy.get() or cy.contains() queries the DOM.
  3. An action such as .type() or .click() changes application state.
  4. .should() or another assertion checks the resulting UI.

Cypress performs actionability checks before an action: the element must be in a usable state according to Cypress’s rules. Once the action executes, Cypress does not repeat a state-changing click merely because a later assertion fails; repeating it could submit a form or trigger another side effect.

Does Cypress wait automatically?

Yes, but the precise behavior matters. Cypress automatically retries linked queries and assertions. In this chain, Cypress repeatedly re-queries the button and evaluates the assertion until it passes or the timeout expires:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cy.get('[data-cy=save]')
  .should('be.visible')
  .and('not.be.disabled')

The retry starts from the beginning of the linked query/assertion chain, allowing a framework-rendered element or updated text to appear without a hard-coded sleep. The documented default command timeout is 4 seconds. You can override one command:

cy.get('[data-cy=report]', { timeout: 10000 })
  .should('contain', 'Complete')

You can configure a global timeout, but Cypress’s retry guidance favors changing the individual command when only one operation is slow. A fixed cy.wait(5000) can make a suite slower and still fail if the application needs longer; prefer an assertion on the state that proves the work finished.

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.

What is not retried

Actions such as click() and type() are checked for actionability and then run once. If an action starts a request, wait for a meaningful UI result or intercept the request and assert on it rather than expecting Cypress to click again.

Command retry-ability versus test retries

These are separate features.

Mechanism Purpose What runs again
Command retry-ability Handles expected asynchronous rendering and state changes Linked queries and assertions, until they pass or the command timeout is reached
Whole-test retries Provides another attempt after a test fails The test attempt, including its hooks

With retries: 2, Cypress permits one initial attempt plus two additional attempts (up to three total). beforeEach and afterEach run again for each attempt. Test retries can expose intermittent failures, but they do not repair a test that depends on a previous test’s state or uses an incorrect assertion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// cypress.config.js
const { defineConfig } = require('cypress')

module.exports = defineConfig({
  retries: 2,
  e2e: {
    baseUrl: 'http://localhost:3000'
  }
})

End-to-end, component and API tests

End-to-end tests

Use an end-to-end test for a user-visible workflow: sign in, create a record, submit a form, or navigate between pages. It exercises the running application and its integration points.

Component tests

A component test mounts a component directly in a real browser. It is useful for checking rendered behavior, styles, and interactive states without navigating through the whole application.

import Button from './Button.jsx'

describe('<Button />', () => {
  it('emits a click', () => {
    const onClick = cy.stub().as('onClick')
    cy.mount(<Button onClick={onClick}>Save</Button>)
    cy.contains('Save').click()
    cy.get('@onClick').should('have.been.calledOnce')
  })
})

API tests with cy.request()

cy.request() calls a REST or GraphQL endpoint directly and lets you assert status, headers, body, and timing. It is also useful for seeding data before a UI flow.

it('creates an invoice through the API', () => {
  cy.request('POST', '/api/invoices', { amount: 2500 })
    .then((response) => {
      expect(response.status).to.eq(201)
      expect(response.body).to.have.property('id')
    })
})

Network interception

Cypress supports request interception and stubbing. Documentation describes native network interception for Chrome, Chromium, and Edge beginning with Cypress 16; because this is version-specific, verify the behavior against the release documentation for the Cypress version installed in your project.

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.

Isolation, browsers and repeatability

End-to-end test isolation is enabled by default. Before each test Cypress resets aliases, clock mocks, intercepts, spies, stubs, and viewport changes, and starts from a clean browser context. A test should therefore create its own data and setup rather than relying on a preceding test.

Cypress launches its own browser instance and isolated profile; it does not attach to your personal browser session. Current documentation lists Chrome-family browsers, Firefox, and experimental WebKit. The selected browser must be installed locally or in CI.

Why independent tests matter

  • A test can run alone and still establish all required state.
  • Failures identify the behavior under test instead of an earlier test’s leftovers.
  • Parallel CI runs are less likely to collide through shared browser state.

Authoring and debugging with cypress open

Run cypress open to launch the interactive runner. It opens tests in a real browser, watches relevant files, reruns the active spec after edits, and shows each command in a time-travel-style UI. Selecting a command lets you inspect the application and the state Cypress observed at that point.

npx cypress open

For an automated run, use the headless runner and choose a browser installed in the environment:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx cypress run --browser chrome

Keep selectors stable with attributes intended for testing, such as data-cy, instead of coupling tests to presentation classes. Assert user-observable outcomes, not implementation details that can change during a refactor.

Common failures and precise fixes

“Timed out retrying”

Cause: The linked query or assertion never reached its expected state within the timeout. Fix: Confirm the selector, verify that the test loaded the intended URL, wait on a state-changing request or visible result, and increase the timeout only for the genuinely slow command.

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

“Cannot await a Cypress command”

Cause: A command was treated as a native Promise. Fix: Remove await and continue the Cypress chain or use .then() for dependent JavaScript.

A click appears to do nothing

Cause: The element is covered, disabled, detached, or otherwise fails actionability checks. Fix: Assert visibility and enabled state, wait for the covering UI to disappear, and target the element that a user would actually click. Do not add repeated clicks to mask a state problem.

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

Tests pass only in a sequence

Cause: Hidden dependence on state left by an earlier test. Fix: Run the spec or test alone, move setup into the test or its hooks, and use API setup where it is faster and clearer.

Browser or CI launch errors

Cause: The requested browser is not installed or the CI environment cannot launch it. Fix: Install the selected Chrome-family browser, Firefox, or supported experimental WebKit build in the environment, then run Cypress with that browser name.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and CI

Reliable Cypress suites minimize unnecessary page visits, use API calls to seed predictable data, and replace arbitrary sleeps with assertions. Keep tests independent so they can be selected, rerun, or distributed by CI without ordering assumptions.

Cypress Cloud is the adjacent service for recording CI results, replaying tests, parallelizing runs, prioritizing specs, and auto-canceling runs. Those capabilities are separate from Cypress’s local command queue and browser execution.

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.
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.

Or skip the browser setup

If your goal is to capture a Cypress application or test artifact as an image or PDF rather than drive the browser yourself, ScreenshotNeo provides a website screenshot API and MCP server. A single request returns PNG, JPEG, WebP, or PDF. It accepts cookie and consent banners before capture, removes more than 60 known consent platforms plus newsletter popups and chat widgets, and lets you turn each cleanup step off.

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 the complete option set, including device and viewport settings, full-page lazy-image loading, CSS-selector element capture, dark mode, retina scale, PDF paper and margin controls, custom CSS or JavaScript, clicks, waits, request blocking, headers, cookies, user agents, timezone, geolocation, transparent backgrounds, resizing, TTL-based caching, signed links, asynchronous webhooks, bulk capture, usage data, and the OpenAPI specification. Its parameter names also accept the names used by other screenshot APIs, which can simplify migration.

Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

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.

FAQ

Does Cypress use Selenium?

No. Cypress uses its own browser-side runner coordinated with Node rather than Selenium/WebDriver’s remote-command model.

Can Cypress test APIs?

Yes. Use cy.request() to call REST or GraphQL endpoints and assert the response, or seed state before a UI test.

What is the default Cypress command timeout?

The documented default is 4 seconds; override a slow command locally when possible.

Can a Cypress test run in my everyday browser profile?

No. Cypress launches its own browser instance and isolated profile.

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.