Skip to content

Commit be11ee5

Browse files
Merge branch 'develop' into update-v8-snapshot-cache-on-develop-windows
2 parents 9a1a72c + 4969ef3 commit be11ee5

File tree

143 files changed

+5804
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+5804
-551
lines changed

.circleci/cache-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Bump this version to force CI to re-create the cache from scratch.
2-
10-2-2025
2+
10-3-2025

.circleci/src/pipeline/@pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ commands:
118118
name: Set environment variable to determine whether or not to persist artifacts
119119
command: |
120120
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
121-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "electron-37" ]]; then
121+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "feat/cy-prompt" ]]; then
122122
export SHOULD_PERSIST_ARTIFACTS=true
123123
fi' >> "$BASH_ENV"
124124
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

.circleci/src/pipeline/workflows/@main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ linux-x64:
55
- equal: [ develop, << pipeline.git.branch >> ]
66
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
77
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
8-
- equal: [ 'electron-37', << pipeline.git.branch >> ]
8+
- equal: [ 'feat/cy-prompt', << pipeline.git.branch >> ]
99
- matches:
1010
pattern: /^release\/\d+\.\d+\.\d+$/
1111
value: << pipeline.git.branch >>
@@ -309,7 +309,7 @@ linux-x64:
309309
- /^release\/\d+\.\d+\.\d+$/
310310
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
311311
- 'update-v8-snapshot-cache-on-develop'
312-
- 'chore/refactor_cli_to_ts'
312+
- 'feat/cy-prompt'
313313
context: test-runner:npm-release
314314
requires:
315315
- ready-to-release

cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _Released 10/7/2025 (PENDING)_
77

88
- Cypress Studio is now available by default. You no longer have to set the `experimentalStudio` flag. Addresses [#30997](https://github.com/cypress-io/cypress/issues/30997). Addressed in [#32571](https://github.com/cypress-io/cypress/pull/32571).
99
- Added the `--posix-exit-codes` flag for the `run` command. When this flag is passed, Cypress will exit with 1 if any tests fail, rather than the number of failed tests. Addresses [#32605](https://github.com/cypress-io/cypress/issues/32605) and [#24695](https://github.com/cypress-io/cypress/issues/24695). Addressed in [#32609](https://github.com/cypress-io/cypress/pull/32609).
10+
- `cy.prompt` is now a reserved Cypress command, currently gated behind a feature flag that requires an invite from Cypress. This means any custom commands named 'prompt' will no longer work. Stay tuned for updates on when this feature will become more widely available. Addresses [#31826](https://github.com/cypress-io/cypress/issues/31826).
1011

1112
**Bugfixes:**
1213

cli/types/cypress.d.ts

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-unused-vars */
21
/// <reference path="./cypress-npm-api.d.ts" />
32
/// <reference path="./cypress-eventemitter.d.ts" />
43
/// <reference path="./cypress-type-helpers.d.ts" />
@@ -59,6 +58,9 @@ declare namespace Cypress {
5958
interface ObjectLike {
6059
[key: string]: any
6160
}
61+
interface PromptOptions {
62+
excludeFromAI?: Record<string, string>
63+
}
6264
interface Auth {
6365
username: string
6466
password: string
@@ -684,22 +686,22 @@ declare namespace Cypress {
684686
Keyboard: {
685687
defaults(options: Partial<KeyboardDefaultsOptions>): void
686688
Keys: {
687-
DOWN: 'ArrowDown',
688-
LEFT: 'ArrowLeft',
689-
RIGHT: 'ArrowRight',
690-
UP: 'ArrowUp',
691-
END: 'End',
692-
HOME: 'Home',
693-
PAGEDOWN: 'PageDown',
694-
PAGEUP: 'PageUp',
695-
ENTER: 'Enter',
696-
TAB: 'Tab',
697-
BACKSPACE: 'Backspace',
698-
SPACE: 'Space',
699-
DELETE: 'Delete',
700-
INSERT: 'Insert',
701-
ESC: 'Escape',
702-
},
689+
DOWN: 'ArrowDown'
690+
LEFT: 'ArrowLeft'
691+
RIGHT: 'ArrowRight'
692+
UP: 'ArrowUp'
693+
END: 'End'
694+
HOME: 'Home'
695+
PAGEDOWN: 'PageDown'
696+
PAGEUP: 'PageUp'
697+
ENTER: 'Enter'
698+
TAB: 'Tab'
699+
BACKSPACE: 'Backspace'
700+
SPACE: 'Space'
701+
DELETE: 'Delete'
702+
INSERT: 'Insert'
703+
ESC: 'Escape'
704+
}
703705
}
704706

705707
/**
@@ -755,7 +757,7 @@ declare namespace Cypress {
755757
* Trigger action
756758
* @private
757759
*/
758-
action: <T = (any[] | void) >(action: string, ...args: any[]) => T
760+
action: <T = (any[] | void)>(action: string, ...args: any[]) => T
759761

760762
/**
761763
* Load files
@@ -1849,7 +1851,12 @@ declare namespace Cypress {
18491851
* @see https://on.cypress.io/prevuntil
18501852
*/
18511853
prevUntil<E extends Node = HTMLElement>(element: E | JQuery<E>, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1852-
1854+
/**
1855+
* An AI-powered command that generates Cypress commands from natural language test steps.
1856+
*
1857+
* @see https://on.cypress.io/prompt
1858+
*/
1859+
prompt<T>(steps: string[], options?: PromptOptions): Chainable<T>
18531860
/**
18541861
* Read a file and yield its contents.
18551862
*
@@ -2898,27 +2905,27 @@ declare namespace Cypress {
28982905
}
28992906

29002907
type RetryStrategyWithModeSpecs = RetryStrategy & {
2901-
openMode: boolean; // defaults to false
2902-
runMode: boolean; // defaults to true
2908+
openMode: boolean // defaults to false
2909+
runMode: boolean // defaults to true
29032910
}
29042911

29052912
type RetryStrategy =
29062913
| RetryStrategyDetectFlakeAndPassOnThresholdType
29072914
| RetryStrategyDetectFlakeButAlwaysFailType
29082915

29092916
interface RetryStrategyDetectFlakeAndPassOnThresholdType {
2910-
experimentalStrategy: "detect-flake-and-pass-on-threshold"
2917+
experimentalStrategy: 'detect-flake-and-pass-on-threshold'
29112918
experimentalOptions?: {
2912-
maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2913-
passesRequired: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 and <= maxRetries
2919+
maxRetries: number // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2920+
passesRequired: number // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 and <= maxRetries
29142921
}
29152922
}
29162923

29172924
interface RetryStrategyDetectFlakeButAlwaysFailType {
2918-
experimentalStrategy: "detect-flake-but-always-fail"
2925+
experimentalStrategy: 'detect-flake-but-always-fail'
29192926
experimentalOptions?: {
2920-
maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2921-
stopIfAnyPassed: boolean; // defaults to false if experimentalOptions is not provided
2927+
maxRetries: number // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2928+
stopIfAnyPassed: boolean // defaults to false if experimentalOptions is not provided
29222929
}
29232930
}
29242931
interface ResolvedConfigOptions<ComponentDevServerOpts = any> {
@@ -3140,7 +3147,7 @@ declare namespace Cypress {
31403147
* @see https://on.cypress.io/experiments#Experimental-CSP-Allow-List
31413148
* @default false
31423149
*/
3143-
experimentalCspAllowList: boolean | experimentalCspAllowedDirectives[],
3150+
experimentalCspAllowList: boolean | experimentalCspAllowedDirectives[]
31443151
/**
31453152
* Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode.
31463153
* @default false
@@ -3272,6 +3279,11 @@ declare namespace Cypress {
32723279
* @default false
32733280
*/
32743281
experimentalOriginDependencies?: boolean
3282+
/**
3283+
* Enables support for `cy.prompt`, an AI-powered command that turns natural language steps into executable Cypress test code.
3284+
* @default false
3285+
*/
3286+
experimentalPromptCommand?: boolean
32753287
}
32763288

32773289
/**

guides/cy-prompt-development.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# `cy.prompt` Development
2+
3+
In production, the code used to facilitate the prompt command will be retrieved from the Cloud.
4+
5+
To run against locally developed `cy.prompt`:
6+
7+
- Clone the `cypress-services` repo
8+
- Run `yarn && yarn all`
9+
- Run `yarn watch` in `app/packages/cy-prompt`
10+
- Set:
11+
- `CYPRESS_INTERNAL_ENV=<environment>` (e.g. `staging` or `production` if you want to hit those deployments of `cypress-services` or `development` if you want to hit a locally running version of `cypress-services`)
12+
- `CYPRESS_LOCAL_CY_PROMPT_PATH` to the path to the `cypress-services/app/packages/cy-prompt/dist/development` directory
13+
14+
To run against a deployed version of `cy.prompt`:
15+
16+
- Set:
17+
- `CYPRESS_INTERNAL_ENV=<environment>` (e.g. `staging` or `production` if you want to hit those deployments of `cypress-services` or `development` if you want to hit a locally running version of `cypress-services`)
18+
19+
Regardless of running against local or deployed `cy.prompt`:
20+
21+
- Clone the `cypress` repo
22+
- Run `yarn`
23+
- Run `yarn cypress:open`
24+
- Log In to the Cloud via the App
25+
- Open a project that has `experimentalPromptCommand: true` set in the config of the `cypress.config.js|ts` file within `e2e`. Ensure the project has the feature flag `cy-prompt` enabled.
26+
27+
To run against a deployed version of `cy.prompt`:
28+
29+
- Set:
30+
- `CYPRESS_INTERNAL_ENV=<environment>` (e.g. `staging` or `production` if you want to hit those deployments of `cypress-services` or `development` if you want to hit a locally running version of `cypress-services`)
31+
32+
## Types
33+
34+
The prompt bundle provides the types for the `app`, `driver`, and `server` interfaces that are used within the Cypress code. To incorporate the types into the code base, run:
35+
36+
```sh
37+
yarn gulp downloadPromptTypes
38+
```
39+
40+
or to reference a local `cypress_services` repo:
41+
42+
```sh
43+
CYPRESS_LOCAL_CY_PROMPT_PATH=<path-to-cypress-services/app/cy-prompt/dist/development-directory> yarn gulp downloadPromptTypes
44+
```
45+
46+
## Testing
47+
48+
### Unit/Component Testing
49+
50+
The code that supports cloud `cy.prompt` and lives in the `cypress` monorepo is unit, integration, and e2e tested in a similar fashion to the rest of the code in the repo. See the [contributing guide](https://github.com/cypress-io/cypress/blob/ad353fcc0f7fdc51b8e624a2a1ef4e76ef9400a0/CONTRIBUTING.md?plain=1#L366) for more specifics.
51+
52+
The code that supports cloud `cy.prompt` and lives in the `cypress-services` monorepo has unit tests that live alongside the code in that monorepo.

packages/app/cypress/e2e/runner/event-manager.cy.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,21 @@ describe('event-manager', () => {
5050
cy.wrap(() => eventManager.reporterBus.listeners('runner:next').length).invoke('call').should('equal', 1)
5151
})
5252
})
53+
54+
it('should reset the prompt store', () => {
55+
loadSpec({
56+
filePath: 'hooks/basic.cy.js',
57+
passCount: 2,
58+
})
59+
60+
cy.window().then((win) => {
61+
const eventManager = win.getEventManager()
62+
63+
cy.spy(eventManager['promptStore'], 'resetState').as('resetState')
64+
})
65+
66+
cy.visitApp(`specs`)
67+
68+
cy.get('@resetState').should('have.been.calledOnce')
69+
})
5370
})
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<template>
2+
<div class="max-h-[700px] w-[912px] overflow-auto bg-gray-1000 rounded mx-auto ring-[#9095AD40] ring-4 relative">
3+
<div class="px-[24px] py-[12px] flex items-center justify-between border-b border-gray-900">
4+
<div class="flex items-center gap-2">
5+
<span class="text-white text-sm">cy.prompt</span>
6+
<div class="w-[32px] h-[1px] bg-gray-900" />
7+
<span class="text-gray-300 text-sm">Get code</span>
8+
</div>
9+
<IconActionDeleteLarge
10+
stroke-color="gray-400"
11+
class="cursor-pointer"
12+
data-cy="close-modal-button"
13+
@click="onClose"
14+
/>
15+
</div>
16+
<div
17+
class="flex flex-col items-center justify-center h-[272px] p-[24px] gap-[24px]"
18+
data-cy="error-message"
19+
>
20+
<IconTechnologyDashboardFail
21+
size="48"
22+
stroke-color="gray-500"
23+
fill-color="gray-900"
24+
/>
25+
<div class="flex flex-col gap-[4px] text-center">
26+
<span class="text-white">Something went wrong</span>
27+
<span class="text-gray-200 text-sm">
28+
There was a problem with loading the prompt code. Our team has been
29+
notified. If the problem persists, please try again later.
30+
</span>
31+
</div>
32+
</div>
33+
34+
<div class="px-[24px] py-[12px] mt-[12px] border-t border-gray-900 bg-gray-950">
35+
<Button
36+
data-cy="close-modal-button"
37+
@click="onClose"
38+
>
39+
Close
40+
</Button>
41+
</div>
42+
</div>
43+
</template>
44+
45+
<script setup lang="ts">
46+
import {
47+
IconActionDeleteLarge,
48+
IconTechnologyDashboardFail,
49+
} from '@cypress-design/vue-icon'
50+
import Button from '@cypress-design/vue-button'
51+
52+
defineProps<{
53+
onClose: () => void
54+
}>()
55+
</script>

0 commit comments

Comments
 (0)