Skip to content

Commit 89bb0aa

Browse files
Merge branch 'develop' into ryanm/feat/create-cdp-full-snapshot-at-timestamp
2 parents 30316ad + 6bf7383 commit 89bb0aa

File tree

33 files changed

+577
-388
lines changed

33 files changed

+577
-388
lines changed

.circleci/workflows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 2.1
22

3-
chrome-stable-version: &chrome-stable-version "134.0.6998.165"
4-
chrome-beta-version: &chrome-beta-version "135.0.7049.41"
5-
firefox-stable-version: &firefox-stable-version "136.0.3"
3+
chrome-stable-version: &chrome-stable-version "135.0.7049.52"
4+
chrome-beta-version: &chrome-beta-version "136.0.7103.17"
5+
firefox-stable-version: &firefox-stable-version "137.0"
66

77
orbs:
88
browser-tools: circleci/browser-tools@1.5.2

cli/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _Released 4/8/2025 (PENDING)_
77

88
- Allows for `babel-loader` version 10 to be a peer dependency of `@cypress/webpack-preprocessor`. Fixed in [#31218](https://github.com/cypress-io/cypress/pull/31218).
99
- Fixed an issue where Firefox BiDi was prematurely removing prerequests on pending requests. Fixes [#31376](https://github.com/cypress-io/cypress/issues/31376).
10+
- Fixed an [issue](https://github.com/electron/electron/issues/45398) with Electron causing slow animations and increased test times by starting a CDP screencast with a noop configuration. Fixes [#30980](https://github.com/cypress-io/cypress/issues/30980).
1011

1112
**Misc:**
1213

@@ -15,7 +16,7 @@ _Released 4/8/2025 (PENDING)_
1516

1617
**Dependency Updates:**
1718

18-
- Upgraded `mocha` from `7.0.1` to `7.1.1`. Addressed in [#31401](https://github.com/cypress-io/cypress/pull/31401).
19+
- Upgraded `mocha` from `7.0.1` to `7.2.0`. Addressed in [#31423](https://github.com/cypress-io/cypress/pull/31423) and [#31432](https://github.com/cypress-io/cypress/pull/31432).
1920
- Upgraded `webdriver` from `9.7.3` to `9.11.0`. Addressed in [#31315](https://github.com/cypress-io/cypress/pull/31315).
2021
- Upgraded `win-version-info` from `5.0.1` to `6.0.1`. Addressed in [#31358](https://github.com/cypress-io/cypress/pull/31358).
2122

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"sanitize:mocha:results": "node ./scripts/sanitize-mocha-results.js",
5353
"prestart": "yarn ensure-deps",
5454
"start": "cypress open --dev --global",
55-
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude cypress-tests.ts,*only.cy.js",
55+
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__,patches --exclude cypress-tests.ts,*only.cy.js",
5656
"stop-only-all": "yarn stop-only --folder packages",
5757
"pretest": "yarn ensure-deps",
5858
"test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,driver,electron,errors,extension,https-proxy,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry} --scope=@tooling/{electron-mksnapshot,v8-snapshot}",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { loadSpec } from './support/spec-loader'
2+
3+
describe('event-manager', () => {
4+
it('emits the cypress:created event when spec is rerun', () => {
5+
// load the spec initially
6+
loadSpec({
7+
filePath: 'hooks/basic.cy.js',
8+
passCount: 1,
9+
})
10+
11+
cy.window().then((win) => {
12+
const eventManager = win.getEventManager()
13+
let eventReceived = false
14+
15+
// listen for the cypress:created event
16+
eventManager.on('cypress:created', (cypress) => {
17+
expect(cypress).to.exist
18+
expect(cypress).to.not.equal(win.Cypress)
19+
eventReceived = true
20+
})
21+
22+
// trigger a rerun
23+
cy.get('.restart').click()
24+
25+
// keep retrying until eventReceived becomes true
26+
cy.wrap(() => eventReceived).invoke('call').should('be.true')
27+
})
28+
})
29+
})

packages/app/cypress/e2e/studio/studio.cy.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ describe('Cypress Studio', () => {
5656

5757
cy.waitForSpecToFinish()
5858

59+
cy.findByTestId('studio-panel').should('not.exist')
60+
5961
cy.intercept('/cypress/e2e/index.html', () => {
6062
// wait for the promise to resolve before responding
6163
// this will ensure the studio panel is loaded before the test finishes
@@ -70,7 +72,7 @@ describe('Cypress Studio', () => {
7072
// regular studio is not loaded until after the test finishes
7173
cy.get('[data-cy="hook-name-studio commands"]').should('not.exist')
7274
// cloud studio is loaded immediately
73-
cy.findByTestId('studio-panel').should('exist').then(() => {
75+
cy.findByTestId('studio-panel').then(() => {
7476
// we've verified the studio panel is loaded, now resolve the promise so the test can finish
7577
deferred.resolve()
7678
})
@@ -81,8 +83,8 @@ describe('Cypress Studio', () => {
8183
cy.waitForSpecToFinish()
8284

8385
// Verify the studio panel is still open
84-
cy.findByTestId('studio-panel').should('exist')
85-
cy.get('[data-cy="hook-name-studio commands"]').should('exist')
86+
cy.findByTestId('studio-panel')
87+
cy.get('[data-cy="hook-name-studio commands"]')
8688
})
8789
})
8890

@@ -1031,11 +1033,11 @@ describe('studio functionality', () => {
10311033
})`)
10321034
})
10331035

1034-
cy.findByTestId('studio-toolbar-controls').should('exist')
1036+
cy.findByTestId('studio-toolbar-controls')
10351037

10361038
cy.get('button').contains('Save Commands').click()
10371039

1038-
cy.findByTestId('studio-toolbar-controls').should('exist')
1040+
cy.findByTestId('studio-toolbar-controls')
10391041
cy.get('button').contains('Save Commands')
10401042

10411043
cy.findByTestId('hook-name-studio commands').closest('.hook-studio').within(() => {

packages/app/src/runner/ResizablePanels.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
<div
5959
v-show="showPanel4"
60-
data-cy="studio-panel"
60+
data-cy="panel-4"
6161
class="h-full bg-gray-100 relative"
6262
:style="{width: `${panel4Width}px`}"
6363
>

packages/app/src/runner/SpecRunnerOpenMode.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<template>
22
<StudioInstructionsModal
3+
v-if="studioStore.instructionModalIsOpen"
34
:open="studioStore.instructionModalIsOpen"
45
@close="studioStore.closeInstructionModal"
56
/>
67
<StudioSaveModal
8+
v-if="studioStore.saveModalIsOpen"
79
:open="studioStore.saveModalIsOpen"
810
@close="studioStore.closeSaveModal"
911
/>
@@ -99,7 +101,8 @@
99101
</template>
100102
<template #panel4>
101103
<StudioPanel
102-
v-show="shouldShowStudioPanel"
104+
v-if="shouldShowStudioPanel"
105+
data-cy="studio-panel"
103106
:can-access-studio-a-i="studioStore.canAccessStudioAI"
104107
/>
105108
</template>

packages/app/src/runner/event-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ export class EventManager {
432432
}
433433

434434
Cypress = this.Cypress = this.$CypressDriver.create(config)
435+
this.localBus.emit('cypress:created', Cypress)
435436

436437
// expose Cypress globally
437-
// @ts-ignore
438438
window.Cypress = Cypress
439439

440440
this.studioStore.setup(config)

packages/app/src/studio/StudioPanel.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div>
55
<div
66
v-else
7-
ref="root"
7+
ref="container"
88
>
99
Loading the panel...
1010
</div>
@@ -27,26 +27,30 @@ const props = defineProps<{
2727
2828
interface StudioApp { default: StudioAppDefaultShape }
2929
30-
const root = ref<HTMLElement | null>(null)
30+
const container = ref<HTMLElement | null>(null)
3131
const error = ref<string | null>(null)
32-
const Panel = ref<StudioPanelShape | null>(null)
32+
const ReactStudioPanel = ref<StudioPanelShape | null>(null)
3333
const reactRoot = ref<Root | null>(null)
3434
3535
const maybeRenderReactComponent = () => {
36-
if (!Panel.value || !!error.value) {
36+
// don't render the react component if the react studio panel has not loaded or if there is an error
37+
if (!ReactStudioPanel.value || !!error.value) {
3738
return
3839
}
3940
40-
const panel = window.UnifiedRunner.React.createElement(Panel.value, { canAccessStudioAI: props.canAccessStudioAI })
41+
const panel = window.UnifiedRunner.React.createElement(ReactStudioPanel.value, { canAccessStudioAI: props.canAccessStudioAI })
42+
43+
if (!reactRoot.value) {
44+
reactRoot.value = window.UnifiedRunner.ReactDOM.createRoot(container.value)
45+
}
4146
42-
reactRoot.value = window.UnifiedRunner.ReactDOM.createRoot(root.value)
4347
reactRoot.value?.render(panel)
4448
}
4549
4650
watch(() => props.canAccessStudioAI, maybeRenderReactComponent)
4751
4852
const unmountReactComponent = () => {
49-
if (!Panel.value || !root.value) {
53+
if (!ReactStudioPanel.value || !container.value) {
5054
return
5155
}
5256
@@ -86,7 +90,7 @@ loadRemote<StudioApp>('app-studio').then((module) => {
8690
return
8791
}
8892
89-
Panel.value = module.default.StudioPanel
93+
ReactStudioPanel.value = module.default.StudioPanel
9094
maybeRenderReactComponent()
9195
}).catch((e) => {
9296
error.value = e.message

packages/driver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"methods": "1.1.2",
7878
"mime": "^3.0.0",
7979
"minimatch": "3.1.2",
80-
"mocha": "7.1.1",
80+
"mocha": "7.2.0",
8181
"multer": "1.4.4",
8282
"ordinal": "1.0.3",
8383
"react-15.6.1": "npm:react@15.6.1",

packages/driver/patches/mocha+7.1.1.dev.patch renamed to packages/driver/patches/mocha+7.2.0.dev.patch

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,51 @@
11
diff --git a/node_modules/mocha/CHANGELOG.md b/node_modules/mocha/CHANGELOG.md
22
deleted file mode 100644
3-
index 8c2f86a..0000000
3+
index 71ef0fc..0000000
44
--- a/node_modules/mocha/CHANGELOG.md
55
+++ /dev/null
6-
@@ -1,623 +0,0 @@
6+
@@ -1,665 +0,0 @@
7+
-# 7.2.0 / 2020-05-22
8+
-
9+
-## :tada: Enhancements
10+
-
11+
-- [#4234](https://github.com/mochajs/mocha/issues/4234): Add ability to run tests in a mocha instance multiple times ([**@nicojs**](https://github.com/nicojs))
12+
-- [#4219](https://github.com/mochajs/mocha/issues/4219): Exposing filename in JSON, doc, and json-stream reporters ([**@Daniel0113**](https://github.com/Daniel0113))
13+
-- [#4244](https://github.com/mochajs/mocha/issues/4244): Add Root Hook Plugins ([**@boneskull**](https://github.com/boneskull))
14+
-
15+
-## :bug: Fixes
16+
-
17+
-- [#4258](https://github.com/mochajs/mocha/issues/4258): Fix missing dot in name of configuration file ([**@sonicdoe**](https://github.com/sonicdoe))
18+
-- [#4194](https://github.com/mochajs/mocha/issues/4194): Check if module.paths really exists ([**@ematipico**](https://github.com/ematipico))
19+
-- [#4256](https://github.com/mochajs/mocha/issues/4256): `--forbid-only` does not recognize `it.only` when `before` crashes ([**@arvidOtt**](https://github.com/arvidOtt))
20+
-- [#4152](https://github.com/mochajs/mocha/issues/4152): Bug with multiple async done() calls ([**@boneskull**](https://github.com/boneskull))
21+
-- [#4275](https://github.com/mochajs/mocha/issues/4275): Improper warnings for invalid reporters ([**@boneskull**](https://github.com/boneskull))
22+
-- [#4288](https://github.com/mochajs/mocha/issues/4288): Broken hook.spec.js test for IE11 ([**@boneskull**](https://github.com/boneskull))
23+
-
24+
-## :book: Documentation
25+
-
26+
-- [#4081](https://github.com/mochajs/mocha/issues/4081): Insufficient white space for API docs in view on mobile ([**@HyunSangHan**](https://github.com/HyunSangHan))
27+
-- [#4255](https://github.com/mochajs/mocha/issues/4255): Update mocha-docdash for UI fixes on API docs ([**@craigtaub**](https://github.com/craigtaub))
28+
-- [#4235](https://github.com/mochajs/mocha/issues/4235): Enable emoji on website; enable normal ul elements ([**@boneskull**](https://github.com/boneskull))
29+
-- [#4272](https://github.com/mochajs/mocha/issues/4272): Fetch sponsors at build time, show ALL non-skeevy sponsors ([**@boneskull**](https://github.com/boneskull))
30+
-
31+
-## :nut_and_bolt: Other
32+
-
33+
-- [#4249](https://github.com/mochajs/mocha/issues/4249): Refactoring improving encapsulation ([**@arvidOtt**](https://github.com/arvidOtt))
34+
-- [#4242](https://github.com/mochajs/mocha/issues/4242): CI add job names, add Node.js v14 to matrix ([**@boneskull**](https://github.com/boneskull))
35+
-- [#4237](https://github.com/mochajs/mocha/issues/4237): Refactor validatePlugins to throw coded errors ([**@boneskull**](https://github.com/boneskull))
36+
-- [#4236](https://github.com/mochajs/mocha/issues/4236): Better debug output ([**@boneskull**](https://github.com/boneskull))
37+
-
38+
-# 7.1.2 / 2020-04-26
39+
-
40+
-## :nut_and_bolt: Other
41+
-
42+
-- [#4251](https://github.com/mochajs/mocha/issues/4251): Prevent karma-mocha from stalling ([**@juergba**](https://github.com/juergba))
43+
-- [#4222](https://github.com/mochajs/mocha/issues/4222): Update dependency mkdirp to v0.5.5 ([**@outsideris**](https://github.com/outsideris))
44+
-
45+
-## :book: Documentation
46+
-
47+
-- [#4208](https://github.com/mochajs/mocha/issues/4208): Add Wallaby logo to site ([**@boneskull**](https://github.com/boneskull))
48+
-
749
-# 7.1.1 / 2020-03-18
850
-
951
-## :lock: Security Fixes
@@ -541,7 +583,7 @@ index 8c2f86a..0000000
541583
-
542584
-- [#3226](https://github.com/mochajs/mocha/issues/3226): Do not swallow errors that are thrown asynchronously from passing tests ([@boneskull](https://github.com/boneskull)). Example:
543585
-
544-
- \```js
586+
- \`\`\`js
545587
- it('should actually fail, sorry!', function (done) {
546588
- // passing assertion
547589
- assert(true === true);
@@ -554,7 +596,7 @@ index 8c2f86a..0000000
554596
- throw new Error('chaos!');
555597
- }, 100);
556598
- });
557-
- \```
599+
- \`\`\`
558600
-
559601
- Previously to this version, Mocha would have _silently swallowed_ the `chaos!` exception, and you wouldn't know. Well, _now you know_. Mocha cannot recover from this gracefully, so it will exit with a nonzero code.
560602
-
@@ -747,23 +789,23 @@ deleted file mode 100644
747789
index b3623a5..0000000
748790
Binary files a/node_modules/mocha/assets/growl/ok.png and /dev/null differ
749791
diff --git a/node_modules/mocha/lib/mocha.js b/node_modules/mocha/lib/mocha.js
750-
index 740e1fd..0cd2769 100644
792+
index 1983690..ee096a3 100644
751793
--- a/node_modules/mocha/lib/mocha.js
752794
+++ b/node_modules/mocha/lib/mocha.js
753-
@@ -904,7 +904,7 @@ Mocha.prototype.run = function(fn) {
754-
options.files = this.files;
755-
var runner = new exports.Runner(suite, options.delay);
795+
@@ -1014,7 +1014,7 @@ Mocha.prototype.run = function(fn) {
796+
cleanReferencesAfterRun: this._cleanReferencesAfterRun
797+
});
756798
createStatsCollector(runner);
757799
- var reporter = new this._reporter(runner, options);
758800
+ var reporter = this._reporter(runner, options);
759801
runner.checkLeaks = options.checkLeaks === true;
760802
runner.fullStackTrace = options.fullTrace;
761803
runner.asyncOnly = options.asyncOnly;
762804
diff --git a/node_modules/mocha/lib/runner.js b/node_modules/mocha/lib/runner.js
763-
index 8e7c873..5208e60 100644
805+
index 20a6af2..2123646 100644
764806
--- a/node_modules/mocha/lib/runner.js
765807
+++ b/node_modules/mocha/lib/runner.js
766-
@@ -682,9 +682,43 @@ Runner.prototype.runTests = function(suite, fn) {
808+
@@ -755,9 +755,42 @@ Runner.prototype.runTests = function(suite, fn) {
767809
}
768810
self.emit(constants.EVENT_TEST_END, test);
769811
return self.hookUp(HOOK_TYPE_AFTER_EACH, next);
@@ -803,13 +845,12 @@ index 8e7c873..5208e60 100644
803845
+
804846
var retry = test.currentRetry();
805847
- if (retry < test.retries()) {
806-
+
807848
+ // requeue the test if we have retries and haven't satisfied our retry configuration.
808849
+ if (retry < test.retries() && testStatusInfo.shouldAttemptsContinue) {
809850
var clonedTest = test.clone();
810851
clonedTest.currentRetry(retry + 1);
811852
tests.unshift(clonedTest);
812-
@@ -694,8 +728,25 @@ Runner.prototype.runTests = function(suite, fn) {
853+
@@ -767,8 +800,25 @@ Runner.prototype.runTests = function(suite, fn) {
813854
// Early return + hook trigger so that it doesn't
814855
// increment the count wrong
815856
return self.hookUp(HOOK_TYPE_AFTER_EACH, next);

packages/driver/src/cypress/source_map_utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { BasicSourceMapConsumer } from 'source-map'
66
import mappingsWasm from 'source-map/lib/mappings.wasm'
77

88
import $utils from './utils'
9-
import stackUtils from './stack_utils'
9+
import { toPosix } from './util/to_posix'
1010

1111
const sourceMapExtractionRegex = /\/\/\s*[@#]\s*sourceMappingURL\s*=\s*(data:[^\s]*)/g
1212
const regexDataUrl = /data:[^;\n]+(?:;charset=[^;\n]+)?;base64,([a-zA-Z0-9+/]+={0,2})/ // matches data urls
@@ -23,7 +23,7 @@ const initializeSourceMapConsumer = async (script, sourceMap): Promise<BasicSour
2323

2424
const consumer = await new SourceMapConsumer(sourceMap)
2525

26-
sourceMapConsumers[stackUtils.toPosix(script.fullyQualifiedUrl)] = consumer
26+
sourceMapConsumers[toPosix(script.fullyQualifiedUrl)] = consumer
2727

2828
return consumer
2929
}
@@ -56,7 +56,7 @@ const extractSourceMap = (fileContents) => {
5656
}
5757

5858
const getSourceContents = (filePath, sourceFile) => {
59-
const posixFilePath = stackUtils.toPosix(filePath)
59+
const posixFilePath = toPosix(filePath)
6060

6161
if (!sourceMapConsumers[posixFilePath]) return null
6262

@@ -72,7 +72,7 @@ const getSourceContents = (filePath, sourceFile) => {
7272
}
7373

7474
const getSourcePosition = (filePath, position) => {
75-
const posixFilePath = stackUtils.toPosix(filePath)
75+
const posixFilePath = toPosix(filePath)
7676
const sourceMapConsumer = sourceMapConsumers[posixFilePath]
7777

7878
if (!sourceMapConsumer) return null

packages/driver/src/cypress/stack_utils.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { codeFrameColumns } from '@babel/code-frame'
1515

1616
import $utils from './utils'
1717
import $sourceMapUtils from './source_map_utils'
18-
18+
import { toPosix } from './util/to_posix'
1919
// Intentionally deep-importing from @packages/errors so as to not bundle the entire @packages/errors in the client unnecessarily
2020
import { getStackLines, replacedStack, stackWithoutMessage, splitStack, unsplitStack, stackLineRegex } from '@packages/errors/src/stackUtils'
2121

@@ -184,12 +184,6 @@ const getCodeFrameFromSource = (sourceCode, { line, column: originalColumn, rela
184184
}
185185
}
186186

187-
export const toPosix = (file: string) => {
188-
return Cypress.config('platform') === 'win32'
189-
? file.replaceAll('\\', '/')
190-
: file
191-
}
192-
193187
const getRelativePathFromRoot = (relativeFile: string, absoluteFile?: string) => {
194188
// at this point relativeFile is relative to the cypress config
195189
// we need it to be relative to the repo root, which is different for monorepos
@@ -549,5 +543,4 @@ export default {
549543
stackWithUserInvocationStackSpliced,
550544
captureUserInvocationStack,
551545
getInvocationDetails,
552-
toPosix,
553546
}

0 commit comments

Comments
 (0)