cypress icon indicating copy to clipboard operation
cypress copied to clipboard

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

Open jennifer-shehane opened this issue 10 months ago • 1 comments

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

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.

jennifer-shehane avatar Jun 04 '25 15:06 jennifer-shehane

Aren't LLM's non-deterministic?

applesaucesome avatar Jun 06 '25 20:06 applesaucesome

What’s the expected release date for the cy.prompt feature?

mah-noor1 avatar Jun 17 '25 07:06 mah-noor1

already send the request I would like to start testing, how can I do it?

vanessaolmos88 avatar Jul 01 '25 21:07 vanessaolmos88

There are some answers to some frequently asked questions (like above) here: https://www.cypress.io/blog/cy-prompt-frequently-asked-questions

jennifer-shehane avatar Jul 23 '25 15:07 jennifer-shehane

Released in 15.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v15.4.0, please open a new issue.

cypress-bot[bot] avatar Oct 07 '25 20:10 cypress-bot[bot]