UI Coverage FAQ
General
What is UI Coverage?
UI Coverage is a Cypress Cloud feature that shows you which interactive elements of your application your tests actually exercise. Every recorded run produces a visual report of tested and untested elements across all of your application's views, along with a coverage score you can track over time.
Do I need to install anything to use UI Coverage?
No. UI Coverage requires no code changes or instrumentation. Reports are generated from Test Replay data, so any run recorded to Cypress Cloud with Test Replay on Cypress v13 or later is ready to use. See setup for details.
How is the UI Coverage score calculated?
The score compares the number of tested interactive elements to the total number of interactive elements in your application. Grouped elements count as a single unit: the group counts once toward the total, and an interaction with any element in the group marks the whole group as tested.
Views and URLs
Why do similar URLs show up as separate views?
Automatic grouping only replaces path segments that are numbers or IDs (UUIDs and UUID-like values) with a wildcard. Segments like usernames or slugs are not recognized as dynamic, so /users/alice and /users/bob remain separate views. Add a views pattern to group them yourself. See how views are created for the full set of automatic rules.
Do query parameters create separate views?
No. Query strings are ignored when grouping, so /dashboard?tab=overview and /dashboard?tab=settings become a single /dashboard view. If a query parameter meaningfully changes the page, use a views pattern with groupBy on that parameter to split it into separate views.
How do I exclude URLs from UI Coverage?
Add a viewFilters rule with include: false for a URL pattern. Excluding a URL removes its snapshots from the report and stops links pointing to it from counting against your coverage score. The Ignore views and links guide walks through common cases.
Why is a page missing from my report?
Views are created from URLs your tests actually visit, so a page that no test navigates to has no view. Check untested links in the report — pages that are linked to but never visited appear there. Also confirm that a viewFilters rule isn't excluding the page unintentionally.
Element grouping and identification
What happens if two elementGroups rules match the same element?
The first matching rule in your elementGroups configuration wins, so list specific rules before broad catch-all rules. A rule that appears after another rule matching the same elements never applies to them.
Can I group or filter elements inside iframes or shadow DOM?
Yes. The elementGroups, elementFilters, and elements configuration options all accept a documentScope property that limits a rule to elements inside specific iframes or shadow DOM hosts. List one CSS selector per host, ordered from the outermost document to the innermost.
Why isn't my element group showing up in the report?
The most common causes are:
- An earlier
elementGroupsrule matches the same elements, and the first matching rule wins. - The elements are excluded by
elementFilters, so they're never considered for grouping. - The elements declare a group in markup with the
data-cy-ui-groupattribute, which takes priority over configuration rules. - The selector matches a container rather than the interactive elements themselves.
- The report was processed before you saved the configuration. Regenerate the run to apply the current configuration.
How do I exclude elements from UI Coverage?
Add an elementFilters rule with include: false for a CSS selector that matches the elements. Excluded elements are removed from the report and don't count toward your coverage score. This is the standard way to remove third-party widgets, such as chat launchers or cookie banners, from your reports. The Ignore elements guide walks through common cases.
Do excluded elements count toward my UI Coverage score?
No. An element excluded by elementFilters doesn't appear in the report and doesn't count toward the score, whether your tests interacted with it or not. It's also not considered by elementGroups or elements rules.
Why isn't my elementFilters rule excluding an element?
The most common causes are:
- The selector matches a container instead of the element itself. Filters use standard CSS matching against each tracked element, so
footermatches only the<footer>element. Use a descendant selector likefooter *to exclude everything inside a container. - An earlier
elementFiltersrule already matched the element, and the first matching rule wins. Aninclude: truerule above your exclude rule protects the elements it matches. - The rule has a
documentScopethat doesn't match the element's iframe or shadow DOM hosts. - The report was processed before you saved the configuration. Regenerate the run to apply the current configuration.
Can I exclude elements from UI Coverage without affecting Cypress Accessibility?
Yes. An elementFilters list at the root of your configuration applies to both products, but nesting it under a uiCoverage or accessibility key applies it to that product only. A nested list completely replaces a root-level one for that product; the two are not merged. See Exclude elements.
Why does one element appear as multiple elements in the report?
This usually means the element's identifying attributes change between snapshots, for example auto-generated IDs or dynamic class names. Use attributeFilters to ignore the dynamic attributes, or elements to define the element's identity explicitly. See troubleshooting for more scenarios.
Why isn't my elements rule applying?
An elements rule applies only when its selector matches exactly one interactive element in a snapshot. The most common causes are:
- The selector matches more than one interactive element in the same snapshot, so the rule is skipped for that snapshot. Add
documentScopeor a more specific selector, or useelementGroupsif several elements should share an identity. - The selector only matches non-interactive elements, such as a wrapper around the actual button or input.
- The element is excluded by
elementFilters, so it's never considered. - A later
elementsrule matches the same element, and the last matching rule wins. - The report was processed before you saved the configuration. Regenerate the run to apply the current configuration.
Configuration
Where do I set UI Coverage configuration?
In the App Quality tab of your project settings in Cypress Cloud. By default, only Admin users can edit configuration; your Cypress point-of-contact can change this on request. See Setting configuration.
Do I need to rerun my tests after changing configuration?
No. You can regenerate any historical run from its Properties tab, and the report is reprocessed with the current configuration. This lets you iterate on configuration and see the effects immediately without running your Cypress tests again.
Can I use different configuration for different runs?
Yes. The profiles property applies configuration overrides based on run tags, so a smoke-test run and a full regression run can each use their own settings.
See also
- Configuration overview lists every configuration option and what each one is for.
- Troubleshooting UI Coverage covers common report problems and their solutions.