From 9026eb0ca3baed672264169ab53294ddb973a90c Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 6 Oct 2025 10:27:57 -0400 Subject: [PATCH 1/5] remove experimentalStudio flag (#6283) --- cypress.config.ts | 1 - docs/app/guides/cypress-studio.mdx | 17 ++++------------- docs/app/references/experiments.mdx | 10 +++++----- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 2ff3cead21..3f90e8524e 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -13,7 +13,6 @@ export default defineConfig({ openMode: 0, }, e2e: { - experimentalStudio: true, supportFile: false, baseUrl: "http://localhost:3000", setupNodeEvents(on, config) { diff --git a/docs/app/guides/cypress-studio.mdx b/docs/app/guides/cypress-studio.mdx index 3c436540d2..f37ae27d04 100644 --- a/docs/app/guides/cypress-studio.mdx +++ b/docs/app/guides/cypress-studio.mdx @@ -37,19 +37,10 @@ Instead of manually typing every `.get()`, `.click()`, or `.type()` command, you :::success -1. **Enable Studio:** - Add to your `cypress.config.js` (Cypress Studio is currently experimental): - - ```js - { - e2e: { - experimentalStudio: true - } - } - ``` - -2. **Run a Spec:** - Open Cypress, run a spec file, and click New Test or Edit in Studio. +1. **Run a Spec:** + Open Cypress and run a spec file +2. **Open Studio:** + Click Edit in Studio on a test in the Command Log or click Studio Beta in the Studio panel. 3. **Interact & Save:** Click, type, and right-click to add assertions. Click Save to save your test. diff --git a/docs/app/references/experiments.mdx b/docs/app/references/experiments.mdx index 1734e01569..1116d7ed14 100644 --- a/docs/app/references/experiments.mdx +++ b/docs/app/references/experiments.mdx @@ -263,11 +263,10 @@ creating `e2e` and `component` objects inside your Cypress configuration. These experiments are available to be specified inside the `e2e` configuration object: -| Option | Default | Description | -| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- | -| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. | -| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. | -| `experimentalOriginDependencies` | `false` | Enables support for `Cypress.require` within `cy.origin`. | +| Option | Default | Description | +| -------------------------------- | ------- | ---------------------------------------------------------------------------------------------- | +| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. | +| `experimentalOriginDependencies` | `false` | Enables support for `Cypress.require` within `cy.origin`. | ### Component Testing @@ -282,6 +281,7 @@ configuration object: | Version | Changes | | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| [15.4.0](/app/references/changelog) | Removed `experimentalStudio`. Cypress Studio is available as default behavior. | | [14.0.0](/app/references/changelog#14-0-0) | Removed `experimentalJustInTimeCompile` and `experimentalSkipDomainInjection` and made it default behavior. | | [13.14.0](/app/references/changelog#13-14-0) | Added support for configuring the Experimental Just-In-Time (JIT) Compiling for component testing via `experimentalJustInTimeCompile`. | | [13.4.0](/app/references/changelog#13-4-0) | Added support for configuring the Experimental Flake Detection strategy via `retries.experimentalStrategy` and `retries.experimentalOptions`. | From 08024c9e07710187ab2681e352a8650a75e79119 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 6 Oct 2025 12:40:40 -0400 Subject: [PATCH 2/5] docs: adds --posix-exit-codes cli flag for run mode (#6284) * adds --posix-exit-codes cli flag for run mode * add history entry * clarify option/description table for --posix-exit-codes * expand docs on posix exit codes * prettify bash block * fix changelog link * formatting * Add posixExitCodes to module API page * changelog * lint fix --------- Co-authored-by: Jennifer Shehane Co-authored-by: Jennifer Shehane --- docs/app/references/changelog.mdx | 4 ++++ docs/app/references/command-line.mdx | 30 +++++++++++++++++++++++++++- docs/app/references/module-api.mdx | 2 ++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/app/references/changelog.mdx b/docs/app/references/changelog.mdx index 052827fb09..eee24ac935 100644 --- a/docs/app/references/changelog.mdx +++ b/docs/app/references/changelog.mdx @@ -8,6 +8,10 @@ sidebar_label: Changelog # Changelog +## 15.4.0 + +_Released 10/07/2025_ + ## 15.3.0 _Released 9/23/2025_ diff --git a/docs/app/references/command-line.mdx b/docs/app/references/command-line.mdx index 1ec960a2b7..c59a92ed42 100644 --- a/docs/app/references/command-line.mdx +++ b/docs/app/references/command-line.mdx @@ -217,6 +217,7 @@ cypress run [options] | `--no-runner-ui` | [Hides the Cypress Runner UI](#cypress-run-no-runner-ui) | | `--parallel` | [Run recorded specs in parallel across multiple machines](#cypress-run-parallel) | | `--port`,`-p` | [Override default port](#cypress-run-port-lt-port-gt) | +| `--posix-exit-codes` | [Exit with a POSIX-compliant exit code](#cypress-run-posix-exit-codes) rather than the number of failed tests. | | `--project`, `-P` | [Path to a specific project](#cypress-run-project-lt-project-path-gt) | | `--quiet`, `-q` | [Reduce output to `stdout`](#cypress-run-quiet) | | `--record` | [Whether to record the test run](#cypress-run-record-key-lt-record-key-gt) | @@ -439,6 +440,16 @@ documentation to learn more. cypress run --port 8080 ``` +#### `cypress run --posix-exit-codes` {#cypress-run-posix-exit-codes} + +This changes the default behavior of Cypress regarding exit codes. This flag causes Cypress to exit with POSIX exit code of 1 when there are test failures or if Cypress could not run, rather than the number of tests that failed. + +```shell +cypress run --posix-exit-codes +``` + +For more about Cypress' exit code behavior, see the [Exit Code section](/app/references/command-line#Exit-code). + #### `cypress run --project ` {#cypress-run-project-lt-project-path-gt} To see this in action we've set up an @@ -602,7 +613,7 @@ $ echo $? 0 ``` -If there are any test failures, then the exit code will match the number of +By default, if there are any test failures, then the exit code will match the number of tests that failed. ```text @@ -617,6 +628,22 @@ $ echo $? 2 ``` +You can change this behavior by passing the `--posix-exit-codes` flag. When this flag is passed, +the exit code will be 0 if all tests pass. If there are any test failures or if Cypress could not run, +the exit code will be 1. + +```text +## Spec with two failing tests +$ cypress run +... + Tests Passing Failing + ✖ 1 of 1 failed (100%) 00:22 17 14 2 + +## print exit code on Mac or Linux +$ echo $? +1 +``` + If Cypress could not run for some reason (for example if no spec files were found) then the exit code will be 1. @@ -975,6 +1002,7 @@ and with Windows CMD and PowerShell terminal windows. | Version | Changes | | ------------------------------------------ | ---------------------------------------------------------- | +| [15.4.0](/app/references/changelog#15-4-0) | Added `--posix-exit-codes` flag to `cypress run` | | [12.6.0](/app/references/changelog#12-6-0) | Added `--auto-cancel-after-failures` flag to `cypress run` | | [5.4.0](/app/references/changelog) | Added `prune` subcommand to `cypress cache` | | [5.4.0](/app/references/changelog) | Added `--size` flag to `cypress cache list` subcommand | diff --git a/docs/app/references/module-api.mdx b/docs/app/references/module-api.mdx index ee997bb427..57a96470fe 100644 --- a/docs/app/references/module-api.mdx +++ b/docs/app/references/module-api.mdx @@ -77,6 +77,7 @@ Just like the [Command Line options](/app/references/command-line) for | `exit` | _boolean_ | Whether to close Cypress after all tests run | | `parallel` | _boolean_ | Run recorded specs in [parallel](/cloud/features/smart-orchestration/parallelization) across multiple machines | | `port` | _number_ | Override default port | +| `posixExitCodes` | _boolean_ | Exit with a POSIX-compliant exit code rather than the number of failed tests. | | `project` | _string_ | Path to a specific project | | `quiet` | _boolean_ | If passed, Cypress output will not be printed to `stdout`. Only output from the configured [Mocha reporter](/app/tooling/reporters) will print. | | `record` | _boolean_ | Whether to record the test run | @@ -367,6 +368,7 @@ node ./wrapper cypress run --browser chrome --config ... | Version | Changes | | ------------------------------------------ | ------------------------------------------------------- | +| [15.4.0](/app/references/changelog#15-4-0) | Added `posixExitCodes` to run options. | | [12.6.0](/app/references/changelog#12-6-0) | Added `autoCancelAfterFailures` to run options. | | [10.0.0](/app/references/changelog#10-0-0) | `slowTestThreshold` is now scoped to each testing type. | | [8.7.0](/app/references/changelog#8-7-0) | Added `slowTestThreshold` configuration option. | From 169bbf699afa932ac1557464256aad04391fe14a Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 7 Oct 2025 15:52:18 -0400 Subject: [PATCH 3/5] cy.prompt docs (#6270) * docs: begin writing cy.prompt docs * Iterate on wording * lint * Fix links + improve TOC * Fix some css warnings * update dynamic variable examples * lint fix * update areas based on feedback * lint * Add more examples to prompt docs * lint fix * Add Gherkin examples * lint fix * Add another Gherkin example * lint fix * update some styles to make more space in UI * Update yields of prompt * Update language support * Remove trigger from officially supported 'things to do' * lint * Add not.exist assertions not being supported * expand documented assertion types * Updates for placeholders * update docs * add to TOC * fix loop example. * Update docs/api/commands/prompt.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Update docs/api/commands/prompt.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Some wording updates * Update docs/api/commands/prompt.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * lint * fix broken links --------- Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> --- docs/api/commands/prompt.mdx | 779 ++++++++++++++++++ docs/api/table-of-contents.mdx | 1 + src/components/docs-image/style.module.css | 4 +- src/components/video-local/style.module.css | 2 +- src/css/custom.scss | 15 +- src/css/embeds.scss | 2 +- src/css/markdown.scss | 6 +- src/css/table-of-contents.scss | 3 +- static/img/api/prompt/cy-prompt-demo.mp4 | Bin 0 -> 957986 bytes .../api/prompt/cy-prompt-need-more-info.mp4 | Bin 0 -> 323039 bytes .../gherkin-example-cy-prompt-command-log.png | Bin 0 -> 125307 bytes 11 files changed, 805 insertions(+), 7 deletions(-) create mode 100644 docs/api/commands/prompt.mdx create mode 100644 static/img/api/prompt/cy-prompt-demo.mp4 create mode 100644 static/img/api/prompt/cy-prompt-need-more-info.mp4 create mode 100644 static/img/api/prompt/gherkin-example-cy-prompt-command-log.png diff --git a/docs/api/commands/prompt.mdx b/docs/api/commands/prompt.mdx new file mode 100644 index 0000000000..e0d2d9c2ab --- /dev/null +++ b/docs/api/commands/prompt.mdx @@ -0,0 +1,779 @@ +--- +title: 'cy.prompt() - Generate Cypress Tests with Natural Language and AI' +description: Generate Cypress tests from plain English using AI. Automate test creation, reduce maintenance, and enable self-healing with cy.prompt. +sidebar_label: prompt +slug: /api/commands/prompt +e2eSpecific: true +sidebar_custom_props: { 'new_label': true } +--- + + + +:::warning + +`cy.prompt` is currently invite-only. [Request access](https://on.cypress.io/cy-prompt-early-access?utm_source=docs.cypress.io&utm_medium=prompt-command&utm_content=Request-access) to get early access. + +::: + +# prompt + +`cy.prompt` is a Cypress command that uses AI to convert natural language test steps into executable Cypress tests. It's designed to be flexible - you can use it to quickly generate tests and commit them to source control, or keep it running continuously for self-healing tests that adapt to your app's changes. You can choose the workflow that fits your project's needs. + +:::note + +Before you start coding with `cy.prompt` + +- [How it works](#How-it-works) — understand the AI-powered process behind `cy.prompt` +- [Choosing your workflow](#Choose-your-workflow) — decide between one-time generation or continuous self-healing +- [How to write effective prompts](#How-to-write-effective-prompts) — craft clear, reliable natural language steps +- [What you can do](#What-you-can-do) — explore supported actions and capabilities +- [Setup](#Setup) — enable the command and configure authentication + +::: + + + +_The demo above shows `cy.prompt` in action with [Cypress Studio](/app/guides/cypress-studio)._ + +## Syntax + +```typescript +interface PromptCommand { + ( + steps: string[], // array of steps to execute + options?: { + placeholders?: { [key: string]: string } // redacted dynamic inputs that are ignored for cache identity + } + ): void +} +``` + +### Arguments + + **steps _(String[])_** + +An array of steps to execute. + + **options _(Object)_** + +Pass in an options object to `cy.prompt()`. + +| Option | Default | Description | +| -------------- | ------- | --------------------------------------------------------------------------------------------------------------------- | +| `placeholders` | `{}` | Dynamic or sensitive values that enable high performance caching. See [placeholders](#Placeholders) for more details. | + + + +`cy.prompt()` yields the value yielded by the last Cypress command executed in the prompt. In most cases, this will be an element, but it depends on the last command executed in the prompt. + +```javascript +cy.prompt([ + // Executes cy.visit('/user-management') + 'visit https://cloud.cypress.io/login', + // Executes cy.get('#login-button').click() + 'click the login button', +]) // yields