Skip to content

Commit

Permalink
Merge pull request #28595 from cypress-io/muaz/chore-merge-develop-in…
Browse files Browse the repository at this point in the history
…to-feat-burn-in

chore: merge develop into feature/test-burn-in
  • Loading branch information
MuazOthman authored Dec 29, 2023
2 parents f912953 + 1197a86 commit 43e5a5c
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 53 deletions.
10 changes: 5 additions & 5 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3566,23 +3566,23 @@ windows-workflow: &windows-workflow
- run-app-integration-tests-chrome:
name: windows-run-app-integration-tests-chrome
executor: windows
resource_class: windows.large
resource_class: windows.xlarge
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.large
resource_class: windows.xlarge
context: [test-runner:cypress-record-key, test-runner:launchpad-tests]
requires:
- windows-build

- unit-tests:
name: windows-unit-tests
executor: windows
resource_class: windows.large
resource_class: windows.medium
requires:
- windows-build

Expand Down Expand Up @@ -3614,13 +3614,13 @@ windows-workflow: &windows-workflow
- v8-integration-tests:
name: windows-v8-integration-tests
executor: windows
resource_class: windows.large
resource_class: windows.medium
requires:
- windows-build
- driver-integration-memory-tests:
name: windows-driver-integration-memory-tests
executor: windows
resource_class: windows.large
resource_class: windows.medium
requires:
- windows-build

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"json"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",

Expand Down
11 changes: 10 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.6.2

_Released 12/19/2023 (PENDING)_
_Released 12/26/2023_

**Bugfixes:**

- Fixed a regression in [`13.6.1`](https://docs.cypress.io/guides/references/changelog/13.6.1) where a malformed URI would crash Cypress. Fixes [#28521](https://github.com/cypress-io/cypress/issues/28521).
- Fixed a regression in [`12.4.0`](https://docs.cypress.io/guides/references/changelog/12.4.0) where erroneous `<br>` tags were displaying in error messages in the Command Log making them less readable. Fixes [#28452](https://github.com/cypress-io/cypress/issues/28452).

**Performance:**

- Improved performance when finding unique selectors for command log snapshots for Test Replay. Addressed in [#28536](https://github.com/cypress-io/cypress/pull/28536).

**Dependency Updates:**

- Updated ts-node from `10.9.1` to `10.9.2`. Cypress will longer error during `cypress run` or `cypress open` when using Typescript 5.3.2+ with `extends` in `tsconfig.json`. Addresses [#28385](https://github.com/cypress-io/cypress/issues/28385).

## 13.6.1

_Released 12/5/2023_
Expand Down
2 changes: 2 additions & 0 deletions npm/puppeteer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [@cypress/puppeteer-v0.1.2](https://github.com/cypress-io/cypress/compare/@cypress/puppeteer-v0.1.1...@cypress/puppeteer-v0.1.2) (2023-12-26)

# [@cypress/puppeteer-v0.1.1](https://github.com/cypress-io/cypress/compare/@cypress/puppeteer-v0.1.0...@cypress/puppeteer-v0.1.1) (2023-11-29)


Expand Down
2 changes: 1 addition & 1 deletion npm/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"semantic-release": "19.0.3",
"sinon": "^13.0.1",
"sinon-chai": "^3.7.0",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "4.7.4"
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions npm/vite-dev-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [@cypress/vite-dev-server-v5.0.7](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v5.0.6...@cypress/vite-dev-server-v5.0.7) (2023-12-26)

# [@cypress/vite-dev-server-v5.0.6](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v5.0.5...@cypress/vite-dev-server-v5.0.6) (2023-08-29)


Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dedent": "^0.7.0",
"mocha": "^9.2.2",
"sinon": "^13.0.1",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"vite": "4.3.2",
"vite-plugin-inspect": "0.7.24"
},
Expand Down
2 changes: 2 additions & 0 deletions npm/webpack-dev-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [@cypress/webpack-dev-server-v3.7.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v3.7.1...@cypress/webpack-dev-server-v3.7.2) (2023-12-26)

# [@cypress/webpack-dev-server-v3.7.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v3.7.0...@cypress/webpack-dev-server-v3.7.1) (2023-11-22)


Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"proxyquire": "2.1.3",
"sinon": "^13.0.1",
"snap-shot-it": "^7.9.6",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"webpack": "npm:webpack@^5",
"webpack-4": "npm:webpack@^4",
"webpack-dev-server-3": "npm:webpack-dev-server@^3"
Expand Down
2 changes: 2 additions & 0 deletions npm/webpack-preprocessor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [@cypress/webpack-preprocessor-v6.0.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v6.0.0...@cypress/webpack-preprocessor-v6.0.1) (2023-12-26)

# [@cypress/webpack-preprocessor-v6.0.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.17.1...@cypress/webpack-preprocessor-v6.0.0) (2023-08-29)


Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-preprocessor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"sinon": "^9.0.0",
"sinon-chai": "^3.5.0",
"snap-shot-it": "7.9.2",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"webpack": "^5.88.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "13.6.1",
"version": "13.6.2",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"private": true,
"scripts": {
Expand Down Expand Up @@ -207,7 +207,7 @@
"through": "2.3.8",
"through2": "^4.0.2",
"tree-kill": "1.2.2",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "4.7.4",
"yarn-deduplicate": "3.1.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@cypress/webpack-dev-server": "0.0.0-development",
"@cypress/webpack-preprocessor": "0.0.0-development",
"@cypress/what-is-circular": "1.0.1",
"@medv/finder": "3.1.0",
"@packages/config": "0.0.0-development",
"@packages/network": "0.0.0-development",
"@packages/rewriter": "0.0.0-development",
Expand Down
16 changes: 4 additions & 12 deletions packages/driver/src/cy/snapshots.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import $ from 'jquery'
import _ from 'lodash'
import uniqueSelector from '@cypress/unique-selector'
import type { $Cy } from '../cypress/cy'
import type { StateFunc } from '../cypress/state'
import $dom from '../dom'
import { create as createSnapshotsCSS } from './snapshots_css'
import { debug as Debug } from 'debug'

const debug = Debug('cypress:driver:snapshots')
import { finder } from '@medv/finder'

export const HIGHLIGHT_ATTR = 'data-cypress-el'

Expand Down Expand Up @@ -272,14 +269,9 @@ export const create = ($$: $Cy['$$'], state: StateFunc) => {
return []
}

const selector = uniqueSelector(el)

if (!selector) {
debug('could not find a unique selector for element %o', el)

return []
}

// finder tries to find the shortest unique selector to an element,
// but since we are more concerned with speed, we set the threshold to 1 and maxNumberOfTries to 0
const selector = finder(el, { root: ownerDoc.body, threshold: 1, maxNumberOfTries: 0 })
const frameId = elWindow['__cypressProtocolMetadata']?.frameId

return [{ selector, frameId }]
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"browser-logos": "github:alrra/browser-logos",
"combine-properties": "0.1.0",
"cross-env": "6.0.3",
"cypress-axe": "0.14.0",
"cypress-axe": "^1.5.0",
"cypress-plugin-tab": "1.0.5",
"cypress-real-events": "1.6.0",
"dayjs": "^1.9.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/network/lib/uri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - https://nodejs.org/api/url.html#url_url_format_urlobject

import _ from 'lodash'
import url, { URL } from 'url'
import url from 'url'

// yup, protocol contains a: ':' colon
// at the end of it (-______________-)
Expand Down
16 changes: 13 additions & 3 deletions packages/proxy/lib/http/util/prerequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ class QueueMap<T> {
}
}

const tryDecodeURI = (url: string) => {
// decodeURI can throw if the url is malformed
// in this case, we just return the original url
try {
return decodeURI(url)
} catch (e) {
return url
}
}

// This class' purpose is to match up incoming "requests" (requests from the browser received by the http proxy)
// with "pre-requests" (events received by our browser extension indicating that the browser is about to make a request).
// Because these come from different sources, they can be out of sync, arriving in either order.
Expand Down Expand Up @@ -148,7 +158,7 @@ export class PreRequests {

addPending (browserPreRequest: BrowserPreRequest) {
metrics.browserPreRequestsReceived++
const key = `${browserPreRequest.method}-${decodeURI(browserPreRequest.url)}`
const key = `${browserPreRequest.method}-${tryDecodeURI(browserPreRequest.url)}`
const pendingRequest = this.pendingRequests.shift(key)

if (pendingRequest) {
Expand Down Expand Up @@ -193,7 +203,7 @@ export class PreRequests {
}

addPendingUrlWithoutPreRequest (url: string) {
const key = `GET-${decodeURI(url)}`
const key = `GET-${tryDecodeURI(url)}`
const pendingRequest = this.pendingRequests.shift(key)

if (pendingRequest) {
Expand Down Expand Up @@ -236,7 +246,7 @@ export class PreRequests {
const proxyRequestReceivedTimestamp = performance.now() + performance.timeOrigin

metrics.proxyRequestsReceived++
const key = `${req.method}-${decodeURI(req.proxiedUrl)}`
const key = `${req.method}-${tryDecodeURI(req.proxiedUrl)}`
const pendingPreRequest = this.pendingPreRequests.shift(key)

if (pendingPreRequest) {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"tough-cookie": "4.1.3",
"trash": "5.2.0",
"tree-kill": "1.2.2",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"tslib": "2.3.1",
"underscore.string": "3.3.6",
"url-parse": "1.5.9",
Expand Down
29 changes: 29 additions & 0 deletions packages/server/test/integration/http_requests_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,35 @@ describe('Routes', () => {
expect(res.body).to.include('hello from bar!')
})
})

it('handles malformed URIs', function () {
this.timeout(1500)

nock(this.server.remoteStates.current().origin)
.get('/?foo=%A4')
.reply(200, 'hello from bar!', {
'Content-Type': 'text/html',
})

const requestPromise = this.rp({
url: 'http://www.github.com/?foo=%A4',
headers: {
'Accept-Encoding': 'identity',
},
})

this.networkProxy.addPendingBrowserPreRequest({
requestId: '1',
method: 'GET',
url: 'http://www.github.com/?foo=%A4',
})

return requestPromise.then((res) => {
expect(res.statusCode).to.eq(200)

expect(res.body).to.include('hello from bar!')
})
})
})

context('gzip', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"debug": "^4.3.4",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"tslib": "2.3.1",
"typescript-cached-transpile": "^0.0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/ensure-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# The Windows executor ships with nvm-windows 1.1.7, which has compatibility issues with node 16.14.2.
# When 1.1.7 is detected, we manually update to nvm-windows 1.1.9, which includes a fix for 16.14.2 support.
if [[ $PLATFORM == 'windows' && $(echo `nvm version`) == '1.1.7' ]]; then
curl -L -O https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip && tar -xvf nvm-noinstall.zip -C C:/ProgramData/nvm
curl -L -O https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-noinstall.zip && tar -xvf nvm-noinstall.zip -C C:/ProgramData/nvm
fi

node_version=$(cat .node-version)
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-mocha-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ console.log(`Looking for reports in ${REPORTS_PATH}`)
// https://circleci.com/blog/keep-environment-variables-private-with-secret-masking/
function isWhitelistedEnv (key, value) {
return ['true', 'false', 'TRUE', 'FALSE'].includes(value)
|| ['nodejs_version', 'CF_DOMAIN'].includes(key)
|| ['nodejs_version', 'CF_DOMAIN', 'SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES'].includes(key)
|| value.length < 4
}

Expand Down
Loading

0 comments on commit 43e5a5c

Please sign in to comment.