Skip to content

Commit 63209ea

Browse files
authored
Merge branch 'release/15.0.0' into electron-36
2 parents d571121 + 49f64e7 commit 63209ea

File tree

42 files changed

+2346
-2259
lines changed

Some content is hidden

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

42 files changed

+2346
-2259
lines changed

.circleci/cache-version.txt

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

3-
5-21-2025
3+
6-9-2025

.circleci/workflows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mainBuildFilters: &mainBuildFilters
3838
- /^release\/\d+\.\d+\.\d+$/
3939
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
4040
- 'update-v8-snapshot-cache-on-develop'
41-
- 'electron-35'
41+
- 'electron-36'
4242

4343
# usually we don't build Mac app - it takes a long time
4444
# but sometimes we want to really confirm we are doing the right thing
@@ -49,7 +49,7 @@ macWorkflowFilters: &darwin-workflow-filters
4949
- equal: [ develop, << pipeline.git.branch >> ]
5050
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
5151
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
52-
- equal: [ 'electron-35', << pipeline.git.branch >> ]
52+
- equal: [ 'electron-36', << pipeline.git.branch >> ]
5353
- matches:
5454
pattern: /^release\/\d+\.\d+\.\d+$/
5555
value: << pipeline.git.branch >>
@@ -60,7 +60,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
6060
- equal: [ develop, << pipeline.git.branch >> ]
6161
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
6262
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
63-
- equal: [ 'electron-35', << pipeline.git.branch >> ]
63+
- equal: [ 'electron-36', << pipeline.git.branch >> ]
6464
- matches:
6565
pattern: /^release\/\d+\.\d+\.\d+$/
6666
value: << pipeline.git.branch >>
@@ -83,7 +83,7 @@ windowsWorkflowFilters: &windows-workflow-filters
8383
- equal: [ develop, << pipeline.git.branch >> ]
8484
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
8585
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
86-
- equal: [ 'electron-34', << pipeline.git.branch >> ]
86+
- equal: [ 'electron-36', << pipeline.git.branch >> ]
8787
- matches:
8888
pattern: /^release\/\d+\.\d+\.\d+$/
8989
value: << pipeline.git.branch >>
@@ -157,7 +157,7 @@ commands:
157157
name: Set environment variable to determine whether or not to persist artifacts
158158
command: |
159159
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
160-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "electron-35" ]]; then
160+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "electron-36" ]]; then
161161
export SHOULD_PERSIST_ARTIFACTS=true
162162
fi' >> "$BASH_ENV"
163163
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

cli/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ _Released 07/01/2025 (PENDING)_
1313
- The Cypress configuration wizard for Component Testing supports TypeScript 5.0 or greater. Addresses [#31187](https://github.com/cypress-io/cypress/issues/31187).
1414
- `@cypress/webpack-dev-server` and `@cypress/webpack-preprocessor` no longer support `webpack` version 4. Addresses [#31344](https://github.com/cypress-io/cypress/issues/31344). If you still need to use `webpack` version 4, please see our [migration guide](https://docs.cypress.io/app/references/migration-guide#Migrating-to-Cypress-150).
1515
- `@cypress/webpack-dev-server` no longer supports `webpack-dev-server` version 4. Addresses [#31605](https://github.com/cypress-io/cypress/issues/31605). If you still need to use `webpack-dev-server` version 4, please see our [migration guide](https://docs.cypress.io/app/references/migration-guide#Migrating-to-Cypress-150).
16-
- The `@cypress/webpack-batteries-included-preprocessor` no longer includes browser built-ins that were automatically provided by Webpack 4. To add built-ins manually, refer to the Webpack [resolve.fallback](https://webpack.js.org/configuration/resolve/#resolvefallback) documentation and the [`@cypress/webpack-batteries-included-preprocessor` README](../npm/webpack-batteries-included-preprocessor/README.md). Addresses [#31039](https://github.com/cypress-io/cypress/issues/31039).
16+
- In order to better align with best practices, `@cypress/webpack-batteries-included-preprocessor` no longer includes certain browser built-ins that were automatically provided by Webpack 4. The removed built-ins are `assert`, `constants`, `crypto`, `domain`, `events`, `http`, `https`, `punycode`, `querystring`, `string_decoder`, `sys`, `timers`, `tty`, `url`, `util`, `vm`, and `zlib`. However, we know that certain built-ins are popular, given that many users have files that are shared between their Cypress tests and node context. Because of this, `@cypress/webpack-batteries-included-preprocessor` will ship with built-in support for `buffer`, `path`, `process`, `os`, and `stream`. If there is a built-in that isn't supported be default and you need to add support, please refer to the Webpack [resolve.fallback](https://webpack.js.org/configuration/resolve/#resolvefallback) documentation and the [`@cypress/webpack-batteries-included-preprocessor` README](../npm/webpack-batteries-included-preprocessor/README.md). Addresses [#31039](https://github.com/cypress-io/cypress/issues/31039).
1717
- The application under test's `pagehide` event in Chromium browsers will no longer trigger Cypress's `window:unload` event. Addressed in [#31853](https://github.com/cypress-io/cypress/pull/31853).
1818

1919
**Features:**
2020

2121
- [`tsx`](https://tsx.is/) is now used in all cases to run the Cypress config, replacing [ts-node](https://github.com/TypeStrong/ts-node) for TypeScript and Node for commonjs/ESM. This should allow for more interoperability for users who are using any variant of ES Modules. Addresses [#8090](https://github.com/cypress-io/cypress/issues/8090), [#15724](https://github.com/cypress-io/cypress/issues/15724), [#21805](https://github.com/cypress-io/cypress/issues/21805), [#22273](https://github.com/cypress-io/cypress/issues/22273), [#22747](https://github.com/cypress-io/cypress/issues/22747), [#23141](https://github.com/cypress-io/cypress/issues/23141), [#25958](https://github.com/cypress-io/cypress/issues/25958), [#25959](https://github.com/cypress-io/cypress/issues/25959), [#26606](https://github.com/cypress-io/cypress/issues/26606), [#27359](https://github.com/cypress-io/cypress/issues/27359), [#27450](https://github.com/cypress-io/cypress/issues/27450), [#28442](https://github.com/cypress-io/cypress/issues/28442), [#30318](https://github.com/cypress-io/cypress/issues/30318), [#30718](https://github.com/cypress-io/cypress/issues/30718), [#30907](https://github.com/cypress-io/cypress/issues/30907), [#30915](https://github.com/cypress-io/cypress/issues/30915), [#30925](https://github.com/cypress-io/cypress/issues/30925), [#30954](https://github.com/cypress-io/cypress/issues/30954) and [#31185](https://github.com/cypress-io/cypress/issues/31185).
22+
- [`cy.url()`](https://docs.cypress.io/api/commands/url), [`cy.hash()`](https://docs.cypress.io/api/commands/hash), [`cy.go()`](https://docs.cypress.io/api/commands/go), [`cy.reload()`](https://docs.cypress.io/api/commands/reload), [`cy.title()`](https://docs.cypress.io/api/commands/title), and [`cy.location()`](https://docs.cypress.io/api/commands/location) now use the automation client (CDP for Chromium browsers and WebDriver BiDi for Firefox) to return the appropriate values from the commands to the user instead of the window object. This is to avoid cross origin issues with [`cy.origin()`](https://docs.cypress.io/api/commands/origin) so these commands can be invoked anywhere inside a Cypress test without having to worry about origin access issues. Experimental Webkit still will use the window object to retrieve these values. Also, [`cy.window()`](https://docs.cypress.io/api/commands/window) will always return the current window object, regardless of origin restrictions. Not every property from the window object will be accessible depending on the origin context. Addresses [#31196](https://github.com/cypress-io/cypress/issues/31196).
2223

2324
**Misc:**
2425

npm/webpack-batteries-included-preprocessor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = (on) => {
4444
}
4545
```
4646

47-
As of version `4.x.x`, `@cypress/webpack-batteries-included-preprocessor` no longer includes Webpack built-ins by default. If your project requires them, you can retrieve the preprocessor's default Webpack options and decorate them as needed.
47+
As of version `4.x.x`, `@cypress/webpack-batteries-included-preprocessor` only includes the `buffer`, `path`, `process`, `os`, and `stream` built-ins. If your project requires built-ins not provided, you can retrieve the preprocessor's default Webpack options and decorate them as needed.
4848

4949
```javascript
5050
const webpackPreprocessor = require('@cypress/webpack-batteries-included-preprocessor')
@@ -53,7 +53,7 @@ function getWebpackOptions () {
5353
const options = webpackPreprocessor.getFullWebpackOptions()
5454

5555
// add built-ins as needed
56-
options.resolve.fallback.path = require.resolve('path-browserify')
56+
options.resolve.fallback.zlib = require.resolve('browserify-zlib')
5757

5858
return options
5959
}

npm/webpack-batteries-included-preprocessor/index.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path')
22
const Debug = require('debug')
33
const getTsConfig = require('get-tsconfig')
4+
const webpack = require('webpack')
45
const webpackPreprocessor = require('@cypress/webpack-preprocessor')
56
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
67

@@ -135,6 +136,24 @@ const getDefaultWebpackOptions = () => {
135136
}],
136137
},
137138
plugins: [
139+
new webpack.ProvidePlugin({
140+
Buffer: ['buffer', 'Buffer'],
141+
// As of Webpack 5, a new option called resolve.fullySpecified, was added.
142+
// This option means that a full path, in particular to .mjs / .js files
143+
// in ESM packages must have the full path of an import specified.
144+
// Otherwise, compilation fails as this option defaults to true.
145+
// This means we need to adjust our global injections to always
146+
// resolve to include the full file extension if a file resolution is provided.
147+
// @see https://github.com/cypress-io/cypress/issues/27599
148+
// @see https://webpack.js.org/configuration/module/#resolvefullyspecified
149+
150+
// Due to Pnp compatibility issues, we want to make sure that we resolve to the 'process' library installed with the binary,
151+
// which should resolve on leaf app/packages/server/node_modules/@cypress/webpack-batteries-included-preprocessor and up the tree.
152+
// In other words, we want to resolve 'process' that is installed with cypress (or the package itself, i.e. @cypress/webpack-batteries-included-preprocessor)
153+
// and not in the user's node_modules directory as it may not exist.
154+
// @see https://github.com/cypress-io/cypress/issues/27947.
155+
process: require.resolve('process/browser.js'),
156+
}),
138157
// If the user is trying to debug their bundle, we'll add the BundleAnalyzerPlugin
139158
// to see the size of the support file (first bundle when running `cypress open`)
140159
// and spec files (subsequent bundles when running `cypress open`)
@@ -144,7 +163,7 @@ const getDefaultWebpackOptions = () => {
144163
extensions: ['.js', '.json', '.jsx', '.mjs', '.coffee'],
145164
fallback: {
146165
assert: false,
147-
buffer: false,
166+
buffer: require.resolve('buffer/'),
148167
child_process: false,
149168
cluster: false,
150169
console: false,
@@ -161,15 +180,15 @@ const getDefaultWebpackOptions = () => {
161180
inspector: false,
162181
module: false,
163182
net: false,
164-
os: false,
165-
path: false,
183+
os: require.resolve('os-browserify/browser'),
184+
path: require.resolve('path-browserify'),
166185
perf_hooks: false,
167186
punycode: false,
168-
process: false,
187+
process: require.resolve('process/browser.js'),
169188
querystring: false,
170189
readline: false,
171190
repl: false,
172-
stream: false,
191+
stream: require.resolve('stream-browserify'),
173192
string_decoder: false,
174193
sys: false,
175194
timers: false,

npm/webpack-batteries-included-preprocessor/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
"@babel/runtime": "^7.25.0",
1818
"babel-loader": "^10.0.0",
1919
"babel-plugin-add-module-exports": "^1.0.2",
20+
"buffer": "^6.0.3",
2021
"coffee-loader": "^4.0.0",
2122
"coffeescript": "2.6.0",
2223
"debug": "^4.3.4",
2324
"get-tsconfig": "^4.10.0",
25+
"os-browserify": "^0.3.0",
26+
"path-browserify": "^1.0.1",
27+
"process": "^0.11.10",
28+
"stream-browserify": "^3.0.0",
2429
"ts-loader": "9.5.2",
2530
"tsconfig-paths-webpack-plugin": "^3.5.2",
2631
"webpack": "^5.88.2",

npm/webpack-batteries-included-preprocessor/test/unit/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ describe('webpack-batteries-included-preprocessor', () => {
4040
preprocessor = require('../../index')
4141
const result = preprocessor.getFullWebpackOptions('file/path', 'typescript/path')
4242

43-
expect(result.plugins).to.have.length(1)
44-
expect(result.plugins[0].constructor.name).to.equal('BundleAnalyzerPlugin')
43+
expect(result.plugins).to.have.length(2)
44+
expect(result.plugins[1].constructor.name).to.equal('BundleAnalyzerPlugin')
4545
Debug.disable()
4646
})
4747
})

packages/driver/cypress/e2e/commands/location.cy.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ describe('src/cy/commands/location', () => {
2323
cy.url().should('match', /baz/).and('eq', 'http://localhost:3500/foo/bar/baz.html')
2424
})
2525

26-
it('catches thrown errors', () => {
27-
cy.stub(Cypress.utils, 'locToString')
28-
.onFirstCall().throws(new Error)
29-
.onSecondCall().returns('http://localhost:3500/baz.html')
26+
it('propagates thrown errors from CDP', (done) => {
27+
cy.on('fail', (err) => {
28+
expect(err.message).to.include('CDP was unable to find the AUT iframe')
29+
done()
30+
})
31+
32+
cy.stub(Cypress, 'automation').withArgs('get:aut:url').rejects(new Error('CDP was unable to find the AUT iframe'))
3033

31-
cy.url().should('include', '/baz.html')
34+
cy.url()
3235
})
3336

3437
// https://github.com/cypress-io/cypress/issues/17399
@@ -380,7 +383,16 @@ describe('src/cy/commands/location', () => {
380383
context('#location', () => {
381384
it('returns the location object', () => {
382385
cy.location().then((loc) => {
383-
expect(loc).to.have.keys(['auth', 'authObj', 'hash', 'href', 'host', 'hostname', 'pathname', 'port', 'protocol', 'search', 'origin', 'superDomainOrigin', 'superDomain', 'toString'])
386+
expect(loc).to.have.property('hash')
387+
expect(loc).to.have.property('host')
388+
expect(loc).to.have.property('hostname')
389+
expect(loc).to.have.property('href')
390+
expect(loc).to.have.property('origin')
391+
expect(loc).to.have.property('pathname')
392+
expect(loc).to.have.property('port')
393+
expect(loc).to.have.property('protocol')
394+
expect(loc).to.have.property('search')
395+
expect(loc).to.have.property('searchParams')
384396
})
385397
})
386398

@@ -402,15 +414,13 @@ describe('src/cy/commands/location', () => {
402414

403415
// https://github.com/cypress-io/cypress/issues/16463
404416
it('eventually returns a given key', function () {
405-
cy.stub(cy, 'getRemoteLocation')
406-
.onFirstCall().returns('')
407-
.onSecondCall().returns({
408-
pathname: '/my/path',
409-
})
417+
cy.stub(Cypress, 'automation').withArgs('get:aut:url')
418+
.onFirstCall().resolves('http://localhost:3500')
419+
.onSecondCall().resolves('http://localhost:3500/my/path')
410420

411421
cy.location('pathname').should('equal', '/my/path')
412422
.then(() => {
413-
expect(cy.getRemoteLocation).to.have.been.calledTwice
423+
expect(Cypress.automation).to.have.been.calledTwice
414424
})
415425
})
416426

@@ -614,7 +624,8 @@ describe('src/cy/commands/location', () => {
614624
expect(_.keys(consoleProps)).to.deep.eq(['name', 'type', 'props'])
615625
expect(consoleProps.name).to.eq('location')
616626
expect(consoleProps.type).to.eq('command')
617-
expect(_.keys(consoleProps.props.Yielded)).to.deep.eq(['auth', 'authObj', 'hash', 'href', 'host', 'hostname', 'origin', 'pathname', 'port', 'protocol', 'search', 'superDomainOrigin', 'superDomain', 'toString'])
627+
628+
expect(_.keys(consoleProps.props.Yielded)).to.deep.eq(['hash', 'host', 'hostname', 'href', 'origin', 'pathname', 'port', 'protocol', 'search', 'searchParams'])
618629
})
619630
})
620631
})

packages/driver/cypress/e2e/commands/navigation.cy.js

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,23 @@ describe('src/cy/commands/navigation', () => {
1111
})
1212

1313
it('calls into window.location.reload', () => {
14-
const locReload = cy.spy(Cypress.utils, 'locReload')
15-
16-
cy.reload().then(() => {
17-
expect(locReload).to.be.calledWith(false)
14+
cy.on('fail', () => {
15+
expect(Cypress.automation).to.be.calledWith('reload:aut:frame', { forceReload: false })
1816
})
19-
})
2017

21-
it('can pass forceReload', () => {
22-
const locReload = cy.spy(Cypress.utils, 'locReload')
18+
cy.stub(Cypress, 'automation').withArgs('reload:aut:frame', { forceReload: false }).resolves()
2319

24-
cy.reload(true).then(() => {
25-
expect(locReload).to.be.calledWith(true)
26-
})
20+
cy.reload({ timeout: 1000 })
2721
})
2822

2923
it('can pass forceReload + options', () => {
30-
const locReload = cy.spy(Cypress.utils, 'locReload')
31-
32-
cy.reload(true, {}).then(() => {
33-
expect(locReload).to.be.calledWith(true)
24+
cy.on('fail', () => {
25+
expect(Cypress.automation).to.be.calledWith('reload:aut:frame', { forceReload: true })
3426
})
35-
})
3627

37-
it('can pass just options', () => {
38-
const locReload = cy.spy(Cypress.utils, 'locReload')
28+
cy.stub(Cypress, 'automation').withArgs('reload:aut:frame', { forceReload: true }).resolves()
3929

40-
cy.reload({}).then(() => {
41-
expect(locReload).to.be.calledWith(false)
42-
})
30+
cy.reload(true, { timeout: 1000 })
4331
})
4432

4533
it('returns the window object', () => {
@@ -596,14 +584,15 @@ describe('src/cy/commands/navigation', () => {
596584
const { lastLog } = this
597585

598586
beforeunload = true
599-
expect(lastLog.get('snapshots').length).to.eq(1)
587+
expect(lastLog.get('snapshots').length).to.eq(2)
600588
expect(lastLog.get('snapshots')[0].name).to.eq('before')
601589
expect(lastLog.get('snapshots')[0].body).to.be.an('object')
602590

603591
return undefined
604592
})
605593

606-
cy.go('back').then(function () {
594+
// wait for the beforeunload event to be fired after the history navigation
595+
cy.go('back').wait(100).then(function () {
607596
const { lastLog } = this
608597

609598
expect(beforeunload).to.be.true

0 commit comments

Comments
 (0)