What’s new in cy.prompt for AI testing in Cypress

January 22, 2026

By Jennifer Shehane

When we first released cy.prompt as an experimental feature, our primary goal was learning. We wanted to understand how teams would actually use AI driven test authoring inside real test suites, where it would help, where it would fall down, and what would build or erode trust.

Since then, we've seen meaningful usage from real projects, thoughtful feedback from customers, and clear patterns in how teams want AI to fit into their testing workflows. Those learnings have directly shaped the updates we're shipping now and the direction we're heading next.

Below is a look at what’s new in cy.prompt, along with a preview of what we are actively working on.

Asserting on non existence in prompt steps

One of the most common requests we heard was the ability to assert that something does not exist as part of a prompt driven step.

We've added support for not.exist assertions inside cy.prompt. Today, this requires an explicit CSS selector and does not yet work with natural language descriptions.

For example, this works:

cy.prompt("Ensure the .loading-spinner does not exist")

This will not work yet:

cy.prompt("Confirm the loading spinner should not exist")

The reason for this constraint is intentional. Non existence is difficult to verify reliably from natural language alone. Requiring a selector gives Cypress a clear, unambiguous target and keeps the result predictable and debuggable.

We see this as a foundational step and we're already exploring how to expand these capabilities further.

Faster authoring with command options

Another area of feedback was speed. Teams told us that once they trusted cy.prompt, they wanted to write fewer lines of code while still keeping control.

We've added support for passing certain command options directly through prompt steps. Right now this includes timeout and force for commands that support them.

cy.prompt([
  "Visit the /dashboard with a timeout of 10 seconds",
  "Force click the 'Profile' button"
})

The prompt above will generate code similar to below:

cy.visit('/dashboard', { timeout: 10000 }
cy.get('.profile').click({ force: true })

This allows you to express intent in one place instead of writing a prompt and then immediately following it with a hand written command with the needed options.

Controlling selector priority with Cypress.ElementSelector

Different teams have different opinions about how elements should be found. Some prefer test ids. Others prefer accessibility attributes. Some want a very specific order of precedence.

You can control selector priority explicitly when using cy.prompt by defining your preferences with the Cypress.ElementSelector API and writing those queries directly in code.

Cypress.ElementSelector.setPriority([
  'aria-label',
  'role',
  'id',
  'class'
])

cy.prompt("Click the Close button")

This prompt above will generate code similar to below:

cy.get('[aria-label="Close"]').click()

This gives you more predictability and aligns AI driven queries with the conventions your team already follows.

In case you missed it: self healing with visibility

We recently added self healing indicators to make it clear when a selector was reused, adapted, or regenerated. The goal is transparency. You should always know when AI helped and how it helped.

If you missed that announcement, this post walks through how self healing works and how we surface that information in Cypress.

In case you missed it: testing scroll into view

We also added support for testing scenarios where elements need to be scrolled into view. This is a common source of flakiness and confusion, especially when tests are written quickly.

You can now express that intent directly in cy.prompt. Details and examples are covered in this post.

What’s coming next

The biggest improvement we are working on is generating cy.contains() queries where appropriate instead of defaulting to cy.get(). Many teams prefer asserting on visible text rather than selectors, and this change should improve test stability and better reflect how people reason about the UI.

We're also expanding interaction and assertion support, including hover behavior that generates .trigger() calls, direct use of .trigger() in prompt, and broader not.exist assertion capabilities.

If you're experimenting with AI in testing, or curious how it can fit into a serious, maintainable test suite, now is a great time to explore what cy.prompt can do and help shape what comes next. Check out how to get started in our documentation.