diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index b52ac1a333d..5231540f3f8 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,8 +1,12 @@ -## 14.1.1 +## 14.2.0 _Released 3/11/2025 (PENDING)_ +**Features:** + +- [`Cypress.stop()`](https://on.cypress.io/cypress-stop) is now available to stop the Cypress App on the current machine while tests are running. This can be useful for stopping test execution upon failures or other predefined conditions. Addresses [#518](https://github.com/cypress-io/cypress/issues/518). Addressed in [#31225](https://github.com/cypress-io/cypress/pull/31225). + **Misc:** - Additional CLI options will be displayed in the terminal for some Cloud error messages. Addressed in [#31211](https://github.com/cypress-io/cypress/pull/31211). diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 600867676ef..be3522fdbec 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -570,6 +570,14 @@ declare namespace Cypress { */ log(options: Partial): Log + /** + * Stop the Cypress App on the current machine while tests are running + * @see https://on.cypress.io/cypress-stop + * @example + * Cypress.stop() + */ + stop(): void + Commands: { /** * Add a custom command diff --git a/cli/types/tests/cypress-tests.ts b/cli/types/tests/cypress-tests.ts index d4a38fb6198..3e11d848a5f 100644 --- a/cli/types/tests/cypress-tests.ts +++ b/cli/types/tests/cypress-tests.ts @@ -55,6 +55,11 @@ namespace CypressEnvTests { }) } +namespace CypressStopTests { + Cypress.stop() // $ExpectType void + Cypress.stop('foo') // $ExpectError +} + namespace CypressIsCyTests { Cypress.isCy(cy) // $ExpectType boolean Cypress.isCy(undefined) // $ExpectType boolean diff --git a/packages/driver/types/internal-types.d.ts b/packages/driver/types/internal-types.d.ts index d89eef94340..c7205dd1f04 100644 --- a/packages/driver/types/internal-types.d.ts +++ b/packages/driver/types/internal-types.d.ts @@ -47,7 +47,6 @@ declare namespace Cypress { [routeId: string]: any } sinon: sinon.SinonApi - stop: () => void utils: CypressUtils state: State events: Events