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

To add Cypress to an existing Angular project in an Nx workspace, first choose what you want to test: use Nx’s Cypress configuration generator for end-to-end (E2E) tests of the running app, or Nx’s Angular component-configuration generator for tests of Angular components. Install the Nx Cypress plugin with nx add @nx/cypress, then configure and run the appropriate target. These are separate setups: E2E tests need an app server or URL, while component tests use Cypress’s component dev server and need an eligible Angular build target.

Choose E2E or Angular component testing

Pick the mode based on the behavior you need to verify. E2E tests drive the application through a browser against a served or deployed app. Component tests mount Angular components using Cypress’s component-testing support; they can cover rendering and component behavior without exercising an entire user journey through the running application.

Question E2E Angular component testing
What is tested? The running application and user-visible flows An Angular component or library component
Setup generator @nx/cypress:configuration @nx/angular:cypress-component-configuration
Server/build relationship Needs a development server target or a configured URL Needs an eligible Angular build target; Cypress runs its component dev server
Typical Nx task e2e component-test

You can configure both modes in one workspace if you need both kinds of coverage. Nx documents them as distinct targets with different server behavior; configuring one does not configure the other.

Install the Nx Cypress plugin

  1. From the workspace root, run nx add @nx/cypress. Nx’s add command aligns the plugin with the workspace’s Nx version.

    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.
  2. Check the workspace’s existing Nx and Cypress package constraints before changing dependencies. Nx’s rolling Cypress introduction, retrieved October 3, 2026, lists supported Cypress versions as >= 13 < 16 and says generators install the latest supported versions when scaffolding projects. Confirm the currently applicable range against your installed Nx version and package manager lockfile before upgrading.

Configure E2E tests for an existing Angular app

Use the Cypress configuration generator for the existing app. Replace your-app-name with the project name in the Nx workspace:

nx g @nx/cypress:configuration --project=your-app-name

The generator configures that project; it does not create a separate E2E project. If your test setup should use a URL rather than having the Cypress target start the app, pass a base URL:

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

nx g @nx/cypress:configuration --project=your-app-name --baseUrl=http://localhost:4200

Use the port and URL that actually serve the app version under test. Cypress needs a base URL when neither a base URL nor a dev server target is configured. For an ordinary local run, the generated E2E target commonly starts the app through its devServerTarget; for CI, a static-serving target may be appropriate for the project’s build and deployment arrangement.

Run the E2E target

After configuration, run the generated target, commonly:

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.

nx e2e your-app-name

The executor configuration uses @nx/cypress:cypress, a Cypress config file, testingType: "e2e", and the app’s server target when Nx should launch it. Inspect the generated project configuration rather than assuming every workspace has identical target names or server settings.

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.

Configure Angular component testing

For component tests, run the Angular generator against the Angular app or library project that contains the component:

nx g @nx/angular:cypress-component-configuration --project=my-angular-project

The generator adds Cypress component-test files and an Nx-ready Cypress configuration. It can also create starter tests for existing components with --generate-tests:

nx g @nx/angular:cypress-component-configuration --project=my-angular-project --generate-tests

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

Generated component test files use the .cy.ts suffix and are expected beside the component, according to Nx’s Angular generator reference.

Check the build target

Nx may infer a build target from project-graph usage. If it cannot determine the right one, supply it explicitly:

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.

nx g @nx/angular:cypress-component-configuration --project=my-angular-project --build-target=my-angular-app:build

The target provides project/build context, including relevant assets, scripts, and styles. Nx’s Angular generator reference says the build target should use @nx/angular:webpack-browser or @angular-devkit/build-angular:browser. For a library component, the suitable target may belong to an application that consumes the library. Confirm the target in your workspace rather than copying the example literally.

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

Keep component serving separate

The component target should set skipServe: true. Cypress provides the component dev server, so Nx should not try to run the app’s build target as an application server. Nx still uses the build target to prepare the component configuration. The Angular component configuration generator sets this option automatically.

Run component tests

Run the component-test target through Nx, commonly:

nx component-test my-angular-project

As with E2E, verify the actual target name and options generated for your workspace.

See which Cypress targets Nx recognizes

The @nx/cypress/plugin can infer tasks from Cypress configuration files named cypress.config.js, cypress.config.ts, cypress.config.mjs, or cypress.config.cjs when the directory also contains a package.json or project.json. Documented default names include e2e, component-test, and open-cypress; the CI target is named e2e-ci. These are defaults, not guarantees: plugin options in nx.json can change target names.

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

Inspect the project Nx sees with:

nx show project your-app-name --web

Use that output or Nx Console to check inferred targets and configuration before troubleshooting a missing task.

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

Use caching and CI features with version awareness

Nx documents caching for E2E and component-test tasks, including tracking Cypress screenshot and video outputs. Its plugin can also infer CI tasks that split tests by file when configured. Component-test CI splitting is documented as available since Nx 21.6.1, so check the installed Nx version before relying on it.

For E2E splitting, Nx’s current guidance uses ciWebServerCommand in the Cypress preset configuration. If customizing the preset, preserve its setupNodeEvents behavior. This is an optional CI optimization, not a prerequisite for running a basic E2E or component-test target.

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

Troubleshoot common setup failures

Capture a reference screenshot without setting up browser automation

A screenshot API is separate from Cypress: it can capture a page for visual reference, but it does not run Cypress assertions or replace either test mode. ScreenshotNeo is a website screenshot API and MCP server if you need a one-request capture or want an AI agent to request one.

For example, using cURL to capture a development page:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=http://localhost:4200 -o shot.webp

See the ScreenshotNeo API documentation for request options and response handling. The local app must be reachable from the API service for this URL to work; for a local-only development server, use a URL the service can access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Cookie and consent banners are accepted and removed before capture, along with supported newsletter popups and chat widgets.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed.
  • An MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents.
  • The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to try the API.

Frequently Asked Questions

Can an Nx workspace use both Cypress E2E and component tests?

Yes. Configure the E2E and Angular component-test targets separately for the projects and behaviors you want to cover.

Does Nx create a separate E2E project when I configure an existing app?

No. The E2E configuration generator configures the project named by its --project option.

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.

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