What Is UI Coverage and How Can It Improve Testing?
UI coverage shows which pages, controls, and states your tests exercise. Learn how to use it to find meaningful gaps without mistaking a score for quality.
UI coverage describes which user-facing pages, interface elements, and states your automated tests exercise. It can help reveal controls nobody clicks, forms nobody submits, and pages a test suite never visits. Use those findings to choose better tests; a coverage score is a map of test reach, not proof that the tests make useful assertions or that the product works well.
It complements code coverage. Code coverage reports which source code ran. UI coverage asks whether tests exercised the interface people use. A project can execute much of its code while still missing an important user journey.
1. What UI coverage measures
There is no single universal definition or formula for UI coverage. Depending on the tool or team, coverage might describe tested controls, views, states, requirements, or journeys. Always check what is counted, how the tool observes tests, and whether the report identifies actionable gaps.
As a concrete example, Cypress UI Coverage builds a report from recorded Test Replay runs. Cypress reports an overall score and scores for individual views, shows tested and untested elements, and links to views tests have not visited. Its documented score is the number of tested items divided by the total counted items. That is Cypress’s product metric, not a universal standard. See the Cypress UI Coverage introduction and its explanation of interactivity.
| Measure | Question it helps answer | What it cannot establish by itself |
|---|---|---|
| UI coverage | Which visible views and interactions did tests exercise, according to this tool’s rules? | Whether the test checked the right result or whether the feature works well. |
| Code coverage | Which source lines, branches, or functions ran? | Whether a user-facing flow was meaningfully exercised. |
| Accessibility checks | Did automated checks find certain common accessibility issues? | Whether the product is fully accessible; manual assessment and user testing still matter. |
2. How UI coverage improves testing
A useful report turns vague uncertainty into candidate test work: an unclicked control, an unsubmitted form, or a view with no recorded test. That is especially valuable when the gap intersects a high-impact user journey. A missing test for a purchase, account change, or important data operation is generally more urgent than one for a rarely used decorative control. This is a prioritization practice, not a claim that a particular score predicts defects.
- Find the gaps. Review unvisited views and untested interactions, then check whether they are relevant to real user workflows.
- Prioritize by consequence. Consider user impact, likelihood of use, and the cost of an incorrect outcome.
- Write a behavior test. State what the user does and what visible result should follow. A click without an assertion may increase interaction coverage while adding little confidence.
- Keep the report in context. Read it alongside code coverage, accessibility checks, exploratory testing, and user feedback where appropriate.
For browser tests, prefer locators and assertions that reflect what users see and do, rather than implementation details. Keep tests isolated so one test’s state does not make another pass or fail unpredictably. Playwright’s best-practices guidance covers user-visible behavior and isolation.
3. A practical browser-testing workflow
UI coverage is a way to inspect test reach, not a separate substitute for writing browser tests. A basic Playwright workflow can exercise a user-visible flow and assert its outcome. The following runnable example assumes an existing Playwright project and a development server available at http://localhost:3000.
import { test, expect } from '@playwright/test';
test('user can sign in and reach the dashboard', async ({ page }) => {
await page.goto('http://localhost:3000/login');
await page.getByLabel('Email').fill('developer@example.com');
await page.getByLabel('Password').fill('correct-test-password');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
});
Replace the URL, labels, test credentials, and expected heading with values from your application. Use a dedicated test account and a controlled test environment. The meaningful coverage comes from exercising a real flow and checking the visible result, not from copying this particular example.
Run it with npx playwright test. Playwright can run in headless, headed, or UI mode, and configured projects let teams select relevant browsers. See Playwright’s running and debugging guide. Choose browsers based on the product’s supported environments, not simply because one default run passed.
4. Setting up Cypress UI Coverage
Cypress’s UI Coverage workflow is specific to Cypress Cloud and Test Replay. Its setup documentation says a run must be recorded with Test Replay for a UI Coverage report; turning Test Replay off means no report. Follow the current Cypress setup instructions for the project configuration and recording requirements, since those details depend on the Cypress version and account setup.
After a recorded run, inspect overall and per-view results, then open the listed untested elements and unvisited views. Convert only relevant gaps into tests, and make each test assert an expected user-visible outcome. Do not assume another vendor’s report counts the same items or uses the same formula.
5. Interpreting scores and choosing an approach
A score is useful for tracking scope under a stable definition. It becomes misleading when the counted items change, the tests only touch controls without checking outcomes, or teams optimize the number instead of important journeys. There is no evidence-backed universal target percentage in the cited documentation, so set goals around the risk and flows that matter to your product.
When comparing coverage approaches, ask:
- What is counted: lines, controls, views, states, requirements, or journeys?
- What run data is collected, and is code or browser instrumentation required?
- Does the report expose element-level gaps a developer can act on?
- Which frameworks and browsers does it support?
- Can your team review the report in its CI workflow?
- Does the workflow require a cloud service, account, or recorded replay?
The cited Cypress material documents its Test Replay-based UI report. Playwright documents browser testing and accessibility guidance; these sources do not establish an independent head-to-head ranking of coverage tools.
6. What UI coverage cannot tell you
Coverage cannot show on its own that assertions are correct, that a flow is easy to understand, or that real users can complete it. It also cannot stand in for accessibility assessment. Playwright cautions that automated accessibility testing detects some common issues, while many problems require manual testing. Combine automated checks with manual assessment and inclusive user testing where appropriate; see Playwright’s accessibility testing guidance.
Similarly, a test that visits a page may miss important states such as validation errors, empty results, permission boundaries, loading, or failure. Define the state coverage that matters for each critical journey instead of treating page visits as a complete account of behavior.
7. Troubleshooting UI coverage gaps
| Symptom | Likely cause | What to do |
|---|---|---|
| No Cypress UI Coverage report | The run was not recorded with Test Replay, or the recording setup is incomplete. | Check the project against the Cypress setup guide and confirm Test Replay is enabled for the recorded run. |
| A critical view appears unvisited | The test suite never navigates there, or the path depends on unavailable test data or a condition. | Trace the journey from its entry point, make its data and prerequisites deterministic, and add a test for the route if users rely on it. |
| A visible control is marked untested | No recorded test interacted with it, or the tool’s interactivity rules do not classify it as expected. | Confirm the element is an actual user interaction. Add a test that performs the action and asserts the resulting behavior; review the tool’s counting rules. |
| Coverage rises but confidence does not | Tests touch more elements without validating outcomes, or they cover low-risk areas first. | Add user-visible assertions and prioritize important workflows and failure states. |
| Results vary between runs | Tests may share state, depend on external data, or encounter timing-sensitive behavior. | Isolate tests, control test data, and use the browser-testing tool’s supported waiting and debugging practices instead of relying on arbitrary timing. |
| A browser-specific issue is missed | The flow ran only in one browser configuration. | Configure projects for the browsers relevant to your users and run the suite against them. |
8. Reliability, performance, and cost
Coverage is only as reliable as the runs and observations behind it. Keep test data repeatable, isolate cases, and investigate whether failed or skipped tests distort the report before comparing runs. For Cypress UI Coverage specifically, account for its documented dependence on recorded Test Replay data and Cypress Cloud. The cited sources do not provide a universal performance overhead, pricing comparison, or coverage target; check the current terms and configuration of the tool you choose.
For suite performance, prioritize a small set of high-value end-to-end journeys and use other test layers for checks that do not need a real browser flow. Run the browser matrix appropriate to your product. Treat faster execution as an operational choice, not a reason to remove assertions that verify important outcomes.
9. Capture screenshots for visual review
Browser tests answer behavioral questions with actions and assertions. Screenshots can add visual evidence when reviewing a page or documenting a state, but a screenshot alone does not establish that a control works or that a UI coverage gap is fixed. ScreenshotNeo is a website screenshot API and MCP server for developers, made by Yorker Media. Its website describes clean captures, with cookie and consent banners, newsletter popups, and chat widgets removed before capture; each cleanup step can be turned off.
Or skip the browser setup
For a standalone page screenshot, make one GET request. This captures a page for visual inspection; it does not run your application’s UI tests or measure UI coverage. See the ScreenshotNeo API documentation for request options.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
- Cookie banners, consent prompts, newsletter popups, and chat widgets are removed before the shot; each step can be disabled.
- Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing. Response headers identify the page verdict and whether it was billed.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for Claude, Cursor, and other MCP clients. - The free plan includes 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan.
Sign up for 1,000 free screenshots a month, with no card required.
10. FAQ
Is UI coverage the same as code coverage?
No. Code coverage tracks executed source code. UI coverage tracks interface items or experiences exercised under a particular tool’s definition.
Does a high UI coverage score mean the app is well tested?
No. Review the tests and their assertions. A test can interact with an element without checking that the outcome is correct.
What UI coverage percentage should a team target?
There is no universal target established by the cited sources. Set goals for important user journeys and keep the metric definition consistent.
Can screenshots replace UI tests?
No. Screenshots provide visual evidence of a captured state; browser tests exercise behavior and assert outcomes.


