Skip to content

Commit b4b79c2

Browse files
Merge pull request #30559 from cypress-io/chore/merge_develop
chore: merge `develop` into `release/14.0.0`
2 parents 3141d12 + 3ea7f06 commit b4b79c2

Some content is hidden

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

41 files changed

+267
-271
lines changed

.circleci/cache-version.txt

+1-1
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-
11-1-24
3+
11-6-24

.github/workflows/update_v8_snapshot_cache.yml

+20-10
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ concurrency:
4545
jobs:
4646
update-v8-snapshot-cache:
4747
strategy:
48-
max-parallel: 1
48+
max-parallel: 3
4949
matrix:
5050
platform: [ubuntu-latest, macos-latest, windows-latest]
5151
runs-on: ${{ matrix.platform }}
@@ -57,14 +57,20 @@ jobs:
5757
steps:
5858
- name: Determine snapshot files - Windows
5959
if: ${{ matrix.platform == 'windows-latest' }}
60-
run: echo "SNAPSHOT_FILES='tooling\v8-snapshot\cache\win32\snapshot-meta.json'" >> $GITHUB_ENV
60+
run: |
61+
echo "SNAPSHOT_FILES='tooling\v8-snapshot\cache\win32\snapshot-meta.json'" >> $GITHUB_ENV
62+
echo "PLATFORM=windows" >> $GITHUB_ENV
6163
shell: bash
6264
- name: Determine snapshot files - Linux
6365
if: ${{ matrix.platform == 'ubuntu-latest' }}
64-
run: echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/linux/snapshot-meta.json'" >> $GITHUB_ENV
66+
run: |
67+
echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/linux/snapshot-meta.json'" >> $GITHUB_ENV
68+
echo "PLATFORM=linux" >> $GITHUB_ENV
6569
- name: Determine snapshot files - Mac
6670
if: ${{ matrix.platform == 'macos-latest' }}
67-
run: echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/darwin/snapshot-meta.json'" >> $GITHUB_ENV
71+
run: |
72+
echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/darwin/snapshot-meta.json'" >> $GITHUB_ENV
73+
echo "PLATFORM=darwin" >> $GITHUB_ENV
6874
- name: Install setuptools - Mac
6975
if: ${{ matrix.platform == 'macos-latest' }}
7076
run: sudo -H pip install setuptools
@@ -85,7 +91,8 @@ jobs:
8591
node-version: 20
8692
cache: 'yarn'
8793
- name: Run yarn
88-
run: yarn
94+
# set the timeout here to try and deal with Windows slowness
95+
run: yarn --network-timeout 300000
8996
- name: Run build
9097
run: yarn build
9198
- name: Generate prod snapshot from scratch
@@ -108,14 +115,17 @@ jobs:
108115
- name: Determine branch name - commit to separate branch
109116
if: ${{ inputs.commit_directly_to_branch != true }}
110117
run: |
111-
echo "BRANCH_NAME=update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }}" >> $GITHUB_ENV
112-
echo "BRANCH_EXISTS=$(git show-ref --verify --quiet refs/remotes/origin/update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }} && echo 'true')" >> $GITHUB_ENV
118+
echo "BRANCH_NAME=update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }}-${{ env.PLATFORM }}" >> $GITHUB_ENV
119+
echo "BRANCH_EXISTS=$(git show-ref --verify --quiet refs/remotes/origin/update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }}-${{ env.PLATFORM }} && echo 'true')" >> $GITHUB_ENV
113120
shell: bash
114121
- name: Check need for PR or branch update
115122
id: check-need-for-pr
116123
run: |
117-
echo "needs_pr=${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' && env.BRANCH_EXISTS != 'true' }}" >> $GITHUB_OUTPUT
124+
echo "number_of_prs_for_branch=$(gh api '/repos/cypress-io/cypress/pulls?head=cypress-io:${{ env.BRANCH_NAME }}' --jq length)" >> $GITHUB_OUTPUT
125+
echo "needs_pr=${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' && env.BRANCH_NAME != env.BASE_BRANCH && steps.check-need-for-pr.outputs.number_of_prs_for_branch == '0' }}" >> $GITHUB_OUTPUT
118126
echo "needs_branch_update=${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' && env.BRANCH_EXISTS == 'true' }}" >> $GITHUB_OUTPUT
127+
env:
128+
GH_TOKEN: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
119129
shell: bash
120130
## Update available and a branch/PR already exists
121131
- name: Checkout existing branch
@@ -128,7 +138,7 @@ jobs:
128138
git merge --squash -Xtheirs stash
129139
## Update available and a PR doesn't already exist
130140
- name: Checkout new branch
131-
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
141+
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update != 'true' }}
132142
run: git checkout -b ${{ env.BRANCH_NAME }} ${{ env.BASE_BRANCH }}
133143
## Commit changes if present
134144
- name: Commit the changes
@@ -152,7 +162,7 @@ jobs:
152162
github,
153163
baseBranch: '${{ env.BASE_BRANCH }}',
154164
branchName: '${{ env.BRANCH_NAME }}',
155-
description: 'Update v8 snapshot cache',
165+
description: 'Update v8 snapshot cache - ${{ env.PLATFORM }}',
156166
body: 'This PR was automatically generated by the [update-v8-snapshot-cache](https://github.com/cypress-io/cypress/actions/workflows/update_v8_snapshot_cache.yml) github action.',
157167
reviewers: ['ryanthemanuel']
158168
})

browser-versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"chrome:beta": "131.0.6778.24",
3-
"chrome:stable": "130.0.6723.91",
3+
"chrome:stable": "130.0.6723.116",
44
"chrome:minimum": "64.0.3282.0"
55
}

cli/CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr
4141

4242
## 13.15.2
4343

44-
_Released 11/5/2024 (PENDING)_
44+
_Released 11/5/2024_
45+
46+
**Bugfixes:**
47+
48+
- Fixed an issue where the Cypress runner could hang in `after` or `afterEach` hooks that run Cypress commands after a page load timeout error occurs. Addresses [#30238](https://github.com/cypress-io/cypress/issues/30238).
4549

4650
**Misc:**
4751

4852
- Fixed a typo in CLI `global` option help text. Addresses [#30531](https://github.com/cypress-io/cypress/issues/30531).
4953

5054
**Dependency Updates:**
5155

56+
- Updated `react` from `16.8.6` to `17.0.2` and `react-dom` from `16.8.6` to `17.0.2`. Addresses [#30510](https://github.com/cypress-io/cypress/issues/30510).
57+
- Updated `mobx` from `5.15.4` to `6.13.5` and `mobx-react` from `6.1.8` to `9.1.1`. Addresses [#30509](https://github.com/cypress-io/cypress/issues/30509).
5258
- Updated `@cypress/request` from `3.0.4` to `3.0.6`. Addressed in [#30488](https://github.com/cypress-io/cypress/pull/30488).
5359

5460

npm/react/cypress/component/basic/rerender/effects.cy.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ it('should run unmount effect cleanup when unmounting', () => {
6262

6363
cy
6464
.then(() => ReactDom.unmountComponentAtNode(getContainerEl()))
65-
.then(() => {
65+
.then(async () => {
66+
// does not call useEffect in react 17 unmount synchronously.
67+
// @see https://github.com/facebook/react/issues/20263
68+
// to keep this test working, we need to flush the microtask queue.
69+
await new Promise((r) => setTimeout(r))
70+
6671
expect(layoutEffectCleanup).to.have.been.callCount(1)
6772
expect(effectCleanup).to.have.been.callCount(1)
6873
})

npm/react/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"axios": "0.21.2",
2323
"cypress": "0.0.0-development",
2424
"prop-types": "15.7.2",
25-
"react": "16.8.6",
26-
"react-dom": "16.8.6",
27-
"react-router": "6.0.0-alpha.1",
28-
"react-router-dom": "6.0.0-alpha.1",
25+
"react": "17.0.2",
26+
"react-dom": "17.0.2",
27+
"react-router": "6.10.0",
28+
"react-router-dom": "6.10.0",
2929
"semver": "^7.5.3",
3030
"typescript": "~5.4.5",
3131
"vite": "5.2.11",

npm/react18/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"@cypress/react": "0.0.0-development",
1616
"@rollup/plugin-commonjs": "^17.1.0",
1717
"@rollup/plugin-node-resolve": "^11.1.1",
18-
"@types/react": "^16",
19-
"@types/react-dom": "^16",
18+
"@types/react": "17.0.83",
19+
"@types/react-dom": "17.0.25",
2020
"cypress": "0.0.0-development",
21-
"react": "^16",
22-
"react-dom": "^16",
21+
"react": "^17.0.2",
22+
"react-dom": "^17.0.2",
2323
"rollup": "3.7.3",
2424
"rollup-plugin-typescript2": "^0.29.0",
2525
"typescript": "~5.4.5"

npm/webpack-preprocessor/package.json

-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"scripts": {
88
"build": "rimraf dist && tsc || echo 'built, with errors'",
99
"check-ts": "tsc --noEmit",
10-
"deps": "deps-ok && dependency-check --no-dev .",
1110
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
1211
"secure": "nsp check",
1312
"semantic-release": "semantic-release",
@@ -33,11 +32,7 @@
3332
"chai": "4.1.2",
3433
"chalk": "3.0.0",
3534
"chokidar-cli": "2.1.0",
36-
"common-tags": "^1.8.2",
3735
"cypress": "0.0.0-development",
38-
"dependency-check": "2.9.1",
39-
"deps-ok": "1.4.1",
40-
"find-webpack": "1.5.0",
4136
"fs-extra": "^10.1.0",
4237
"mocha": "^7.1.0",
4338
"mockery": "2.1.0",

package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress",
3-
"version": "13.15.1",
3+
"version": "13.15.2",
44
"description": "Cypress is a next generation front end testing tool built for the modern web",
55
"private": true,
66
"scripts": {
@@ -112,8 +112,8 @@
112112
"@types/mocha": "8.0.3",
113113
"@types/node": "20.16.0",
114114
"@types/prismjs": "1.16.0",
115-
"@types/react": "16.9.50",
116-
"@types/react-dom": "16.9.8",
115+
"@types/react": "17.0.83",
116+
"@types/react-dom": "17.0.25",
117117
"@types/request-promise": "4.1.45",
118118
"@types/send": "^0.17.1",
119119
"@types/sinon-chai": "3.2.3",
@@ -175,6 +175,8 @@
175175
"listr2": "3.8.3",
176176
"lodash": "^4.17.21",
177177
"minimist": "1.2.8",
178+
"mobx": "6.13.5",
179+
"mobx-react": "9.1.1",
178180
"mocha": "3.5.3",
179181
"mocha-banner": "1.1.2",
180182
"mocha-junit-reporter": "2.2.0",
@@ -187,14 +189,16 @@
187189
"pluralize": "8.0.0",
188190
"print-arch": "1.0.0",
189191
"proxyquire": "2.1.3",
192+
"react": "17.0.2",
193+
"react-dom": "17.0.2",
190194
"rimraf": "5.0.10",
191195
"semantic-release": "22.0.12",
192196
"semantic-release-monorepo": "8.0.2",
193197
"semver": "7.5.3",
194198
"shelljs": "0.8.5",
195199
"sinon": "7.3.2",
196200
"snap-shot-it": "7.9.10",
197-
"stop-only": "3.0.1",
201+
"stop-only": "3.4.1",
198202
"strip-ansi": "6.0.1",
199203
"tar": "6.1.15",
200204
"term-to-html": "1.2.0",
@@ -263,7 +267,6 @@
263267
"resolutions": {
264268
"**/@types/cheerio": "0.22.21",
265269
"**/@types/enzyme": "3.10.5",
266-
"**/@types/react": "16.9.50",
267270
"**/@wdio/logger": "9.0.0",
268271
"**/jquery": "3.7.1",
269272
"**/pretty-format": "26.4.0",

packages/app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"javascript-time-ago": "2.3.8",
5959
"just-my-luck": "3.0.0",
6060
"lodash": "4.17.21",
61-
"mobx": "5.15.4",
6261
"nanoid": "3.3.4",
6362
"pinia": "2.0.0-rc.14",
6463
"rollup-plugin-copy": "3.4.0",

packages/app/src/store/mobx-runner-store.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nanoid } from 'nanoid'
2-
import { action, observable } from 'mobx'
2+
import { action, observable, makeObservable } from 'mobx'
33
import type { AutomationStatus } from '../store'
44

55
const defaults = {
@@ -25,6 +25,7 @@ export class MobxRunnerStore {
2525
@observable canSaveStudioLogs = false
2626

2727
constructor (testingType: Cypress.TestingType) {
28+
makeObservable(this)
2829
this.width = defaults[testingType].width
2930
this.height = defaults[testingType].height
3031
}

packages/app/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"compilerOptions": {
1515
"noImplicitThis": true,
16+
"useDefineForClassFields": true,
1617
"paths": {
1718
"@cy/i18n": ["../frontend-shared/src/locales/i18n"],
1819
"@cy/components/*": ["../frontend-shared/src/components/*"],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
after(() => {
2+
// ensure that we're stable in the after hooks
3+
expect(cy.state('isStable')).to.be.true
4+
5+
// ensure we can enqueue a command without timing out
6+
cy.then(() => {
7+
expect(true).to.be.true
8+
})
9+
})
10+
11+
afterEach(() => {
12+
// ensure that we're stable in the after hooks
13+
expect(cy.state('isStable')).to.be.true
14+
15+
// ensure that we can enqueue a command without timing out
16+
cy.then(() => {
17+
expect(true).to.be.true
18+
})
19+
})
20+
21+
it('runs an after block without timing out when the page load times out', { pageLoadTimeout: 500 }, () => {
22+
cy.on('fail', (error) => {
23+
expect(error.message).to.include('Timed out after')
24+
25+
return false
26+
})
27+
28+
cy.on('window:before:load', (win) => {
29+
// Stop the page from loading so that the page load times out
30+
win.stop()
31+
})
32+
33+
cy.visit('/fixtures/generic.html')
34+
})

packages/driver/cypress/support/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const getCommandLogWithText = (command, type = 'method') => {
1010
}
1111

1212
export const findReactInstance = function (dom) {
13-
let key = _.keys(dom).find((key) => key.startsWith('__reactInternalInstance$')) as string
13+
let key = _.keys(dom).find((key) => key.startsWith('__reactFiber')) as string
1414
let internalInstance = dom[key]
1515

1616
if (internalInstance == null) return null

packages/driver/src/cypress/command_queue.ts

+3
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ export class CommandQueue extends Queue<$Command> {
223223
// end in case we have after / afterEach hooks
224224
// which need to run
225225
this.index = this.length
226+
227+
// Mark the state as stable, so that any cypress commands can be re-queued during the after / afterEach hooks
228+
this.state('isStable', true)
226229
}
227230

228231
private runCommand (command: $Command) {

packages/example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"cross-env": "6.0.3",
18-
"cypress-example-kitchensink": "3.1.0",
18+
"cypress-example-kitchensink": "3.1.1",
1919
"gh-pages": "5.0.0",
2020
"gulp": "4.0.2",
2121
"gulp-clean": "0.4.0",

packages/reporter/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@
2727
"cypress-real-events": "1.6.0",
2828
"lodash": "^4.17.21",
2929
"markdown-it": "^14.0.0",
30-
"mobx": "5.15.4",
31-
"mobx-react": "6.1.8",
3230
"prismjs": "1.27.0",
3331
"prop-types": "15.7.2",
34-
"react": "16.8.6",
35-
"react-dom": "16.8.6",
3632
"sinon": "7.5.0",
3733
"webpack": "^5.88.2",
3834
"webpack-cli": "^5.1.4"

packages/reporter/src/agents/agent-model.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { observable } from 'mobx'
1+
import { observable, makeObservable } from 'mobx'
22
import Instrument, { InstrumentProps } from '../instruments/instrument-model'
33

44
export interface AgentProps extends InstrumentProps {
@@ -13,6 +13,8 @@ export default class Agent extends Instrument {
1313
constructor (props: AgentProps) {
1414
super(props)
1515

16+
makeObservable(this)
17+
1618
this.callCount = props.callCount
1719
this.functionName = props.functionName
1820
}

packages/reporter/src/attempts/attempt-model.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash'
2-
import { action, computed, observable } from 'mobx'
2+
import { action, computed, observable, makeObservable } from 'mobx'
33

44
import Agent, { AgentProps } from '../agents/agent-model'
55
import Command, { CommandProps } from '../commands/command-model'
@@ -47,6 +47,7 @@ export default class Attempt {
4747
_logs: {[key: string]: Log} = {}
4848

4949
constructor (props: TestProps, test: Test) {
50+
makeObservable(this)
5051
this.testId = props.id
5152
this.id = props.currentRetry || 0
5253
this.test = test

packages/reporter/src/commands/command-model.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash'
2-
import { action, computed, observable } from 'mobx'
2+
import { action, computed, observable, makeObservable } from 'mobx'
33

44
import Err, { ErrProps } from '../errors/err-model'
55
import Instrument, { InstrumentProps } from '../instruments/instrument-model'
@@ -131,6 +131,8 @@ export default class Command extends Instrument {
131131
constructor (props: CommandProps) {
132132
super(props)
133133

134+
makeObservable(this)
135+
134136
if (props.err) {
135137
this.err = new Err(props.err)
136138
}

0 commit comments

Comments
 (0)