Cypress end-to-end (E2E) tests use a real browser to exercise an application through complete user workflows, from its interface through the back end and integrations. A useful starting point is one critical journey: prepare its state, perform a user-like action, and assert the outcome that matters. This guide covers installation, test structure, isolation, test-type choices, and reliable CI runs.
What Cypress E2E tests verify
Cypress describes E2E testing as exercising an application from the browser through the back end, potentially including third-party services. A test can visit a page, interact with controls as a user would, and check what the application does across its layers. This makes E2E tests useful for critical workflows, persisted data, and smoke checks before deployment. The trade-off is that these tests need a working application environment and can take more setup and maintenance than narrower tests. Cypress explains its testing types.
A browser test is most valuable when the question is whether the whole journey works—not simply whether a function or component behaves in isolation. Keep the test environment stable and known; Cypress recommends starting the application server for local development rather than trying to start it from inside test scripts. Cypress’s effective-testing guidance discusses this approach.
Install Cypress and open the test runner
Add Cypress as a development dependency from your project’s root directory. Use the package manager already used by the project:
#1 Best Overall
- 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.
npm install cypress --save-devyarn add cypress --devpnpm add cypress --save-devbun add cypress --dev
Then launch the Cypress app from the same project root:
npx cypress open(npm)yarn cypress openpnpm exec cypress openbunx cypress open
On first launch, choose E2E Testing when prompted, then choose a browser and let Cypress generate its initial configuration and example files. The usual E2E spec directory is cypress/e2e; project configuration can change the defaults. Check the official installation guide for current platform and runtime requirements, which may change over time.
Rank #2
- 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.
Write a focused first test
Organize a test around three questions: what state must exist beforehand, what action should a user take, and what observable result proves the workflow succeeded? Cypress’s first-test workflow is to visit a page, find an element, interact with it, and assert what changed. For example, a login-form test might check that the page opens, enter credentials, submit the form, and verify that the expected destination appears. Assert outcomes rather than merely asserting that a command executed. Cypress’s first-test guide covers the basic flow.
Here is a small example to adapt to an application that has a login page, an email field, a password field, and a submit button. Replace the URL, selectors, and expected route with those used by your application:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #3
- 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.
describe('login', () => {
it('signs in and opens the dashboard', () => {
cy.visit('http://localhost:3000/login')
cy.get('[name="email"]').type('[email protected]')
cy.get('[name="password"]').type('test-password')
cy.get('button[type="submit"]').click()
cy.url().should('include', '/dashboard')
})
})
The example demonstrates the shape of a test, not a recommended production credential strategy. Use a controlled test environment and test data appropriate to your application. Keep each spec focused enough that a failure points to a meaningful workflow or outcome.
Where test code and shared setup belong
Cypress uses familiar Mocha-style describe and it blocks, with Chai assertions. E2E spec files go in cypress/e2e by default. Support files load before specs and can hold shared setup or custom commands; use them for genuinely shared behavior rather than hiding a test’s important steps. These locations and behaviors are configurable. See Cypress’s test organization guide.
Rank #4
- 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
Keep tests independent and diagnose flaky behavior
Each test should be runnable without relying on browser state left behind by another test. Cypress’s default E2E test isolation cleans the browser context before each test, which helps prevent order-dependent results. If a workflow needs a particular starting state, establish it deliberately rather than depending on the test that happened to run before it. Cypress documents test isolation.
Tests do not retry by default. Cypress retries can be enabled in configuration or for an individual test, but a retry is not a substitute for understanding why a result is intermittent. Cypress identifies possible sources of unpredictable behavior such as animations, API calls, server or database availability, resource dependencies, and network issues. Investigate the underlying condition—such as unstable test data or a service that is not ready—before relying on repeat attempts to get a passing run. See Cypress’s test retries guide.
Best Value
- 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.
Choose E2E or component testing by the question
These test types serve different purposes. E2E tests check that the application layers work together in a complete browser workflow; component tests mount an individual component in isolation. Component tests generally need less scenario setup and can give focused feedback, but passing them alone does not establish that the full application works together. Cypress recommends combining types according to what each test needs to verify.
| Test type | Best suited to | Main trade-off |
|---|---|---|
| E2E | Critical journeys across the browser, application layers, and integrations | Requires a functioning application environment and more infrastructure and maintenance |
| Component | Focused behavior and scenarios for a component mounted in isolation | Does not prove that the whole application works together |
Use the narrowest test type that answers the question, then retain E2E coverage for the journeys whose success depends on integration across the system. Cypress’s testing-types guide provides its guidance on choosing between them.
Run Cypress reliably in CI
A CI job needs the application running before Cypress starts, and the job should wait for actual readiness. Starting the server in the background and immediately launching tests creates a race: Cypress may visit the app before it is listening or ready. Cypress recommends a readiness check instead of an arbitrary fixed sleep. Its CI documentation covers GitHub Actions, CircleCI, GitLab CI, Jenkins, and AWS CodeBuild; provider configuration can evolve, so follow the current instructions for your chosen system. Cypress’s CI overview is the starting point.
GitHub Actions readiness pattern
Cypress’s official GitHub Action provides start and wait-on options. The pattern is to run the app’s start command, wait until its local URL responds, and then run the E2E suite. Adapt the command and URL to the project’s scripts and port, and consult the official Cypress GitHub Action documentation for current usage and configuration details.
Recommended Free Tools
- Check out the project and install its dependencies.
- Configure the action to start the application using the project’s normal development or test command.
- Set the readiness target to the application’s local URL so the action waits for it before running Cypress.
- Run the E2E tests and inspect the failing spec and application logs if the job does not pass.
Troubleshoot common failures
- Cypress cannot reach the app: confirm the server started, uses the expected port, and is bound to an address reachable by the test runner. In CI, wait for a readiness URL rather than launching Cypress immediately.
- A test passes alone but fails in the suite: look for reliance on state created by another test. Make the test establish its own starting state and use browser isolation as intended.
- A test fails intermittently: inspect timing-sensitive animation, API or network behavior, service readiness, and test data. Retries are opt-in; enabling them can expose intermittent failure, but should not conceal its cause.
- An assertion checks the wrong result: confirm the test is checking a user-visible application outcome that follows from the action, such as the resulting URL or field value, rather than only checking that a Cypress command ran.
- The first-run steps or CI configuration differ from the project: Cypress defaults can be configured, and platform requirements and CI action details change. Check the current official install and provider documentation for the chosen environment.
Or skip the browser setup
If the task is to capture a webpage rather than verify an application’s workflow, ScreenshotNeo offers a one-request screenshot API and an MCP server. A screenshot is not a replacement for an E2E test: it captures rendered output rather than asserting that a user journey and its integrations work. For a quick page capture, use this cURL request; replace YOUR_API_KEY with your key and change the target URL as needed. See the ScreenshotNeo documentation.
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo.
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.




