Skip to content

Commit c7539c5

Browse files
Merge branch 'develop' into ryanm/fix/issue-with-sourcemaps
2 parents 859e6e7 + 52a5527 commit c7539c5

File tree

173 files changed

+4535
-3716
lines changed

Some content is hidden

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

173 files changed

+4535
-3716
lines changed

.circleci/src/pipeline/@pipeline.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ commands:
118118
name: Set environment variable to determine whether or not to persist artifacts
119119
command: |
120120
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
121-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/fix/rename-exclude-from-ai" ]]; then
121+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/fix_builds" ]]; then
122122
export SHOULD_PERSIST_ARTIFACTS=true
123123
fi' >> "$BASH_ENV"
124124
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
@@ -1473,7 +1473,6 @@ jobs:
14731473
default: false
14741474
resource_class: << parameters.resource_class >>
14751475
steps:
1476-
- update_known_hosts
14771476
- checkout
14781477
- install-required-node
14791478
- verify-build-setup:
@@ -1785,7 +1784,7 @@ jobs:
17851784
source ./scripts/ensure-node.sh
17861785
yarn lerna run types
17871786
- sanitize-verify-and-store-mocha-results:
1788-
expectedResultCount: 6
1787+
expectedResultCount: 3
17891788

17901789
verify-release-readiness:
17911790
<<: *defaults

cli/CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
2-
## 15.5.1
2+
## 15.6.0
33

44
_Released 10/20/2025 (PENDING)_
55

6+
**Features:**
7+
8+
- `cy.prompt()` will now show a warning in the `Get code` modal when there are unsaved changes in `Studio` that will be lost if the user saves the generated code. Addressed in [#32741](https://github.com/cypress-io/cypress/pull/32741).
9+
610
**Bugfixes:**
711

8-
- Fixes an issue where grouped command text jumps up and down when expanding and collapsing in the command log. Addressed in [#32757](https://github.com/cypress-io/cypress/pull/32757).
12+
- Fixed an issue where grouped command text jumps up and down when expanding and collapsing in the command log. Addressed in [#32757](https://github.com/cypress-io/cypress/pull/32757).
13+
- Fixed an issue where command snapshots were not correctly displayed in Studio. Addressed in [#32808](https://github.com/cypress-io/cypress/pull/32808).
14+
- Fixed an issue with grouped console prop items having a hard to read blue color in the console log and duplicate `:` characters being displayed. Addressed in [#32776](https://github.com/cypress-io/cypress/pull/32776).
15+
- Added more context to the error message shown when `cy.prompt()` fails to download. Addressed in [#32822](https://github.com/cypress-io/cypress/pull/32822).
16+
17+
**Misc:**
18+
19+
- Add top padding for command log labels. Addressed in [#32774](https://github.com/cypress-io/cypress/pull/32774).
20+
- The hitbox for expanding a grouped command has been widened. Addresses [#32778](https://github.com/cypress-io/cypress/issues/32778). Addressed in [#32783](https://github.com/cypress-io/cypress/pull/32783).
21+
- Have cursor on hover of the AUT URL to show as pointer. Addresses [#32777](https://github.com/cypress-io/cypress/issues/32777). Addressed in [#32782](https://github.com/cypress-io/cypress/pull/32782).
22+
23+
**Dependency Updates:**
24+
25+
- Upgraded `better-sqlite3` from `11.10.0` to `12.4.1`. Addressed in [#32755](https://github.com/cypress-io/cypress/pull/32755).
926

1027
## 15.5.0
1128

guides/esm-migration.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
#### Notes
1414

15-
When migrating some of these projects away from the `ts-node` entry [see `@packages/scaffold-config` example](https://github.com/cypress-io/cypress/blob/v15.2.0/packages/scaffold-config/index.js), it is somewhat difficult to make separate browser/node entries as the v8-snapshot [tsconfig.json](https://github.com/cypress-io/cypress/blob/v15.2.0/tooling/v8-snapshot/tsconfig.json) is using an older style of module resolution where the `exports` key inside a package's `package.json` is not well supported. Because of this, we need to find ways to bundle code that is needed internally in the browser vs in node without them being a part of the same bundle. This is a temporary work around until we are able to get every package being able to build as an ES Module, which as that point we can re assess how the Cypress binary is being built as well as v8-snapshots, and will allow us to reconfigure this packages to export content in a more proper fashion.
15+
When migrating some of these projects away from the `ts-node` entry [see `@packages/scaffold-config` example](https://github.com/cypress-io/cypress/blob/v15.2.0/packages/scaffold-config/index.js), it is somewhat difficult to make separate browser/node entries as the v8-snapshot [tsconfig.json](https://github.com/cypress-io/cypress/blob/v15.2.0/tooling/v8-snapshot/tsconfig.json) is using an older style of module resolution where the `exports` key inside a package's `package.json` is not well supported. Because of this, we need to find ways to bundle code that is needed internally in the browser vs in node without them being a part of the same bundle. This is a temporary work around until we are able to get every package being able to build as an ES Module, which as that point we can re assess how the Cypress binary is being built as well as v8-snapshots, and will allow us to reconfigure this packages to export content in a more proper fashion. We are currently doing something similar in the following packages:
16+
17+
* `@packages/scaffold-config`
18+
* `@packages/socket`
19+
* `@packages/telemetry`
1620

1721
#### Status
1822

@@ -44,7 +48,7 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
4448
- [x] packages/error ✅ **COMPLETED**
4549
- [x] packages/eslint-config ✅ **COMPLETED**
4650
- [ ] packages/example
47-
- [ ] packages/extension
51+
- [x] packages/extension**COMPLETED**
4852
- [ ] packages/frontend-shared **PARTIAL** - entry point is JS
4953
- [x] packages/electron ✅ **COMPLETED**
5054
- [x] packages/https-proxy - ✅ **COMPLETED**
@@ -63,7 +67,7 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
6367
- [x] packages/runner ✅ **COMPLETED**
6468
- [x] packages/scaffold-config ✅ **COMPLETED**
6569
- [ ] packages/server **PARTIAL** - many source/test files in JS. highest priority
66-
- [ ] packages/socket **PARTIAL** - entry point is JS. Tests are JS
70+
- [x] packages/socket **COMPLETED**
6771
- [x] packages/stderr-filtering ✅ **COMPLETED**
6872
- [x] packages/telemetry ✅ **COMPLETED**
6973
- [ ] packages/ts **PARTIAL** - ultimate goal is removal and likely not worth the effort to convert
@@ -82,7 +86,7 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
8286
- [x] npm/cypress-schematic ✅ **COMPLETED**
8387
- [ ] npm/eslint-plugin-dev
8488
- [x] npm/grep ✅ **COMPLETED**
85-
- [ ] npm/puppeteer
89+
- [x] npm/puppeteer**COMPLETED**
8690
- [x] npm/vite-dev-server ✅ **COMPLETED**
8791
- [ ] npm/webpack-batteries-included-preprocessor
8892
- [ ] npm/webpack-dev-server
@@ -95,16 +99,16 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
9599
- [x] packages/driver ✅ **COMPLETED**
96100
- [x] packages/electron ✅ **COMPLETED**
97101
- [x] packages/error ✅ **COMPLETED**
98-
- [ ] packages/extension
102+
- [x] packages/extension**COMPLETED**
99103
- [x] packages/https-proxy ✅ **COMPLETED**
100104
- [x] packages/electron ✅ **COMPLETED**
101105
- [x] packages/icons ✅ **COMPLETED**
102106
- [x] packages/launcher ✅ **COMPLETED**
103107
- [x] packages/net-stubbing ✅ **COMPLETED**
104108
- [x] packages/network ✅ **COMPLETED**
105109
- [x] packages/network-tools ✅ **COMPLETED**
106-
- [ ] packages/packherd-require
107-
- [ ] packages/proxy
110+
- [x] packages/packherd-require**COMPLETED**
111+
- [x] packages/proxy**COMPLETED**
108112
- [x] packages/rewriter ✅ **COMPLETED**
109113
- [x] packages/scaffold-config ✅ **COMPLETED**
110114
- [ ] packages/server

npm/puppeteer/.mocharc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

npm/puppeteer/eslint.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { baseConfig } from '@packages/eslint-config'
22

3-
const allowDefaultProject = ['cypress.config.ts', 'eslint.config.ts', 'support/index.js']
3+
const allowDefaultProject = ['cypress.config.ts', 'eslint.config.ts', 'support/index.js', 'vitest.config.ts']
44

55
export default [
66
...baseConfig,
77
{
88
languageOptions: {
99
parserOptions: {
10+
tsconfigRootDir: __dirname,
1011
projectService: {
1112
allowDefaultProject,
1213
},

npm/puppeteer/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"cypress:run": "node ../../scripts/cypress.js run --browser chrome",
1313
"lint": "eslint",
1414
"semantic-release": "semantic-release",
15-
"test": "mocha test/unit/*.spec.ts",
16-
"test-watch": "yarn test & chokidar '**/*.ts' 'test/unit/*.ts' -c 'yarn test'",
15+
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0 --hook-timeout=0",
16+
"test": "vitest run",
17+
"test-watch": "vitest --watch",
1718
"watch": "rimraf dist && tsc --watch"
1819
},
1920
"dependencies": {
@@ -23,17 +24,13 @@
2324
"devDependencies": {
2425
"@packages/eslint-config": "0.0.0-development",
2526
"@types/node": "^22.18.7",
26-
"chai-as-promised": "^7.1.1",
2727
"chokidar": "^3.5.3",
2828
"eslint": "^9.31.0",
2929
"express": "4.21.0",
30-
"mocha": "^9.2.2",
3130
"rimraf": "^6.0.1",
3231
"semantic-release": "22.0.12",
33-
"sinon": "^13.0.1",
34-
"sinon-chai": "^3.7.0",
35-
"ts-node": "^10.9.2",
36-
"typescript": "5.4.5"
32+
"typescript": "5.4.5",
33+
"vitest": "^3.2.4"
3734
},
3835
"peerDependencies": {
3936
"cypress": ">=13.6.0"

npm/puppeteer/test/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"compilerOptions": {
33
"allowJs": true,
44
"noEmit": true,
5-
"types": ["mocha"]
65
},
76
"include": ["**/*.ts"],
87
}
Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
import { expect, use } from 'chai'
2-
import chaiAsPromised from 'chai-as-promised'
3-
import sinon from 'sinon'
4-
import sinonChai from 'sinon-chai'
1+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
52
import type { Browser, Page } from 'puppeteer-core'
63
import { activateMainTab, ACTIVATION_TIMEOUT } from '../../src/plugin/activateMainTab'
74

8-
use(chaiAsPromised)
9-
use(sinonChai)
10-
115
describe('activateMainTab', () => {
12-
let clock: sinon.SinonFakeTimers
136
let prevWin: Window
147
let prevDoc: Document
158
let prevTop: Window & typeof globalThis
@@ -22,14 +15,12 @@ describe('activateMainTab', () => {
2215
let mockPage: Partial<Page>
2316

2417
beforeEach(() => {
25-
clock = sinon.useFakeTimers()
26-
18+
vi.useFakeTimers()
2719
window = {
28-
addEventListener: sinon.stub(),
29-
removeEventListener: sinon.stub(),
20+
addEventListener: vi.fn(),
21+
removeEventListener: vi.fn(),
3022

31-
// @ts-ignore sinon gets confused about postMessage type declaration
32-
postMessage: sinon.stub(),
23+
postMessage: vi.fn(),
3324
}
3425

3526
mockDocument = {
@@ -41,60 +32,66 @@ describe('activateMainTab', () => {
4132
// activateMainTab is eval'd in browser context, but the tests exec in a
4233
// node context. We don't necessarily need to do this swap, but it makes the
4334
// tests more portable.
44-
// @ts-ignore
4535
prevWin = global.window
4636
prevDoc = global.document
47-
// @ts-ignore
37+
// @ts-expect-error
4838
prevTop = global.top
49-
//@ts-ignore
39+
// @ts-expect-error
5040
global.window = window
5141
global.document = mockDocument as Document
52-
//@ts-ignore
42+
// @ts-expect-error
5343
global.top = mockTop
5444

5545
mockPage = {
56-
evaluate: sinon.stub().callsFake((fn, ...args) => fn(...args)),
46+
evaluate: vi.fn().mockImplementation((fn, ...args) => fn(...args)),
5747
}
5848

5949
mockBrowser = {
60-
pages: sinon.stub(),
50+
pages: vi.fn(),
6151
}
6252
})
6353

6454
afterEach(() => {
65-
clock.restore()
66-
// @ts-ignore
55+
vi.clearAllTimers()
56+
// @ts-expect-error
6757
global.window = prevWin
68-
// @ts-ignore
6958
global.top = prevTop
7059
global.document = prevDoc
7160
})
7261

7362
it('sends a tab activation request to the plugin, and resolves when the ack event is received', async () => {
74-
const pagePromise = Promise.resolve([mockPage])
75-
76-
;(mockBrowser.pages as sinon.SinonStub).returns(pagePromise)
77-
const p = activateMainTab(mockBrowser as Browser)
63+
vi.mocked(mockBrowser.pages).mockResolvedValue([mockPage] as Page[])
64+
vi.mocked(window.addEventListener).mockImplementation((event, listener) => {
65+
if (event === 'message') {
66+
// @ts-expect-error
67+
listener({ data: { message: 'cypress:extension:main:tab:activated' } })
68+
}
69+
})
7870

79-
await pagePromise
80-
// @ts-ignore
81-
window.addEventListener.withArgs('message').yield({ data: { message: 'cypress:extension:main:tab:activated' } })
82-
expect(window.postMessage).to.be.calledWith({ message: 'cypress:extension:activate:main:tab' })
71+
await activateMainTab(mockBrowser as Browser)
8372

84-
expect(p).to.eventually.be.true
73+
expect(window.postMessage).toHaveBeenCalledExactlyOnceWith({ message: 'cypress:extension:activate:main:tab' })
8574
})
8675

8776
it('sends a tab activation request to the plugin, and rejects if it times out', async () => {
88-
const pagePromise = Promise.resolve([mockPage])
89-
90-
;(mockBrowser.pages as sinon.SinonStub).returns(pagePromise)
91-
await pagePromise
92-
93-
const p = activateMainTab(mockBrowser as Browser)
94-
95-
clock.tick(ACTIVATION_TIMEOUT + 1)
96-
97-
expect(p).to.be.rejected
77+
vi.mocked(mockBrowser.pages).mockResolvedValue([mockPage] as Page[])
78+
79+
return new Promise<void>(async (resolve) => {
80+
mockPage.evaluate = vi.fn().mockImplementation(async (fn, ...args) => {
81+
try {
82+
await fn(...args)
83+
} catch (error) {
84+
expect(window.removeEventListener).toHaveBeenCalledExactlyOnceWith('message', expect.any(Function))
85+
expect(error).toBeUndefined()
86+
resolve()
87+
}
88+
})
89+
90+
const activationPromise = activateMainTab(mockBrowser as Browser)
91+
92+
await vi.advanceTimersByTimeAsync(ACTIVATION_TIMEOUT + 1)
93+
await activationPromise
94+
})
9895
})
9996

10097
describe('when cy in cy', () => {
@@ -103,16 +100,11 @@ describe('activateMainTab', () => {
103100
})
104101

105102
it('does not try to send tab activation message', async () => {
106-
const pagePromise = Promise.resolve([mockPage])
107-
108-
;(mockBrowser.pages as sinon.SinonStub).returns(pagePromise)
109-
110-
const p = activateMainTab(mockBrowser as Browser)
103+
vi.mocked(mockBrowser.pages).mockResolvedValue([mockPage] as Page[])
104+
await activateMainTab(mockBrowser as Browser)
111105

112-
await pagePromise
113-
expect(window.postMessage).not.to.be.called
114-
expect(window.addEventListener).not.to.be.called
115-
await p
106+
expect(window.postMessage).not.toHaveBeenCalled()
107+
expect(window.addEventListener).not.toHaveBeenCalled()
116108
})
117109
})
118110
})

0 commit comments

Comments
 (0)