October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Measure Element Coverage in Cypress: UI Coverage vs Code Coverage

Cypress UI Coverage measures exercised interactive elements through Test Replay in Cypress Cloud. Use Istanbul separately for source statements, branches, and functions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To measure which buttons, links, forms, and other interactive elements Cypress tests exercise, use Cypress UI Coverage. It reports on UI interactions using Test Replay data in Cypress Cloud; the documented setup does not require source instrumentation or a plugin. If by “coverage” you mean which application statements, branches, and functions ran, use the separate Istanbul-based code coverage workflow instead.

The key distinction is what gets counted: UI Coverage tracks interactive elements, while code coverage tracks executed source code. They answer different questions and their percentages are not interchangeable.

What does Cypress element coverage measure?

Cypress UI Coverage focuses on interactive UI elements that tests touch, such as buttons, links, and forms. Its reports are based on Test Replay data in Cypress Cloud. It is intended to show gaps in exercised UI, not the proportion of source code that ran. See Cypress’s UI Coverage introduction.

Traditional code coverage instead reports execution of source statements or lines, branches, and functions. It requires the application to be instrumented before it runs in the browser, and a collector to gather and report the resulting data. Cypress’s code coverage guide explains that workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Approach What it counts Setup and result location Best fit
Cypress UI Coverage Interactive UI elements exercised by tests Test Replay data; reports in Cypress Cloud. Documented setup needs no source instrumentation or plugin. Finding controls or UI interactions tests did not exercise
Istanbul code coverage Executed source statements or lines, branches, and functions Instrument application source, collect browser data, then generate reports such as static HTML locally. Finding unexecuted application code paths

Measure interactive element coverage with Cypress UI Coverage

  1. Use Cypress Cloud UI Coverage when your question is which UI elements tests interacted with. Follow the official setup guide to get started with Test Replay data.

  2. Review the resulting UI Coverage reports in Cypress Cloud to identify unexercised parts of the interface.

  3. Refine the report configuration if needed. Cypress documents controls for filtering third-party or irrelevant UI, organizing views, and defining which interactions count in its UI Coverage configuration guide.

  4. Use gaps to decide where additional tests are valuable. Prioritize important user flows and interactions rather than treating a coverage percentage as proof that assertions would catch defects.

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

This is a separate workflow from Istanbul code coverage. A UI Coverage result does not tell you what share of JavaScript statements or branches executed.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Measure source-code coverage with Istanbul

Use this route if you need line or statement, branch, and function coverage. Cypress does not instrument the application itself; installing the collector alone is insufficient. Instrument the app before the browser executes it, then configure @cypress/code-coverage to collect and report the data. The Cypress guide covers the workflow and framework-specific examples.

1. Instrument the application

Choose instrumentation that matches the app’s build pipeline. Cypress’s guide demonstrates babel-plugin-istanbul in a Babel transpilation setup and vite-plugin-istanbul with Vite. Limit instrumentation to the intended application files; Vite’s plugin supports include and exclude rules and file extensions, and its example shows conditional activation for CI. Preserve source maps where your build supports them.

The application served to Cypress must contain the instrumentation. The collector does not add it after the app has loaded.

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

2. Install and register the collector

Add @cypress/code-coverage as a development dependency. In the E2E support file, import @cypress/code-coverage/support. In the Cypress configuration’s setupNodeEvents, register the plugin task and return the configuration object as shown in the Cypress guide. The package collects and reports coverage; it is not the instrumenter.

3. Run tests and inspect the report

Run tests against the instrumented app. The browser coverage object is exposed as window.__coverage__. The plugin merges collected data and uses nyc to generate reports, including static HTML. The maintained cypress-io/code-coverage repository describes output locations including .nyc_output and coverage/lcov-report.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

4. Configure component testing separately

For component tests, put the support import in the component support file as well as registering the task in the relevant Cypress configuration. With Vite, configure the Vite Istanbul plugin for the component dev server; with Webpack, configure Babel/Istanbul in that dev server. An E2E support import alone does not collect component coverage.

5. Collect backend coverage separately when needed

Backend code must also be instrumented. Cypress’s guide describes exposing the backend coverage object through middleware or an endpoint and configuring env.codeCoverage.url so the plugin can merge backend and frontend data. Restrict access to that coverage endpoint appropriately to the local or test environment.

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

Choose the right coverage controls

For source coverage: include and exclude the right files

Set instrumentation scope to the application code you intend to measure. Exclude dependencies and generated output unless they are deliberately in scope. Cypress notes that the described nyc and Babel instrumentation paths do not instrument node_modules.

For UI Coverage: refine what counts as relevant

Use UI Coverage configuration when third-party UI or other irrelevant elements should not shape the report, or when you need different views and meaningful-interaction rules. These controls refine UI reports; they do not instrument source code.

For mixed test runners: avoid duplicate instrumentation

If Jest or another runner also instruments the app, keep Cypress instrumentation appropriately separated. Cypress’s guide demonstrates a separate Babel environment to avoid duplicating Istanbul plugin configuration.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot missing or misleading coverage

  • No browser code coverage appears: confirm that the app served to Cypress is instrumented. In the application-under-test frame, check for window.__coverage__. Installing the collector by itself will not create this object.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The task runs but reports remain empty: verify that @cypress/code-coverage/support is imported by the applicable support file and that the task is registered in setupNodeEvents.

  • E2E coverage works but component coverage is missing: check the component support file and component dev-server instrumentation; E2E setup does not automatically cover component runs.

  • Coverage includes unexpected files or omits app files: review include and exclude globs against the application source and build output. The documented nyc and Babel paths do not instrument node_modules.

  • Backend execution is absent from the merged report: ensure the backend is instrumented, its test-only coverage object is exposed, and env.codeCoverage.url points to that endpoint.

    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.
    Best Value
    Sale
    Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
    • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
    • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
    • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
  • Coverage configuration conflicts with another runner: separate Cypress’s instrumentation configuration from Jest’s or the other runner’s setup to avoid duplicate Istanbul configuration.

  • A high percentage does not reveal whether tests catch defects: coverage records execution, not assertion quality. Inspect uncovered critical flows and branches, then add tests with checks that would fail if the behavior were wrong.

Or skip the browser setup

ScreenshotNeo is a separate website screenshot API, not a Cypress coverage tool. It can capture a page for visual inspection without setting up a browser automation capture flow. A single request returns an image or PDF; see the ScreenshotNeo API documentation.

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

ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the outcome indicated in response headers. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for 1,000 free screenshots a month, with no card required.

Interpret the result without chasing a universal score

Neither UI element coverage nor source-code coverage alone establishes test quality. Treat uncovered elements and code paths as investigation leads: decide whether they matter to users or system behavior, then add tests where the risk warrants it. The reviewed Cypress documentation does not establish a universal target percentage.

Frequently Asked Questions

Does Cypress UI Coverage require Istanbul instrumentation?

No. Its documented setup uses Test Replay data in Cypress Cloud and does not require source instrumentation.

Can Istanbul code coverage tell me which buttons users tested?

No. Istanbul reports executed source code; Cypress UI Coverage is the measure for interactive UI elements.

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.

Does installing @cypress/code-coverage instrument my app?

No. Instrument the application before it runs in the browser; the package collects and reports the resulting data.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
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.