Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/cypress-io/cypress into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
jennifer-shehane committed Aug 16, 2024
2 parents d4e0c60 + 482358b commit 98eb623
Show file tree
Hide file tree
Showing 21 changed files with 1,178 additions and 366 deletions.
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": "128.0.6613.27",
"chrome:beta": "128.0.6613.36",
"chrome:stable": "127.0.6533.119",
"chrome:minimum": "64.0.3282.0"
}
18 changes: 17 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.14.0

_Released 8/27/2024 (PENDING)_

**Performance:**

- Fixed a potential memory leak in the Cypress server when re-connecting to an unintentionally disconnected CDP connection. Fixes [#29744](https://github.com/cypress-io/cypress/issues/29744). Addressed in [#29988](https://github.com/cypress-io/cypress/pull/29988)

**Features:**

- Added a `CYPRESS_SKIP_VERIFY` flag to enable suppressing Cypress verification checks. Addresses [#22243](https://github.com/cypress-io/cypress/issues/22243).

**Dependency Updates:**

- Updated `detect-port` from `1.3.0` to `1.6.1`. Addressed in [#30038](https://github.com/cypress-io/cypress/pull/30038).

## 13.13.3

_Released 8/13/2024_
_Released 8/14/2024_

**Bugfixes:**

Expand Down
7 changes: 7 additions & 0 deletions cli/lib/tasks/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,15 @@ const start = (options = {}) => {
force: false,
welcomeMessage: true,
smokeTestTimeout: VERIFY_TEST_RUNNER_TIMEOUT_MS,
skipVerify: util.getEnv('CYPRESS_SKIP_VERIFY') === 'true',
})

if (options.skipVerify) {
debug('skipping verification of the Cypress app')

return Promise.resolve()
}

if (options.dev) {
return runSmokeTest('', options)
}
Expand Down
10 changes: 10 additions & 0 deletions cli/test/lib/tasks/verify_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ context('lib/tasks/verify', () => {
expect(newVerifyInstance.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.eql(DEFAULT_VERIFY_TIMEOUT)
})

it('returns early when `CYPRESS_SKIP_VERIFY` is set to true', () => {
process.env.CYPRESS_SKIP_VERIFY = 'true'
delete require.cache[require.resolve(`${lib}/tasks/verify`)]
const newVerifyInstance = require(`${lib}/tasks/verify`)

return newVerifyInstance.start().then((result) => {
expect(result).to.eq(undefined)
})
})

it('logs error and exits when no version of Cypress is installed', () => {
return verify
.start()
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@types/chai-enzyme": "0.6.7",
"@types/classnames": "2.2.9",
"@types/debug": "4.1.7",
"@types/detect-port": "^1.3.1",
"@types/detect-port": "^1.3.5",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/execa": "0.9.0",
"@types/fluent-ffmpeg": "^2.1.18",
Expand Down Expand Up @@ -143,7 +143,7 @@
"debug": "^4.3.4",
"dedent": "^0.7.0",
"del": "3.0.0",
"detect-port": "^1.3.0",
"detect-port": "^1.6.1",
"electron": "27.3.10",
"electron-builder": "^23.6.0",
"enzyme-adapter-react-16": "1.12.1",
Expand Down
26 changes: 4 additions & 22 deletions packages/driver/cypress/e2e/cy/timers.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
const startingIndex = Cypress.isBrowser('firefox') ? 1 : 0

const timerNumber = (n) => n + startingIndex

// NOTE: basically the same as a cy.wait(...) but uses setTimeout instead of Promise.delay
// since firefox will sometimes have `Promise.delay(10)` fire faster than a `setTimeout(..., 1)`
const cyWaitTimeout = (n) => cy.wrap(new Promise((resolve) => window.setTimeout(resolve, n)))
Expand All @@ -22,10 +18,6 @@ describe('driver/src/cy/timers', () => {

const id1 = win.setTimeout(win.setBar, 1)

// the timer id is 1 by default since
// timers increment and always start at 0
expect(id1).to.eq(timerNumber(1))

cy
.window().its('bar').should('eq', 'bar')
.log('setTimeout should not be called')
Expand All @@ -34,7 +26,7 @@ describe('driver/src/cy/timers', () => {

const id2 = win.setTimeout(win.setBar, 2)

expect(id2).to.eq(timerNumber(2))
expect(id2).to.eq(id1 + 1)

const ret = win.clearTimeout(id2)

Expand Down Expand Up @@ -73,10 +65,6 @@ describe('driver/src/cy/timers', () => {

const id1 = win.setInterval(win.setBar, 1)

// the timer id is 1 by default since
// timers increment and always start at 0
expect(id1).to.eq(timerNumber(1))

cy
.window().its('bar').should('eq', 'bar')
.log('setInterval should not be called')
Expand All @@ -87,7 +75,7 @@ describe('driver/src/cy/timers', () => {

const id2 = win.setInterval(win.setBar, 2)

expect(id2).to.eq(timerNumber(2))
expect(id2).to.eq(id1 + 1)

const ret = win.clearInterval(id2)

Expand Down Expand Up @@ -231,8 +219,6 @@ describe('driver/src/cy/timers', () => {
.then(() => {
const id1 = win.setTimeout(win.setBar, 1)

expect(id1).to.eq(timerNumber(1))

cyWaitTimeout(1)
.log('setTimeout should NOT have fired when paused')
.window().its('bar').should('be.null')
Expand All @@ -252,7 +238,7 @@ describe('driver/src/cy/timers', () => {
.then(() => {
const id2 = win.setTimeout(win.setBar, 1)

expect(id2).to.eq(timerNumber(2))
expect(id2).to.eq(id1 + 1)

const ret = win.clearTimeout(id2)

Expand Down Expand Up @@ -280,10 +266,6 @@ describe('driver/src/cy/timers', () => {

const id1 = win.setTimeout(win.setBar, 10)

// the timer id is 1 by default since
// timers increment and always start at 0
expect(id1).to.eq(timerNumber(1))

return cy.pauseTimers(true)
.then(() => {
cyWaitTimeout(10)
Expand All @@ -302,7 +284,7 @@ describe('driver/src/cy/timers', () => {

const id2 = win.setInterval(win.setBar, 10)

expect(id2).to.eq(timerNumber(2))
expect(id2).to.eq(id1 + 1)

return cy.pauseTimers(true)
.then(() => {
Expand Down
9 changes: 5 additions & 4 deletions packages/server/lib/browsers/browser-cri-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Debug from 'debug'
import type { Protocol } from 'devtools-protocol'
import { _connectAsync, _getDelayMsForRetry } from './protocol'
import * as errors from '../errors'
import type { CypressError } from '@packages/errors'
import { CriClient, DEFAULT_NETWORK_ENABLE_OPTIONS } from './cri-client'
import { serviceWorkerClientEventHandler, serviceWorkerClientEventHandlerName } from '@packages/proxy/lib/http/util/service-worker-manager'
import type { ProtocolManagerShape } from '@packages/types'
Expand All @@ -23,7 +24,7 @@ type BrowserCriClientOptions = {
host: string
port: number
browserName: string
onAsynchronousError: Function
onAsynchronousError: (err: CypressError) => void
protocolManager?: ProtocolManagerShape
fullyManageTabs?: boolean
onServiceWorkerClientEvent: ServiceWorkerEventHandler
Expand All @@ -33,7 +34,7 @@ type BrowserCriClientCreateOptions = {
browserName: string
fullyManageTabs?: boolean
hosts: string[]
onAsynchronousError: Function
onAsynchronousError: (err: CypressError) => void
onReconnect?: (client: CriClient) => void
port: number
protocolManager?: ProtocolManagerShape
Expand Down Expand Up @@ -181,7 +182,7 @@ export class BrowserCriClient {
private host: string
private port: number
private browserName: string
private onAsynchronousError: Function
private onAsynchronousError: (err: CypressError) => void
private protocolManager?: ProtocolManagerShape
private fullyManageTabs?: boolean
onServiceWorkerClientEvent: ServiceWorkerEventHandler
Expand Down Expand Up @@ -479,7 +480,7 @@ export class BrowserCriClient {
browserCriClient.onClose = resolve

// or when the browser's CDP ws connection is closed
browserClient.ws.once('close', () => {
browserClient.ws?.once('close', () => {
resolve(false)
})
})
Expand Down
Loading

0 comments on commit 98eb623

Please sign in to comment.