Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 15.2.1
## 15.3.0

_Released 9/23/2025 (PENDING)_

**Features:**

- Added Escape key support to [`cy.press()`](http://on.cypress.io/api/press). Addresses[#32429](https://github.com/cypress-io/cypress/issues/32429). Addressed in [#32545](https://github.com/cypress-io/cypress/pull/32545).

**Bugfixes:**

- In development mode, Electron `stderr` is piped directly to Cypress' `stderr` to make it clear why Electron failed to start, if it fails to start. Fixes [#32358](https://github.com/cypress-io/cypress/issues/32358). Addressed in [32468](https://github.com/cypress-io/cypress/pull/32468).
Expand Down
3 changes: 2 additions & 1 deletion cli/types/cypress-automation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ declare namespace Cypress {
'Tab' |
'Backspace' |
'Delete' |
'Insert'
'Insert' |
'Escape'

type SupportedKey = SupportedNamedKey | string | number
}
1 change: 1 addition & 0 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ declare namespace Cypress {
SPACE: 'Space',
DELETE: 'Delete',
INSERT: 'Insert',
ESC: 'Escape',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/actions/press.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('src/cy/commands/actions/press', () => {
cy.visit('/fixtures/input_events.html')
})

it('fires the click event on the button when the named key is sent', () => {
it('fires the click event on the button when the named key for Space is sent', () => {
cy.get('#button').focus()
cy.get('#button').should('be.focused')
cy.press(Cypress.Keyboard.Keys.SPACE)
Expand Down
1 change: 1 addition & 0 deletions packages/driver/src/cy/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@ const Keys: Record<string, Cypress.SupportedNamedKey> = {
SPACE: 'Space',
DELETE: 'Delete',
INSERT: 'Insert',
ESC: 'Escape',
}

export default {
Expand Down
3 changes: 3 additions & 0 deletions packages/server/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default [
...baseConfig,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
},
globals: {
...globals.node,
globalThis: 'readonly',
Expand Down
1 change: 1 addition & 0 deletions packages/server/lib/automation/commands/key_press.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const BidiOverrideCodepoints: Record<SupportedNamedKey, string> = {
'Delete': '\uE017',
'Insert': '\uE016',
'Space': '\uE00D',
'Escape': '\uE00C',
}

// any is fine to be used here because the key must be typeguarded before it can be used as a supported key
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/automation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const NamedKeys: SupportedNamedKey[] = [
SpaceKey,
'Delete',
'Insert',
'Escape',
]

// utility type to enable the SupportedKey union type
Expand Down
Loading