Add your missing tests faster, with Test Generation in UI Coverage

May 28, 2025

By Mark Noonan

Animation showing the process of choosing and element and generating test coverage for it

Today we are proud to launch AI-powered Test Generation in Cypress Cloud, to help you quickly add tests for the untested elements detected in UI Coverage reports, in a way that follows your existing practices and conventions.

Test generation in UI Coverage is the first of a set of AI-powered test generation tools that Cypress will release this year, and it works in just three steps:

  1. Select an interactive element in your UI Coverage report, from any state of your application
  2. Click “Generate test code”
  3. Choose where to add the tests, from a list of specs that already render this element
UI Coverage showing generated test code after clicking the "Generate Test Code" button when the sidenav-signout button is pinned

Cypress will generate a new test that includes all the required setup steps to reach the element in your UI, and performs an appropriate interaction for the element type and surrounding context. 

The generated code will use your existing patterns for navigating and interacting with your application, including custom commands you may have for locating elements or setting up state, and will recommend where followup assertions should be written after the actions are complete.

This test can be copied directly into your spec file at the suggested location, and from there you can continue writing the test locally. You own all the test code after the generation, if you choose to check it in.

Note: UI Coverage is a premium solution in Cypress Cloud, and is not included in a standard Cloud subscription. Free trials are available, contact us to learn more.

How does this help you?

It’s all about providing you generated test code in the right place, at the right time – when you are reviewing untested elements in an existing suite and making decisions about coverage.

UI Coverage is configured to match your specific testing goals, measuring if your tests are performing the user-facing actions that matter to you. As such, elements flagged in your report should be treated in one of two ways: you will either ignore the element (through configuration) if it is not something you expect to be covered by your test suite, or you will add the missing tests.

Until now, adding coverage meant starting from scratch in your local environment. It takes a little bit of time to find the right place to add a test, understand all the required steps to reach a given state, and kick off this new branch of a user flow. Any friction in the process leads to tasks getting delayed – especially if it’s not clear exactly what is needed.

We’ve all seen test suites degrade over time due to multiple small friction points related to maintenance. Sometimes people are forced to avoid “cleaning as they work” because it’s tricky to detect when coverage has changed in the first place, and adding coverage can become an unplanned extra task that gets in the way of something else. As the application changes, new user actions become possible, but may not always have corresponding tests, reducing the overall value of the test suite as a quality gate - because users will have untested means of carrying out actions, where bugs would not be detected by your test pipeline.

With today’s release of Test Generation, UI Coverage now helps with both sides of this: you can see what user-facing actions are untested, and then see exactly what is needed to test them, taking out all the guesswork.

When do you use UI Coverage Test Generation?

A listed of new untested elements

There are two main scenarios when you will look at your UI Coverage Report in Cypress Cloud:

  1. When auditing your test suite for coverage.
  2. When reviewing changes in coverage caused by an update in tests or in the underlying application. 

Auditing your full suite is probably something that one or two people will do on an occasional basis, after the initial setup period when UI Coverage is first being configured. On a day-to-day basis, developers and testers will most likely check the changes in coverage that are related to their own work, or look at the changes that are detected between different nightly test runs.

In the first situation, doing a complete audit, you will mostly focus on shaping the report by ignoring what is not relevant, as opposed to adding every single desired test as you go.

But in the second situation, you will want to quickly add coverage if a new element has been detected that didn’t exist before and needs a test, or if an existing element that used to be covered has lost coverage as an unexpected side effect of changing your test code. Usually you’ll run your tests before merging the related changes, and quickly patch important missing coverage to  merge faster, and with more confidence in the underlying changes.

Best of all, it helps you detect the problem and make an intentional, informed choice about adding coverage, without creating a ticket in your backlog. No discussion, no pointing, no ranking, no putting it off for a sprint to focus on something else. Instead, you’ll have correct tests.

How to get started

Test Generation is live now for all UI Coverage customers. If you haven’t checked out UI Coverage yet, free trials are available, and it requires no code instrumentation or setup - running completely in Cypress Cloud. This means we can show you a demo with your own data, and you’ll see how UI Coverage and Test Generation perform with your tests, so that you are up and running on day one of your trial.