Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Set Up End-to-End Testing with Cypress

A practical Cypress E2E setup guide: install the package, configure your app URL, create a first spec, select a browser, and avoid CI readiness races.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To set up Cypress end-to-end (E2E) testing, install Cypress as a development dependency, open its Launchpad from your project root, choose E2E Testing, start your application, set e2e.baseUrl, and write a spec that checks a real user-visible outcome. For CI, make the test job wait until the application server is ready before running Cypress.

Install Cypress in your existing project

Use a supported Node.js installation and a package manager for your project. From the project root, add Cypress as a development dependency:

As an Amazon Associate I earn from qualifying purchases.

  • npm install cypress --save-dev
  • yarn add cypress --dev
  • pnpm add --save-dev cypress
  • bun add --dev cypress

Use the command that matches your package manager; avoid installing Cypress globally, so the project records the dependency and its version. Check the current Cypress installation requirements if your Node.js version, operating system, or Linux dependencies are uncertain.

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

Initialize E2E testing with the Launchpad

  1. From the project root, run npx cypress open. Use the equivalent command for your package manager if needed.
  2. On first launch, choose E2E Testing.
  3. Follow the Launchpad to create the initial configuration and folder structure, then choose an installed browser.

The Launchpad is the quickest way to generate Cypress’s starting files. Review the generated configuration and spec rather than treating the scaffolding as a finished test suite. See the official Launchpad walkthrough.

Start the application and configure its base URL

Cypress drives a running application; it does not replace the application’s development server. Start the app in a separate terminal using the command your project provides, then note the exact local address and port. For example, the server might be available at http://localhost:8080.

In the generated cypress.config.js or cypress.config.ts, set baseUrl inside the E2E configuration. A minimal JavaScript configuration is:

const { defineConfig } = require('cypress');

module.exports = defineConfig({
  e2e: {
    baseUrl: 'http://localhost:8080',
  },
});

Replace the example address with the URL where your application actually runs. With baseUrl configured, calls such as cy.visit('/') and cy.request('/api/health') use that origin. Full configuration options are documented in the Cypress configuration reference.

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.

Write and run a first E2E spec

Create a spec under the generated E2E folder, commonly cypress/e2e/. This example assumes the application has a visible page heading with the text “Welcome” at its home route; replace the selector and expected text with something your app renders.

describe('home page', () => {
  it('shows the welcome heading', () => {
    cy.visit('/');
    cy.get('h1').should('contain.text', 'Welcome');
  });
});

Prefer assertions about outcomes a user can observe—such as a page heading, successful sign-in state, or confirmation after submitting a form—over checks that only duplicate implementation details. Run npx cypress open to select the spec and debug interactively, or run npx cypress run for headless command-line execution. The first E2E test guide covers the workflow.

Choose a browser deliberately

Cypress documents support for the latest three major versions of Chrome, Edge, and Firefox, subject to version-specific notes; WebKit support is experimental. Electron is deprecated as a test browser and slated for removal, so avoid relying on it as the durable default for a new setup. Check the current browser launch guide for release-specific details.

  • For local development, Cypress can detect installed browsers; choose one in the Launchpad or specify one with the CLI’s --browser option.
  • For repeatable CI runs, Cypress recommends Chrome for Testing where practical because it is versioned and does not silently auto-update.
  • The selected browser must be installed in the CI environment or supplied by an appropriate Cypress Docker image.
  • You do not need to run every supported browser on every commit. Prioritize browsers your users rely on, then balance coverage against runtime and infrastructure cost.

Run Cypress reliably in CI

Once local tests pass, add Cypress to your CI workflow. The essential order is dependency installation, application startup, a readiness check, then the test command. Starting a server in the background and immediately invoking Cypress can race: the test runner may visit the app before it is listening.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install project dependencies in the workflow.
  2. Start the application with the project’s normal CI command.
  3. Wait for a successful response from the app using a readiness tool, or use the Cypress GitHub Action’s start and wait-on options.
  4. Run Cypress with the intended browser installed or provided by the CI image.

Use an actual readiness check rather than an arbitrary fixed sleep; server startup time can vary. Cypress documents workflows for GitHub Actions, CircleCI, GitLab, Jenkins, AWS CodeBuild, and other CI providers in its CI overview. A Cypress Docker image can simplify browser and system dependency setup where the CI machine lacks prerequisites.

CI machine resources

Cypress’s installation guidance gives a CI baseline of at least 2 CPUs and 4 GB RAM; it recommends 8 GB or more for longer runs or video recording. Actual needs depend on the app, browser, server, and suite. Linux environments may also need system dependencies; consult the current installation guide or use an appropriate Cypress Docker image rather than assuming a minimal container is ready to launch a browser.

Parallel execution and browser matrices

Parallelization can reduce elapsed time, but it may raise infrastructure costs. Select a browser matrix based on the browsers your users actually use and the confidence required for each change. Wider browser coverage is useful, but it is not automatically worth running every browser for every small commit.

Decide whether Cypress Cloud is useful

Cypress App is the downloadable, open-source application used for local testing. Cypress Cloud is a separate optional hosted service for recording CI runs and related collaboration, debugging, analytics, and orchestration features. You can run E2E tests without Cloud.

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.

To connect a project to Cloud, associate its project ID with the configuration and pass a record key to the run, commonly through a protected environment variable. Do not commit the record key to source control. Cloud plans and allowances can change; check the current pricing page and Cloud setup documentation before choosing a plan.

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

Troubleshoot common setup failures

  • cy.visit() cannot reach the app: confirm the server is running, the configured baseUrl matches its actual protocol, hostname, and port, and the route is reachable in a normal browser.
  • CI fails intermittently at the first visit: make the workflow wait for a successful server response before starting Cypress. A fixed delay can be too short on a slow run and waste time on a fast one.
  • No browser appears or Cypress cannot launch it: install a supported browser locally or in CI, select it explicitly with --browser if needed, and check the browser support notes for your Cypress version. In CI, consider a suitable Cypress Docker image.
  • Linux reports missing libraries or launch dependencies: install the operating-system prerequisites listed by Cypress or use an image that includes the browser dependencies.
  • The test fails because its expected content is missing: verify the test is checking the correct route and user-visible state, and that the app has finished rendering before asserting. Use Cypress’s retryable queries and assertions rather than adding arbitrary pauses.
  • A Cloud-recorded run is unauthorized: verify the project ID and record key are configured for the intended project and CI environment, and that the key is supplied securely rather than exposed in source.

Or skip the browser setup

Cypress is for exercising application behavior in a browser. If your immediate need is to capture a website screenshot or PDF, ScreenshotNeo offers a one-request screenshot API instead. For example, this cURL request saves a WebP capture of Stripe:

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 and response details. It removes cookie or consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server gives AI agents tools to take screenshots, inspect page information, and capture PDFs. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Does installing Cypress configure my app URL?

No. Installation adds Cypress to the project; set the E2E `baseUrl` to the running application’s address in the Cypress configuration.

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

Can I run Cypress tests without Cypress Cloud?

Yes. Cypress Cloud is optional; the Cypress App supports local testing without it.

Should I use Electron for new Cypress tests?

Avoid depending on Electron for a durable new setup: Cypress documents it as deprecated and slated for removal.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.