Skip to content

Prompt: cy.prompt – Ability to generate Cypress tests from natural language #31826

@jennifer-shehane

Description

@jennifer-shehane

What would you like?

We're working on a new experimental command: cy.prompt(). It lets you write tests using natural language prompts, like:

cy.prompt([
  `Visit https://aicotravel.com`,
  `Type Paris in "where do you want to go"`,
  `Click on the first result`,
  `Click on the number of day picker`,
  `Click on 4 days`,
  `Press the Create Itinerary Button`
])

Cypress will translate this into test steps, execute them, and adapt as the application under test changes (similar to self-healing behavior).

How it Works

  • Accepts a plain text prompt describing desired test actions.
  • Cypress generates and runs the appropriate Cypress commands using AI in the browser.
  • Prompts can stay part of your source code.
  • Users can optionally export the generated steps as standard Cypress test code.
Image Image

Watch a demo

https://www.youtube.com/watch?v=v5-KkZmZkao

Why is this needed?

Writing and maintaining E2E tests can be tedious, especially as apps evolve and DOM structures shift. cy.prompt aims to simplify authoring and make tests more resilient by letting you describe what you want to test, not how to do it.

Feedback

We’d love to hear what types of prompts you'd use or where this could help in your workflow. Drop your ideas in the comments below or sign up for early access.

Metadata

Metadata

Labels

type: featureNew feature that does not currently exist

Type

No type

Projects

Status

Experimental

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions