Skip to content

Commit 727239d

Browse files
authored
Merge branch 'develop' into issue-30198
2 parents 552b335 + b07ea0e commit 727239d

File tree

12 files changed

+29
-22
lines changed

12 files changed

+29
-22
lines changed

cli/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ _Released 5/20/2025 (PENDING)_
99

1010
**Bugfixes:**
1111

12-
- Fixed an issue with the experimental usage of WebKit where Cypress incorrectly displayed `0` as the WebKit version. Addresses [#31684](https://github.com/cypress-io/cypress/issues/31684).
1312
- Fixed an issue where framebusting was occurring when `top.window.location` was being set explicitly. This fix does not require the `experimentalModifyObstructiveThirdPartyCode` configuration option. Addresses [#31687](https://github.com/cypress-io/cypress/issues/31687).
13+
- `cy.press()` now has a return type of `Chainable<null>` instead of `void` to match the convention of other commands that yield `null`. Addressed in [#31698](https://github.com/cypress-io/cypress/pull/31698).
14+
- Fixed an issue with the experimental usage of WebKit where Cypress incorrectly displayed `0` as the WebKit version. Addresses [#31684](https://github.com/cypress-io/cypress/issues/31684).
1415

1516
**Misc:**
1617

cli/types/cypress.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ declare namespace Cypress {
17551755
* cy.press(Cypress.Keyboard.Keys.TAB) // dispatches a keydown and press event to the browser, followed by a keyup event.
17561756
* @see https://on.cypress.io/press
17571757
*/
1758-
press(key: typeof Cypress.Keyboard.Keys[keyof typeof Cypress.Keyboard.Keys], options?: Partial<Loggable & Timeoutable>): void
1758+
press(key: typeof Cypress.Keyboard.Keys[keyof typeof Cypress.Keyboard.Keys], options?: Partial<Loggable & Timeoutable>): Chainable<null>
17591759

17601760
/**
17611761
* Get the immediately preceding sibling of each element in a set of the elements.

npm/puppeteer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Before using `@cypress/puppeteer`, ensure the following requirements are met:
4646

4747
- Cypress 13.6.0+ is required.
4848
- Only Chromium-based browsers are supported, such as Chrome for Testing, Chromium, and Electron.
49-
- Chrome-branded browsers (e.g., standard Chrome) are not supported in version 137+ due to Chrome's removal of the `--load-extension` flag. We recommend using Chrome for Testing or Chromium instead. [See download instructions](https://www.chromium.org/getting-involved/download-chromium/).
49+
- Chrome-branded browsers (e.g., standard Chrome) are not supported in version 137+ due to Chrome's removal of the `--load-extension` flag. We recommend using Chrome for Testing or Chromium instead. See Cypress Docker image examples for [Chrome for Testing](https://github.com/cypress-io/cypress-docker-images/tree/master/examples/chrome-for-testing) and [Chromium](https://github.com/cypress-io/cypress-docker-images/tree/master/examples/chromium).
5050

5151
## Usage
5252

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
"**/ua-parser-js": "0.7.33",
279279
"@types/react": "18.3.12",
280280
"browserify-sign": "4.2.2",
281-
"devtools-protocol": "0.0.1413303",
281+
"devtools-protocol": "0.0.1459876",
282282
"sharp": "0.29.3",
283283
"vue-template-compiler": "2.6.12"
284284
},

packages/driver/src/cy/commands/actions/press.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function (Commands: Cypress.Commands, Cypress: Cypress.Cypress, c
3636

3737
// throwErrByPath always throws, but there's no way to indicate that
3838
// code beyond this point is unreachable to typescript / linters
39-
return
39+
return null
4040
}
4141

4242
if (Cypress.browser.family === 'webkit') {
@@ -47,7 +47,7 @@ export default function (Commands: Cypress.Commands, Cypress: Cypress.Cypress, c
4747
},
4848
})
4949

50-
return
50+
return null
5151
}
5252

5353
if (Cypress.browser.name === 'firefox' && Number(Cypress.browser.majorVersion) < 135) {
@@ -71,7 +71,11 @@ export default function (Commands: Cypress.Commands, Cypress: Cypress.Cypress, c
7171
} catch (err) {
7272
$errUtils.throwErr(err, { onFail: log })
7373
}
74+
75+
return null
7476
}
7577

76-
return Commands.add('press', pressCommand)
78+
return Commands.addAll({
79+
press: pressCommand,
80+
})
7781
}

packages/driver/test/unit/cy/commands/actions/press.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ describe('cy/commands/actions/press', () => {
5151
},
5252
}
5353

54-
// @ts-expect-error - this is a generic mock impl
5554
Commands = {
56-
add: vi.fn(),
55+
// @ts-expect-error - this is a generic mock impl
56+
addAll: vi.fn(),
5757
}
5858

5959
// @ts-expect-error
@@ -84,14 +84,14 @@ describe('cy/commands/actions/press', () => {
8484

8585
addCommand(Commands, Cypress, cy, state, config)
8686

87-
expect(Commands.add).toHaveBeenCalledOnce()
87+
expect(Commands.addAll).toHaveBeenCalledOnce()
8888

8989
// @ts-expect-error
90-
const [[cmdName, cmd]]: [[string, PressCommand]] = Commands.add.mock.calls
90+
const [[obj]]: [[{press: PressCommand}]] = Commands.addAll.mock.calls
9191

92-
expect(cmdName).toEqual('press')
92+
expect(typeof obj.press).toBe('function')
9393

94-
press = cmd as PressCommand
94+
press = obj.press as PressCommand
9595
})
9696

9797
describe('with a valid key', () => {

packages/proxy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@packages/types": "0.0.0-development",
4545
"@types/express": "4.17.2",
4646
"@types/supertest": "2.0.10",
47-
"devtools-protocol": "0.0.1413303",
47+
"devtools-protocol": "0.0.1459876",
4848
"express": "4.21.0",
4949
"supertest": "6.0.1",
5050
"typescript": "~5.4.5"

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"chai-uuid": "1.0.6",
182182
"chrome-har-capturer": "0.13.4",
183183
"cross-env": "6.0.3",
184-
"devtools-protocol": "0.0.1413303",
184+
"devtools-protocol": "0.0.1459876",
185185
"eol": "0.9.1",
186186
"esbuild": "^0.15.3",
187187
"eventsource": "2.0.2",

packages/socket/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@types/uuid": "8.3.2",
3333
"chai": "3.5.0",
3434
"cross-env": "6.0.3",
35-
"devtools-protocol": "0.0.1413303",
35+
"devtools-protocol": "0.0.1459876",
3636
"mocha": "3.5.3",
3737
"resolve-pkg": "2.0.0"
3838
},

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/node": "20.16.0",
1818
"axios": "^1.8.3",
1919
"better-sqlite3": "11.5.0",
20-
"devtools-protocol": "0.0.1413303",
20+
"devtools-protocol": "0.0.1459876",
2121
"express": "4.21.0",
2222
"socket.io": "4.0.1",
2323
"typescript": "~5.4.5"
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
describe('this one should pass', () => {
22
it('dispatches a key press', () => {
3-
cy.press(Cypress.Keyboard.Keys.TAB)
3+
cy.press(Cypress.Keyboard.Keys.TAB).then((val) => {
4+
expect(val).to.be.null
5+
})
46
})
57
})

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14397,10 +14397,10 @@ detective@^5.0.2:
1439714397
defined "^1.0.0"
1439814398
minimist "^1.1.1"
1439914399

14400-
devtools-protocol@0.0.1159816, devtools-protocol@0.0.1413303, devtools-protocol@0.0.927104:
14401-
version "0.0.1413303"
14402-
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1413303.tgz#72a194e7474a17cd75f8c1d2627db0563e2f719e"
14403-
integrity sha512-AjVpl/7DdE1gf40ydrVpBdGYprq/seOLgN46p+rYyJ/lfhrI6e4zvX0HWSr3cIvj16Ks9kwEdmvmwlyKcELBBw==
14400+
devtools-protocol@0.0.1159816, devtools-protocol@0.0.1459876, devtools-protocol@0.0.927104:
14401+
version "0.0.1459876"
14402+
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1459876.tgz#07f69c1921ae89624f65ddd311d2214e8cb35e1e"
14403+
integrity sha512-9Dng0X6IdYO8CxlNlOYW+Jc8deGZdOQOL4Sy2UbA+XiCy1Xxi7QtP5CWZKEYv4EEfp7hxp7LhF6RQWfUXK1+/w==
1440414404

1440514405
dicer@0.2.5:
1440614406
version "0.2.5"

0 commit comments

Comments
 (0)