You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,11 @@ _Released 5/6/2025 (PENDING)_
10
10
**Bugfixes:**
11
11
12
12
- Fixed an issue where the configuration setting `trashAssetsBeforeRuns=false` was ignored for assets in the `videosFolder`. These assets were incorrectly deleted before running tests with `cypress run`. Addresses [#8280](https://github.com/cypress-io/cypress/issues/8280).
13
+
- Fixed a potential hang condition when navigating to `about:blank`. Addressed in [#31634](https://github.com/cypress-io/cypress/pull/31634).
13
14
14
15
**Misc:**
15
16
17
+
- The Assertions menu when you right click in `experimentalStudio` tests now displays in dark mode. Addresses [#10621](https://github.com/cypress-io/cypress-services/issues/10621). Addressed in [#31598](https://github.com/cypress-io/cypress/pull/31598).
16
18
- The URL in the Cypress App no longer displays a white background when the URL is loading. Fixes [#31556](https://github.com/cypress-io/cypress/issues/31556).
In production, the code used to facilitate Studio functionality will be retrieved from the Cloud. While Studio is still in its early stages it is hidden behind an environment variable: `CYPRESS_ENABLE_CLOUD_STUDIO`. Set this environment variable to `true` if you want to run Cypress against the deployed version of studio code:
3
+
In production, the code used to facilitate Studio functionality will be retrieved from the Cloud. While Studio is still in its early stages it is hidden behind an environment variable: `CYPRESS_ENABLE_CLOUD_STUDIO` but can also be run against local cloud Studio code via the environment variable: `CYPRESS_LOCAL_STUDIO_PATH`.
If you want to run against locally developed Studio code:
5
+
To run against locally developed Studio:
10
6
11
7
- Clone the `cypress-services` repo (this requires that you be a member of the Cypress organization)
12
8
- Run `yarn`
13
-
- Run `yarn watch` in `app/studio`
14
-
- Set `CYPRESS_LOCAL_STUDIO_PATH` to the path to the `cypress-services/app/studio/dist/development` directory
9
+
- Run `yarn watch` in `app/packages/studio`
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_STUDIO_PATH` to the path to the `cypress-services/app/packages/studio/dist/development` directory
13
+
14
+
To run against a deployed version of studio:
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
+
-`CYPRESS_ENABLE_CLOUD_STUDIO=true`
19
+
20
+
Regardless of running against local or deployed studio:
21
+
15
22
- Clone the `cypress` repo
16
23
- Run `yarn`
17
24
- Run `yarn cypress:open`
18
-
19
-
Note: When using the `CYPRESS_LOCAL_STUDIO_PATH` environment variable, we bypass our error reporting and instead throw the exception immediately. The purpose of this is to try and surface issues immediately during local development.
25
+
- Log In to the Cloud via the App
26
+
- Ensure the project has been setup in the `Cypress (staging)` if in staging environment or `Cypress Internal Org` if in production environment and has a `projectId` that represents that. If developing against locally running `cypress-services`, ensure that the project has the feature `studio-ai` enabled for it.
27
+
- Open a project that has `experimentalStudio: true` set in the `e2e` config of the `cypress.config.js|ts` file.
28
+
- Click to 'Add Commands to Test' after hovering over a test command.
29
+
30
+
Note: When using the `CYPRESS_LOCAL_STUDIO_PATH` environment variable or when running the Cypress app via the locally cloned repository, we bypass our error reporting and instead log errors to the browser or node console.
20
31
21
32
## Types
22
33
@@ -31,3 +42,59 @@ or to reference a local `cypress_services` repo:
The code that supports cloud Studio and lives in the `cypress` monorepo is unit and component 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 Studio and lives in the `cypress-services` monorepo has unit and component tests that live alongside the code in that monorepo.
53
+
54
+
### Cypress in Cypress Testing
55
+
56
+
Several helpers are provided to facilitate testing cloud Studio using Cypress in Cypress tests. The [helper file](https://github.com/cypress-io/cypress/blob/ad353fcc0f7fdc51b8e624a2a1ef4e76ef9400a0/packages/app/cypress/e2e/studio/helper.ts) provides a method, `launchStudio` that:
57
+
58
+
1. Loads a project (by default [`experimental-studio`](https://github.com/cypress-io/cypress/tree/develop/system-tests/projects/experimental-studio)).
59
+
2. Navigates to the appropriate spec (by default `specName.cy.js`).
60
+
3. Enters Studio either by creating a new test or entering from an existing test via the `createNewTest` parameter
61
+
4. Waits for the test to finish executing again in Studio mode.
62
+
63
+
The above steps actually download the studio code from the cloud and use it for the test. Note that `experimental-studio` is set up to be a `canary` project so it will always get the latest and greatest of the cloud Studio code, whether or not it has been fully promoted to production. Note that this means that if you are writing Cypress in Cypress tests that depend on new functionality delivered from the cloud, the Cypress in Cypress tests cannot be merged until the code lands and is built in the cloud. Local development is still possible however by setting `process.env.CYPRESS_LOCAL_STUDIO_PATH` to your local studio path where we enable studio [here](https://github.com/cypress-io/cypress/blob/develop/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts#L424).
64
+
65
+
In order to properly engage with Studio AI, we choose to simulate the cloud interactions that enable it via something like:
66
+
67
+
```js
68
+
cy.mockNodeCloudRequest({
69
+
url:'/studio/testgen/n69px6/enabled',
70
+
method:'get',
71
+
body: { enabled:true },
72
+
})
73
+
```
74
+
75
+
To ensure that we get the same results from our Studio AI calls every time, we simulate them via something like:
The above two helpers actually mock out the Node requests so we still test the interface between the browser and node with these tests.
87
+
88
+
Also, since protocol does not work properly on the inner Cypress of Cypress in Cypress tests, we choose to create a dummy protocol which means we need to provide a simulated CDP full snapshot that will be sent to AI via something like:
0 commit comments