The first days after launch, we’ve already seen clear patterns in how teams adopt cy.prompt() and what they ask once it is in their suite. The takeaway: natural language test authoring is already saving time while fitting seamlessly into Cypress workflows.
We’ve gathered the questions we hear most often and included clear, practical examples you can try in your own tests right away.
What is working well
It feels like Cypress, not a sidecar tool. cy.prompt() shows up in the Command Log, you can time travel through steps, and you can use it in command chains. You can combine it with normal Cypress code, or eject the generated code and commit it. It can be used to target Shadow DOM elements.
Speed improves after the second run. The first run calls the model to translate each step. Cypress caches the generated commands and selectors, so repeat runs execute at near native speed. If a selector breaks due to a UI change, Cypress regenerates just that step and continues.
Two valid workflows. Same transparency.
- Keep prompts in place for self-healing tests that adapt when the UI changes.
- Or eject the generated code for predictable, version-controlled tests that run without the model.
Common questions answered
Setup and access
Do I need Cypress Cloud to use cy.prompt()? Yes. cy.prompt() uses a securely hosted model through Cypress Cloud. You can log in through the App or run with --record and a project key. You can use it on any plan.
What Cypress version is required? You need Cypress 15.4.0 or newer. We recommend the latest Cypress App version as we’re making continuous improvements.
Is this E2E only? What about browsers? Today it supports E2E tests on Chromium-based browsers. Component Testing is not supported yet.
Performance and caching
Why is my first run slower than the next ones? The first run translates your natural language to Cypress commands. That result is cached. Subsequent runs reuse the cache, if found, and run much faster.
My runs keep calling the model. Why? The cache is invalidated when prompt text, test name, or DOM changes significantly. The most common reason is dynamic values inside the step strings.
How do I keep the cache warm with dynamic data? Use placeholders. Pass sensitive or dynamic values in options.placeholders and reference them as {{name}} inside steps. Placeholder values do not affect cache identity and are not sent to the model.
cy.prompt(
[
'visit https://cloud.cypress.io/login',
'type "[email protected]" in the email field',
'type {{password}} in the password field',
'click the login button',
'verify we are redirected to the dashboard',
],
{ placeholders: { password: Cypress.env('PASSWORD') } }
)Can I warm the cache locally and benefit in CI? Yes. If you author and run locally, the prompt is cached for that project. When the same spec and prompt run in CI, Cypress looks for the existing cache.
Reliability and self-healing
When does self-healing apply? Only while the cy.prompt() call remains in your test. If the cached selector fails, Cypress regenerates commands for that step and re-executes.
What happens if I eject code? Ejected code runs like any other Cypress test. There is no self-healing. Choose this when you need strict predictability for review and auditing.
How do I avoid false positives during self-healing? Give the model enough context to target the exact element. Be precise in the step text. One action per step. Add scope when needed, for example: click the "Login" button in the header.
Prompt writing
What makes a good step? Use imperative verbs. One action per step. Quote exact text and values. Include scope when needed. Prefer absolute URLs when navigating. Utilize the action -> target -> location pattern.
Do Gherkin style steps work? Yes. You can use Given, When, Then style steps. There are no step definition files. The model interprets the steps and generates Cypress commands.
Can I chain commands after a prompt? Yes. cy.prompt() yields the subject from its last generated command. You can chain off of it just like any Cypress command.
Cross origin and advanced usage
Can I use cy.prompt() with cy.origin()? Yes. Use it inside a cy.origin() block for cross origin flows. This is a common pattern for auth.
cy.origin('https://cloud.cypress.io/login', () => {
cy.prompt(
[
'type "[email protected]" in the email field',
'type {{password}} in the password field',
'click the login button',
],
{ placeholders: { password: Cypress.env('PASSWORD') } }
)
})Can I use it inside custom commands or loops? Yes. For loops with dynamic values, use placeholders to avoid cache invalidation.
Limits, scope, and current gaps
What are the current usage limits during the experimental period? Per user per hour, with higher limits on paid plans. There is also a per prompt step cap of 50 steps to keep results reliable. After the experimental period concludes, usage limits and pricing will be defined based on real-world feedback to ensure the feature remains accessible for teams of all sizes.
Which Cypress APIs are not yet covered? cy.request() and cy.intercept() are not generated by prompts today. Canvas and iframe elements are not supported. not.exist assertions and multi element assertions are not yet supported.
Which languages does the command support? cy.prompt() is optimized for English prompts today.
Security and governance
Do you train models on our prompts or app data? No. Inputs and outputs are used only to provide the feature. They are session-bound and not used to train external models. Placeholders keep sensitive values out of model context.
Can I disable AI features for my organization? Yes. Org admins can toggle in-Cloud AI capabilities within Organization Settings. For cy.prompt(), ensure that the experimentalPromptCommand flag is either not in the Cypress config file or explicitly set to false. If you want to leverage the command during local development only, you can also choose to eject the code and run without cy.prompt() in place.
Practical recipes you can copy
1) Mixed authoring with clean chaining
Author the flow in natural language, then chain a standard assertion that depends on the yielded subject.
cy.prompt([
'visit https://example.com/products',
'click the "Add to Cart" button for the first product',
])
.closest('form')
.should('have.class', 'in-cart')2) Keep prompts in place for fast changing UIs
Let prompts self-heal when selectors shift. Great during active development.
cy.prompt([
'open the filter panel',
'select the category "Electronics"',
'click the "price high to low" button in the sorting options container',
'verify the available product count shows 25',
])3) Eject code for compliance review
Generate with cy.prompt(), click the ‘<> Code’ button in the App, click save code, and then commit. Use this when you need strict code review and no regeneration.
4) Cross origin login with redaction
Use placeholders to keep secrets out of model context and preserve cache identity.
cy.origin('https://auth.example.com', () => {
cy.prompt(
[
'type "[email protected]" in the email field',
'type {{pwd}} in the password field',
'click the "Sign In" button',
'verify the current URL contains "/dashboard"',
],
{ placeholders: { pwd: Cypress.env('QA_PASSWORD') } }
)
})5) Data driven checks with caching intact
Iterate over values without busting the cache.
['apple', 'orange', 'banana'].forEach((term) => {
cy.prompt(
[
'focus the search input',
'type "{{term}}" in the search input',
'verify the search results contain 1 item',
'verify the search results contain {{term}}'
],
{ placeholders: { term } }
)
})Quick start checklist
Want to try it yourself? The steps below walk you through setup and your first run with cy.prompt(). You can read the full guide in the cy.prompt docs and create a free Cypress Cloud account to get started today.
- Upgrade to Cypress 15.4+ and enable experimentalPromptCommand in config.
- Log into Cypress Cloud in the App or run with --record and a key.
- Write a short flow with one action per step.
- Replace dynamic values with {{placeholders}}.
- Run the Cypress App in open mode to confirm the steps execute as expected and the test passes. Run the test again to confirm the cache has been established and observe the condensed test execution time.
- Commit the new test code and trigger CI test suite execution.
- Create a plan for cy.prompt() implementation within your test suite. Keep prompts in place for adaptive, self-healing tests. Eject for application areas that are stable or have a need for increased governance.
