Prompt: `cy.prompt` – Ability to generate Cypress tests from natural language
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.
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.
Aren't LLM's non-deterministic?
What’s the expected release date for the cy.prompt feature?
already send the request I would like to start testing, how can I do it?
There are some answers to some frequently asked questions (like above) here: https://www.cypress.io/blog/cy-prompt-frequently-asked-questions
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.