Skip to content

Commit

Permalink
Merge branch 'develop' into issue-27552-upgrade-to-fix-socket-closed-…
Browse files Browse the repository at this point in the history
…crash
  • Loading branch information
jennifer-shehane committed May 8, 2024
2 parents ec45d6f + f3bdb9f commit fa099df
Show file tree
Hide file tree
Showing 31 changed files with 348 additions and 93 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbs:

jobs:
verify-ci-should-run:
resource_class: small
docker:
- image: cimg/node:current
steps:
Expand Down
23 changes: 18 additions & 5 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1716,27 +1716,31 @@ jobs:

system-tests-chrome:
<<: *defaults
resource_class: medium+
parallelism: 8
steps:
- run-system-tests:
browser: chrome

system-tests-electron:
<<: *defaults
resource_class: medium+
parallelism: 8
steps:
- run-system-tests:
browser: electron

system-tests-firefox:
<<: *defaults
resource_class: medium+
parallelism: 8
steps:
- run-system-tests:
browser: firefox

system-tests-webkit:
<<: *defaults
resource_class: medium+
parallelism: 8
steps:
- run-system-tests:
Expand Down Expand Up @@ -1811,6 +1815,9 @@ jobs:
<<: *defaults
parameters:
<<: *defaultsParameters
resource_class:
type: string
default: medium+
percy:
type: boolean
default: false
Expand Down Expand Up @@ -1844,13 +1851,15 @@ jobs:
driver-integration-tests-chrome:
<<: *defaults
parallelism: 5
resource_class: medium+
steps:
- run-driver-integration-tests:
browser: chrome
install-chrome-channel: stable

driver-integration-tests-chrome-beta:
<<: *defaults
resource_class: medium+
parallelism: 5
steps:
- run-driver-integration-tests:
Expand All @@ -1859,6 +1868,7 @@ jobs:

driver-integration-tests-firefox:
<<: *defaults
resource_class: medium+
parallelism: 5
steps:
- run-driver-integration-tests:
Expand All @@ -1873,7 +1883,7 @@ jobs:

driver-integration-tests-webkit:
<<: *defaults
resource_class: medium+
resource_class: large
parallelism: 5
steps:
- run-driver-integration-tests:
Expand All @@ -1896,6 +1906,7 @@ jobs:

reporter-integration-tests:
<<: *defaults
resource_class: medium+
parallelism: 3
steps:
- restore_cached_workspace
Expand All @@ -1921,6 +1932,7 @@ jobs:

run-webpack-dev-server-integration-tests:
<<: *defaults
resource_class: medium+
parallelism: 2
steps:
- restore_cached_workspace
Expand Down Expand Up @@ -2191,7 +2203,7 @@ jobs:
<<: *defaultsParameters
resource_class:
type: string
default: large
default: medium
resource_class: << parameters.resource_class >>
steps:
- maybe_skip_binary_jobs
Expand Down Expand Up @@ -2290,6 +2302,7 @@ jobs:

test-npm-module-and-verify-binary:
<<: *defaults
resource_class: small
steps:
- restore_cached_workspace
# make sure we have cypress.zip received
Expand Down Expand Up @@ -3426,7 +3439,7 @@ windows-workflow: &windows-workflow
- node_modules_install:
name: windows-node-modules-install
executor: windows
resource_class: windows.large
resource_class: windows.medium
only-cache-for-root-user: true

- build:
Expand All @@ -3440,15 +3453,15 @@ windows-workflow: &windows-workflow
- run-app-integration-tests-chrome:
name: windows-run-app-integration-tests-chrome
executor: windows
resource_class: windows.xlarge
resource_class: windows.large
context: [test-runner:cypress-record-key, test-runner:launchpad-tests]
requires:
- windows-build

- run-launchpad-integration-tests-chrome:
name: windows-run-launchpad-integration-tests-chrome
executor: windows
resource_class: windows.xlarge
resource_class: windows.large
context: [test-runner:cypress-record-key, test-runner:launchpad-tests]
requires:
- windows-build
Expand Down
2 changes: 1 addition & 1 deletion browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"chrome:beta": "125.0.6422.26",
"chrome:stable": "124.0.6367.118",
"chrome:stable": "124.0.6367.155",
"chrome:minimum": "64.0.3282.0"
}
14 changes: 12 additions & 2 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.9.1

_Released 5/21/2024 (PENDING)_

**Bugfixes:**

- Fixed a sporadic crash of Cypress with "Error: This socket has been ended by the other party". Fixes [#27552](https://github.com/cypress-io/cypress/issues/27552).

## 13.9.0

_Released 5/7/2024 (PENDING)_
_Released 5/7/2024_

**Features:**

- Added more descriptive error messages when Test Replay fails to record or upload. Addresses [#29022](https://github.com/cypress-io/cypress/issues/29022).

**Bugfixes:**

- Fixed a bug where promises rejected with `undefined` were failing inside `cy.origin()`. Addresses [#23937](https://github.com/cypress-io/cypress/issues/23937).
- We now pass the same default Chromium flags to Electron as we do to Chrome. As a result of this change, the application under test's `navigator.webdriver` property will now correctly be `true` when testing in Electron. Fixes [#27939](https://github.com/cypress-io/cypress/issues/27939).
- Fixed a sporadic crash of Cypress with "Error: This socket has been ended by the other party". Fixes [#27552](https://github.com/cypress-io/cypress/issues/27552).
- Fixed network issues in requests using fetch for users where Cypress is run behind a proxy that performs HTTPS decryption (common among corporate proxies). Fixes [#29171](https://github.com/cypress-io/cypress/issues/29171).
- Fixed an issue where extra windows weren't being closed between specs in Firefox causing potential issues in subsequent specs. Fixes [#29473](https://github.com/cypress-io/cypress/issues/29473).

**Misc:**

Expand Down
4 changes: 0 additions & 4 deletions cli/test/lib/tasks/download_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,6 @@ describe('lib/tasks/download', function () {
})

context('architecture detection', () => {
beforeEach(() => {
sinon.stub(os, 'arch')
})

context('Apple Silicon/M1', () => {
function nockDarwinArm64 () {
return nock('https://download.cypress.io')
Expand Down
3 changes: 3 additions & 0 deletions cli/test/spec_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ sinon.stub = function (obj, method) {

beforeEach(function () {
sinon.stub(os, 'platform')
sinon.stub(os, 'arch')
sinon.stub(os, 'release')
sinon.stub(util, 'getOsVersionAsync').resolves('Foo-OsVersion')

os.arch.returns('x64')
})

afterEach(function () {
Expand Down
12 changes: 12 additions & 0 deletions npm/eslint-plugin-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [@cypress/eslint-plugin-dev-v6.0.0](https://github.com/cypress-io/cypress/compare/@cypress/eslint-plugin-dev-v5.3.3...@cypress/eslint-plugin-dev-v6.0.0) (2024-05-06)


### breaking

* the supported eslint version is 8 for @cypress/eslint-plugin-dev. ([3b799a1](https://github.com/cypress-io/cypress/commit/3b799a158d7af419637d524e811561cd25143c3f))


### BREAKING CHANGES

* The supported eslint version is 8. @see f14a11aecfbc1e3854daae02b69fb40b4ec801b7 for breaking changes to the plugin.

# [@cypress/eslint-plugin-dev-v5.3.3](https://github.com/cypress-io/cypress/compare/@cypress/eslint-plugin-dev-v5.3.2...@cypress/eslint-plugin-dev-v5.3.3) (2024-01-12)


Expand Down
8 changes: 3 additions & 5 deletions npm/eslint-plugin-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ eslint-plugin-json-format
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
eslint-plugin-mocha
eslint-plugin-import

# if you have react/jsx files
eslint-plugin-react
Expand Down Expand Up @@ -94,6 +95,7 @@ _Should usually be used at the root of the package._

**requires you to install the following `devDependencies`**:
```sh
eslint-plugin-import
eslint-plugin-json-format
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
Expand Down Expand Up @@ -178,11 +180,7 @@ After installing, add the following to your User or Workspace (`.vscode/settings
{
"language": "json",
"autoFix": true
},
{
"language": "coffeescript",
"autoFix": false
},
}
],
}
```
Expand Down
2 changes: 2 additions & 0 deletions npm/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [@cypress/react-v8.0.1](https://github.com/cypress-io/cypress/compare/@cypress/react-v8.0.0...@cypress/react-v8.0.1) (2024-05-06)

# [@cypress/react-v8.0.0](https://github.com/cypress-io/cypress/compare/@cypress/react-v7.0.3...@cypress/react-v8.0.0) (2023-08-29)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "13.8.1",
"version": "13.9.0",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"private": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/data-context/src/actions/ProjectActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface ProjectApiShape {
emitter: EventEmitter
}
isListening: (url: string) => Promise<void>
resetBrowserTabsForNextTest(shouldKeepTabOpen: boolean): Promise<void>
resetBrowserTabsForNextSpec(shouldKeepTabOpen: boolean): Promise<void>
resetServer(): void
runSpec(spec: Cypress.Spec): Promise<void>
routeToDebug(runNumber: number): void
Expand Down Expand Up @@ -279,7 +279,7 @@ export class ProjectActions {

// Used for run-all-specs feature
if (options?.shouldLaunchNewTab) {
await this.api.resetBrowserTabsForNextTest(true)
await this.api.resetBrowserTabsForNextSpec(true)
this.api.resetServer()
}

Expand Down
15 changes: 15 additions & 0 deletions packages/driver/cypress/e2e/issues/23927.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://github.com/cypress-io/cypress/issues/23927
describe('issue 23927', { browser: '!webkit' }, () => {
it('Fails gracefully if origin page throws undefined', () => {
cy.visit('http://barbaz.com:3500/fixtures/generic.html')
cy.origin('http://foobar.com:3500', () => {
Cypress.on('uncaught:exception', (err, runnable) => {
expect(err.message).to.contain('An unknown error has occurred: undefined')

return false
})

cy.visit('http://foobar.com:3500/fixtures/throws-undefined.html')
})
})
})
13 changes: 13 additions & 0 deletions packages/driver/cypress/fixtures/throws-undefined.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Promise.reject undefined</title>
</head>

<body>
<h1> I am going to reject undefined in the document </h1>
</body>
<script>
Promise.reject(undefined)
</script>
</html>
31 changes: 21 additions & 10 deletions packages/driver/src/cypress/error_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,34 @@ const appendErrMsg = (err, errMsg) => {
})
}

const makeErrFromObj = (obj) => {
const makeErrFromObj = (obj: any) => {
if (_.isString(obj)) {
return new Error(obj)
}

const err2 = new Error(obj.message)
if (_.isObject(obj) && _.isString((obj as any).message) && _.isString((obj as any).name)) {
obj = obj as {
message: string
name: string
stack?: string
}

err2.name = obj.name
err2.stack = obj.stack
const err2 = new Error(obj.message)

_.each(obj, (val, prop) => {
if (!err2[prop]) {
err2[prop] = val
}
})
err2.name = (obj as any).name
err2.stack = (obj as any).stack

_.each(obj, (val, prop) => {
if (!err2[prop]) {
err2[prop] = val
}
})

return err2
}

return err2
// handle all other errors gracefully (e.g. a promise is rejected with undefined)
return new Error(`An unknown error has occurred: ${obj}`)
}

const makeErrFromErr = (err, options: any = {}) => {
Expand Down
12 changes: 6 additions & 6 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
"private": true,
"main": "index.js",
"scripts": {
"postinstall": "echo '@packages/example needs: yarn build'",
"build": "node ./bin/build.js && gulp build",
"clean-deps": "rimraf node_modules",
"predeploy": "yarn build",
"deploy": "gh-pages -d build -b gh-pages",
"postinstall": "echo '@packages/example needs: yarn build'",
"test": "yarn test-unit",
"test-e2e": "cypress run",
"test-unit": "echo 'no unit tests'",
"build": "node ./bin/build.js && gulp build",
"predeploy": "yarn build",
"deploy": "gh-pages -d build -b gh-pages"
"test-unit": "echo 'no unit tests'"
},
"devDependencies": {
"cross-env": "6.0.3",
"cypress-example-kitchensink": "2.0.6",
"cypress-example-kitchensink": "2.0.7",
"gh-pages": "5.0.0",
"gulp": "4.0.2",
"gulp-clean": "0.4.0",
Expand Down

0 comments on commit fa099df

Please sign in to comment.