To get started with Cypress, install it as a development dependency in your project, open its Launchpad, choose end-to-end (E2E) or component testing, and create a test that sets up state, takes an action, and checks the result. The examples below use E2E testing in Chrome; confirm the current system requirements and browser support in the Cypress installation guide before setting up a project or CI pipeline, because supported versions change.
Install Cypress in your project
Run the install command from your application’s project root. Cypress should generally be a development dependency, not a global install, so teammates and CI can use the project’s declared version.
npm install --save-dev cypress
For another package manager, use its equivalent:
- Yarn:
yarn add --dev cypress - pnpm:
pnpm add --save-dev cypress - Bun:
bun add --dev cypress
The official installation guide lists the current operating-system, Node.js, and package-manager requirements. Its requirements are version-sensitive; check that page rather than relying on an old compatibility list. If your package manager blocks lifecycle scripts, follow its current instructions for allowing Cypress’s install script or installing the Cypress binary explicitly.
Open the Cypress app from the same project using the package manager you chose:
Recommended Free Tools
#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.
npx cypress open
For Yarn, pnpm, or Bun, invoke the local executable with that manager’s standard command. The first launch opens the Launchpad, which guides you through test setup and creates the initial configuration and support files.
Choose E2E or component testing
The Launchpad asks which kind of testing you want to configure. Choose based on what you need to prove, not simply on which option is easiest to open.
| Type | What it tests | Good first example |
|---|---|---|
| End-to-end (E2E) | The running application in a browser, across a complete user journey. | Visit a page, submit a form, and verify the resulting message or page. |
| Component | An individual UI component mounted in isolation, including behavior across props and states. | Mount a button or form component and verify its response to an interaction. |
For browser journeys, select E2E testing. Cypress scaffolds the relevant configuration and folder structure, so you can begin without manually building the test harness. Component testing is a separate choice; it does not require you to run the whole application for every component test. See the Cypress getting-started guide for the current setup flow.
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.
Pick a browser for local runs and CI
Choose a browser that reflects your users and that you can run consistently. Cypress documents Chrome-family browsers and Firefox, and describes WebKit support as experimental. Its current browser reference says it supports the latest three major versions of Chrome, Firefox, and Edge; check the live browser documentation for constraints that apply to your Cypress release.
Select the browser in the Launchpad, or name it explicitly when running tests. For example, after configuring E2E testing, a Chrome run can be launched with:
npx cypress run --browser chrome
In CI, the selected browser must be installed and available in the runner, unless you use an official Cypress image that supplies the needed environment. For a pinned, reproducible Chrome binary, Cypress recommends Chrome for Testing. Avoid relying on Electron as an implicit default: current Cypress documentation marks Electron as deprecated. WebKit is experimental, so verify current compatibility before making it a long-lived CI requirement.
Rank #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.
When deciding how many browsers to include, weigh three things: the browsers your users actually use, the additional confidence each browser run provides, and the CI time and infrastructure it consumes. Pinning browser versions can improve repeatability, but the version still needs a deliberate update process.
Write a first useful E2E test
A useful browser test follows a simple pattern: establish the starting state, perform the behavior, and assert the outcome. In a Cypress E2E spec, those steps commonly become visiting a URL, finding an element, interacting with it, and checking what the user sees. This example assumes the app is available at the indicated local address and has a sign-in form with stable accessible labels and a visible success message; change the URL and selectors to match your application.
describe('sign-in', () => {
it('shows a success message after valid credentials are submitted', () => {
cy.visit('http://localhost:3000/sign-in')
cy.findByLabelText('Email').type('[email protected]')
cy.findByLabelText('Password').type('correct-horse-battery-staple')
cy.findByRole('button', { name: 'Sign in' }).click()
cy.contains('Signed in successfully').should('be.visible')
})
})
The example uses Testing Library-style queries such as findByRole; add and configure the corresponding Cypress Testing Library support in your project before using them. If it is not installed, use selectors your app already exposes, such as a stable data-testid, with Cypress commands such as cy.get('[data-testid="sign-in"]'). Prefer selectors tied to user-visible labels or stable test attributes over brittle CSS structure.
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
Save the spec in the E2E folder created by the Launchpad. Cypress reloads the spec when you save changes. Start with an assertion about the behavior under test; an assertion that only checks a fixed constant can confirm syntax but does not establish that the browser flow works. The first-test tutorial walks through creating and running a spec.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Understand the files Cypress creates
Cypress uses conventions to keep configuration, test support, and fixtures organized. The Launchpad generates the initial files; their exact names and defaults can vary by test type and version.
- Configuration: project-level Cypress settings, including options such as the base URL and spec locations.
- Fixtures: reusable test data files, when you need them.
- Support files: code loaded to provide shared commands or setup.
- E2E and component support entry points: separate places for shared setup appropriate to each testing mode.
You do not need to customize every generated file before writing a first test. Keep the defaults until a real project need—such as a shared base URL or reusable test setup—calls for a change. Cypress documents the configurable file locations in its configuration reference.
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.
Run tests reliably in CI
- Install the project dependencies using the package manager and lockfile used by the project.
- Start the application in the CI environment and wait until it is ready at the URL your tests visit.
- Make the selected browser available in that environment, or use an official Cypress image with the browser you intend to run.
- Run Cypress explicitly, for example
npx cypress run --browser chrome, rather than depending on an implicit browser choice. - Keep browser and Cypress versions deliberate so changes in the CI image or browser do not silently alter test behavior.
For release-specific CI setup and available images, use Cypress’s continuous integration documentation. The appropriate browser matrix depends on your users and the time and infrastructure budget available; more browser runs are not automatically better if they are not maintained.
Troubleshoot common first-run problems
- The Cypress app does not start after installation: Check the current system requirements and confirm the install completed in the project root. If lifecycle scripts were blocked, approve the package script or follow Cypress’s binary-install instructions.
- The chosen browser is missing in CI: Install that browser in the runner or switch to an official Cypress image that includes it. Keep the test command’s browser selection explicit.
- A command or selector is not recognized: Confirm that dependencies required by the example are installed. In particular, the Testing Library queries in the sample need their Cypress integration; otherwise use built-in Cypress selectors.
- A test passes locally but fails in CI: Check that the application is actually ready before the test visits it, that the runner uses the intended browser, and that local and CI browser versions are controlled consistently.
- The browser behavior differs from expectations: Verify that the browser is among those supported for your Cypress version. Treat WebKit as experimental and check its current documentation before depending on it.
Or skip the browser setup
If the task is to capture a page rather than exercise its interactive behavior, ScreenshotNeo can return a screenshot or PDF from one GET request. It is a screenshot API and MCP server, not a replacement for Cypress browser tests.
For example, capture a page as WebP with 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 documentation for API options and formats. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up free for ScreenshotNeo.
Frequently Asked Questions
Can Cypress test a page that is not running locally?
Yes. E2E tests can visit an application at a URL accessible to the browser, provided the environment can reach it and any required authentication or test data is available.
Can I start with component testing and add E2E later?
Yes. Cypress sets up E2E and component testing as distinct modes with separate support entry points; choose the mode that matches each test’s scope.
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.




