Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk7 min

How to Run Cypress Tests on Netlify

Run Cypress during Netlify builds with a context-aware Build Plugin, or use separate CI. Learn Deploy Preview configuration, server readiness, local verification, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run Cypress as part of a Netlify build, install the netlify-plugin-cypress package as a development dependency and configure it in your repository’s netlify.toml. Use context-specific plugin settings to choose whether tests run—and whether Cypress results are recorded—for production builds, branch deploys, and Deploy Previews. Alternatively, run Cypress in a separate CI pipeline and make the Netlify deploy depend on that job.

Choose where Cypress runs

There are two practical patterns. A Netlify Build Plugin runs within the Netlify build; a separate CI job runs tests outside Netlify and can then deploy the built site with Netlify CLI. Neither is universally faster or more reliable: choose based on where you want tests to run and which deployments they should gate.

As an Amazon Associate I earn from qualifying purchases.

Decision Netlify Build Plugin Separate CI pipeline
Where tests run During a Netlify build, through a configured Build Plugin. In the CI provider’s job, separate from the Netlify build.
Which deploys trigger tests Configure plugin behavior for production, branch deploys, Deploy Previews, or selected contexts in netlify.toml. Configure the CI workflow’s branch and pull-request triggers; the reviewed documentation does not prescribe a particular provider or trigger setup.
Results recording The Netlify example enables Cypress Dashboard recording globally and disables it for Deploy Previews. Run Cypress with the recording configuration your CI setup requires; keep credentials in environment variables.
Server readiness Ensure the app is available before Cypress starts; use the plugin’s current package documentation for its inputs and setup. Start the app and wait for it to respond before running Cypress, using a readiness tool or another appropriate approach.
Local build parity Use Netlify CLI with the intended context and matching Node.js version. Use your CI job’s build and deployment steps; Netlify documents manual deploys as a common pattern with separate CI.

Netlify distinguishes Deploy Previews, branch deploys, and production builds. Deploy Previews are associated with pull or merge requests by default unless preview controls are changed; branch deploys require setup and are tied to configured branches. See Netlify’s deploy-context documentation for the current distinctions and settings.

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

Run Cypress through a Netlify Build Plugin

1. Check the app and Cypress setup

First confirm that Cypress is configured in the project and that the application can be built and served in the environment where the plugin runs. The app must be ready before tests try to visit it. Cypress warns that starting a server in the background and immediately invoking cypress run creates a race: the tests may start before the server is listening. Its Continuous Integration guide describes readiness-waiting approaches, including start-server-and-test and wait-on.

#1 Best Overall
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.

2. Install the plugin

From the project root, add the npm-published plugin as a development dependency with your package manager. For npm:

npm install --save-dev netlify-plugin-cypress

Netlify’s Build Plugins documentation says npm-published plugins need to be included in the project dependencies as well as configured in the Netlify configuration file. Check the installed plugin version’s package documentation for its supported inputs and any setup requirements before relying on a particular configuration.

3. Configure deploy contexts in netlify.toml

Add the plugin configuration to the netlify.toml in the site’s base directory. This example follows Netlify’s documented pattern: recording is enabled in the general configuration, then disabled specifically for Deploy Previews.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[[plugins]]
  package = "netlify-plugin-cypress"

  [plugins.inputs]
    record = true

[[context.deploy-preview.plugins]]
  package = "netlify-plugin-cypress"

  [context.deploy-preview.plugins.inputs]
    record = false

In this example, the more-specific Deploy Preview entry overrides the general plugin configuration. Netlify describes it as recording Cypress results and artifacts to Cypress Dashboard for production and branch deploys, but not Deploy Previews. That is an example choice—not a universal default. If you want recording enabled in previews, change the context-specific setting after checking the plugin version’s supported inputs. Netlify also notes that plugins installed through the UI run in all deploy contexts; use file-based configuration when you need context-specific behavior. See Netlify’s plugin configuration guidance.

4. Keep secrets out of committed configuration

If Dashboard recording or another integration needs a secret, provide it as an environment variable instead of committing the value in netlify.toml. Netlify cautions that configuration files are stored in the repository and recommends setting sensitive environment variables through the UI, CLI, or API. See Netlify’s environment variables documentation.

5. Trigger and inspect a deploy

Push a change to a branch or open a pull or merge request, according to the deploy contexts you have configured. Inspect the Netlify deploy log to verify that the build selected the expected context and the plugin ran. A preview or branch deploy is not interchangeable with a production deploy: confirm the deploy type before interpreting whether a test or recording step should have run.

Rank #3
ASUS 2026 15" FHD IPS Chromebook, Intel Processor Up to 2.80GHz, 4GB DDR4, 128GB Storage, HDMI, Super-Fast WiFi, Chrome OS, Pastel Silver (Renewed)
  • Intel Processor Up to 2.80GHz, 4GB DDR4, 128GB Storage
  • 15" FHD IPS Display, Intel UHD Graphics
  • 1x USB Type C, 1 x USB Type A, 1x Headphone/Microphone Combo Jack, HDMI
  • Fast WiFi and Bluetooth, Integrated Webcam
  • Chrome OS, AC Charger Included, Pastel Silver

Run Cypress in a separate CI pipeline

This pattern is useful when you want a CI provider to own test orchestration and make publishing conditional on test success. Cypress describes CI as broadly similar to running Cypress locally: install it and run it from the project. The exact workflow configuration depends on your provider.

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

Install and run Cypress

Cypress documents these npm commands for adding Cypress and running tests:

npm install cypress --save-dev
npx cypress run

Run these from the project directory in the CI job. If tests visit an application server started by the job, start the server and wait until it is reachable before invoking Cypress. Cypress documents start-server-and-test and wait-on as options; an arbitrary fixed sleep is not a reliable readiness check.

Rank #4
Lenovo Chromebook 2-in-1 - Lightweight Laptop - Google Gemini - Intel® N150 CPU - 14" WUXGA IPS Touchscreen Display - 4GB RAM - 128GB UFS Storage - Integrated Intel® Graphics - Luna Grey
  • THE BETTER WAY TO LAPTOP – Imagine a Chromebook that’s as flexible as your day: thin and lightweight with built-in Google apps and stress-free security.
  • TAKE HITS KEEP MOVING – Sleek, light, and built to last- the Chromebook 2-in-1 is just 0.69” thick and 3.3lbs. Enjoy long-lasting battery life, fast charging, and military-grade durability for nonstop productivity wherever life takes you.
  • PERFORMANCE THAT MATCHES YOUR HUSTLE – Fuel your ideas with an Intel Core processor and 128GB storage. Boot up in under 10 seconds to start the day powerfully efficient.
  • FLEX YOUR CREATIVITY ANYWHERE, ANYTIME – Create, work, or unwind your way with a versatile 2-in-1 design. Flip easily between laptop, tent, and tablet modes with a responsive touchscreen built for flexibility.
  • BRILLIANT VIEWS AND IMMERSIVE AUDIO – See, hear, and create with awesome clarity. The WUXGA display brings rich detail to your work and play, while audio tuned by Waves MaxxAudio provides immersive, balanced sound.

Make deployment depend on the test job

If a failed Cypress run must stop publishing, configure the CI workflow so its Netlify deployment step or job depends on successful tests. If deployment is allowed to proceed independently, make that choice explicit in the workflow rather than assuming the test command automatically blocks a deploy.

Netlify documents manual deploys as a common pattern when a separate CI tool builds the site. You can use Netlify CLI to deploy prebuilt output after tests pass. Consult Netlify CLI documentation for current CLI setup and deploy commands; the precise command depends on your build output and deployment arrangement.

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

Test a Netlify Deploy Preview

A Deploy Preview is a deployment context, not just another name for a branch build. If Cypress should run for pull or merge requests, configure the plugin or CI workflow to include that context. If Dashboard recording should differ from production or branch deploys, set the preview behavior separately. Netlify’s example uses record = false for previews, but you can choose differently; it is not a default requirement.

Best Value
HP Chromebook 14 Laptop, Intel Celeron N4120, 4 GB RAM, 64 GB eMMC, 14" HD Display, Chrome OS, Thin Design, 4K Graphics, Long Battery Life, Ash Gray Keyboard (14a-na0226nr, 2022, Mineral Silver)
  • FOR HOME, WORK, & SCHOOL – With an Intel processor, 14-inch display, custom-tuned stereo speakers, and long battery life, this Chromebook laptop lets you knock out any assignment or binge-watch your favorite shows..Voltage:5.0 volts
  • HD DISPLAY, PORTABLE DESIGN – See every bit of detail on this micro-edge, anti-glare, 14-inch HD (1366 x 768) display (1); easily take this thin and lightweight laptop PC from room to room, on trips, or in a backpack.
  • ALL-DAY PERFORMANCE – Reliably tackle all your assignments at once with the quad-core, Intel Celeron N4120—the perfect processor for performance, power consumption, and value (2).
  • 4K READY – Smoothly stream 4K content and play your favorite next-gen games with Intel UHD Graphics 600 (3) (4).
  • MEMORY AND STORAGE – Enjoy a boost to your system’s performance with 4 GB of RAM while saving more of your favorite memories with 64 GB of reliable flash-based eMMC storage (5).

Check the deploy log for the actual context. Netlify associates Deploy Previews with pull or merge requests by default unless preview controls are changed. Branch deploys instead require configuration and use a stable branch URL. For local reproduction, Netlify CLI can build with Deploy Preview settings using the deploy-preview context.

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

Verify the build locally

From the root of the linked repository, use Netlify CLI to reproduce the build and run configured Build Plugins. To check general build behavior:

netlify build

To apply Deploy Preview settings:

netlify build --context deploy-preview

Use the same Node.js version locally as the one configured for the Netlify build. Netlify warns that a version mismatch can produce errors, so check the project and site’s build configuration before treating a local result as equivalent. See Netlify’s local development and CLI documentation.

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

Troubleshoot common failures

Cypress cannot visit the application

  • Likely cause: Cypress starts before the app server is accepting requests.
  • Fix: Start the app and gate the Cypress command on server readiness with a tool such as wait-on or start-server-and-test. Cypress specifically warns against launching the server in the background and immediately running tests.

The plugin does not run in a deploy

  • Likely cause: The plugin is configured in a different context, is missing from project dependencies, or the deploy is not using the expected repository configuration.
  • Fix: Confirm that netlify-plugin-cypress is installed as a dependency, that the site’s base-directory netlify.toml contains the configuration, and that the deploy log shows the context you intended. Check current package-specific setup against the installed plugin version.

Dashboard results are missing from a Deploy Preview

  • Likely cause: The context-specific example sets record = false for Deploy Previews.
  • Fix: If you want preview runs recorded, review the installed plugin’s supported inputs and update the preview configuration. Keep any recording credentials in environment variables, not committed configuration.

Local and Netlify builds behave differently

  • Likely cause: The local build uses the wrong deploy context or a different Node.js version.
  • Fix: Run netlify build --context deploy-preview when reproducing preview settings and match the Node.js version configured for the Netlify build.

Or skip the browser setup

If the task is capturing a site screenshot rather than running an application test suite, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. For example, this cURL request saves a WebP screenshot:

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 setup and options. It 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, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.

Frequently Asked Questions

Does Netlify automatically record Cypress Dashboard results for Deploy Previews?

No general default is established here. The documented Netlify example explicitly sets record = false for Deploy Previews; recording behavior depends on your configuration.

Can Cypress tests run outside the Netlify build?

Yes. A separate CI pipeline can run Cypress and use Netlify CLI to deploy prebuilt output, with the test job configured to gate deployment if that is your intended workflow.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

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.