Skip to content

Commit

Permalink
Merge branch 'develop' into issue-8280
Browse files Browse the repository at this point in the history
Signed-off-by: Yashodhan Joshi <[email protected]>
  • Loading branch information
YJDoc2 committed Dec 10, 2024
2 parents 1709884 + e96593b commit b7a2224
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 196 deletions.
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"chrome:beta": "131.0.6778.33",
"chrome:stable": "131.0.6778.69",
"chrome:beta": "132.0.6834.32",
"chrome:stable": "131.0.6778.108",
"chrome:minimum": "64.0.3282.0"
}
14 changes: 11 additions & 3 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.16.1
## 13.16.2

_Released 11/26/2024 (PENDING)_
_Released 12/17/2024 (PENDING)_

**Bugfixes:**

- Support multiple imports of one module with multiple lines. Addressed in [#30314](https://github.com/cypress-io/cypress/pull/30314).
- Fixed an issue where targets may hang if `Network.enable` is not implemented for the target. Addresses [#29876](https://github.com/cypress-io/cypress/issues/29876).
- Prevent overwriting of video files on across multiple runs. Addresses [#8280](https://github.com/cypress-io/cypress/issues/8280). Addressed in [#30673](https://github.com/cypress-io/cypress/pull/30673).

## 13.16.1

_Released 12/03/2024_

**Bugfixes:**

- During recorded or parallel runs, execution will fail if Cypress is unable to confirm the creation of an instance instead of skipping the spec. Addresses [#30628](https://github.com/cypress-io/cypress/issues/30628).

## 13.16.0

_Released 11/19/2024_
Expand Down
19 changes: 5 additions & 14 deletions npm/grep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ Table of Contents
- [Debugging in the plugin](#debugging-in-the-plugin)
- [Debugging in the browser](#debugging-in-the-browser)
- [Examples](#examples)
- [See also](#see-also)
- [Migration guide](#migration-guide)
- [from v1 to v2](#from-v1-to-v2)
- [from v2 to v3](#from-v2-to-v3)
- [Videos & Blog Posts](#videos--blog-posts)
- [Blog posts](#blog-posts)
- [Small print](#small-print)
- [MIT License](#mit-license)

<!-- /MarkdownTOC -->

Expand Down Expand Up @@ -117,7 +113,7 @@ registerCypressGrep()
}
```

Installing the plugin via `setupNodeEvents()` is required to enable the [grepFilterSpecs](#grepfilterspecs) feature.
Installing the plugin via `setupNodeEvents()` is required to enable the [grepFilterSpecs](#pre-filter-specs-grepfilterspecs) feature.

## Usage Overview

Expand Down Expand Up @@ -320,7 +316,7 @@ describe('block with config tag', { tags: '@smoke' }, () => {})
--env grepTags=-@smoke
```

See the [cypress/integration/describe-tags-spec.js](./cypress/integration/describe-tags-spec.js) file.
See the [cypress/e2e/describe-tags-spec.js](./cypress/e2e/describe-tags-spec.js) file.

**Note:** global function `describe` and `context` are aliases and both supported by this plugin.

Expand Down Expand Up @@ -424,7 +420,7 @@ it('runs on deploy', { tags: 'smoke' }, () => {
This package comes with [src/index.d.ts](./src/index.d.ts) definition file that adds the property `tags` to the Cypress test overrides interface. Include this file in your specs or TS config settings. For example, you can load it using a reference comment

```js
// cypress/integration/my-spec.js
// cypress/e2e/my-spec.js
/// <reference types="@cypress/grep" />
```

Expand Down Expand Up @@ -559,11 +555,6 @@ To see how to debug this plugin, watch the video [Debug @cypress/grep Plugin](ht
- [cypress-grep-example](https://github.com/bahmutov/cypress-grep-example)
- [todo-graphql-example](https://github.com/bahmutov/todo-graphql-example)

## See also

- [cypress-select-tests](https://github.com/bahmutov/cypress-select-tests)
- [cypress-skip-test](https://github.com/cypress-io/cypress-skip-test)

## Migration guide

### from v1 to v2
Expand Down Expand Up @@ -599,5 +590,5 @@ Version >= 3 of @cypress/grep _only_ supports Cypress >= 10.

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet /
[open issue](https://github.com/cypress-io/cypress/issues) on Github.
Support: if you find any problems with this module,
[open issue](https://github.com/cypress-io/cypress/issues) on GitHub.
7 changes: 7 additions & 0 deletions npm/vite-plugin-cypress-esm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [@cypress/vite-plugin-cypress-esm-v1.1.2](https://github.com/cypress-io/cypress/compare/@cypress/vite-plugin-cypress-esm-v1.1.1...@cypress/vite-plugin-cypress-esm-v1.1.2) (2024-12-03)


### Bug Fixes

* support multiple imports of one module with multiple lines ([#30314](https://github.com/cypress-io/cypress/issues/30314)) ([12df40e](https://github.com/cypress-io/cypress/commit/12df40ed8c1101c5c4053a1fe63c06fcd2809bc7))

# [@cypress/vite-plugin-cypress-esm-v1.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-plugin-cypress-esm-v1.1.0...@cypress/vite-plugin-cypress-esm-v1.1.1) (2024-05-10)


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.16.0",
"version": "13.16.1",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"private": true,
"scripts": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/errors/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const AllCypressErrors = {
${fmt.highlightSecondary(arg1.response)}
Because you passed the ${fmt.flag(`--parallel`)} flag, this run cannot proceed because it requires a valid response from our servers.
Because you passed the ${fmt.flag(`--parallel`)} flag, this run cannot proceed since it requires a valid response from our servers.
${fmt.listFlags(arg1.flags, {
group: '--group',
Expand All @@ -188,6 +188,8 @@ export const AllCypressErrors = {
${fmt.highlightSecondary(arg1.response)}
Because you passed the ${fmt.flag(`--record`)} flag, this run cannot proceed since it requires a valid response from our servers.
${fmt.listFlags(arg1.flags, {
group: '--group',
ciBuildId: '--ciBuildId',
Expand Down
33 changes: 18 additions & 15 deletions packages/https-proxy/test/integration/proxy_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,31 @@ describe('Proxy', () => {
})
})

it('closes outgoing connections when client disconnects', function () {
it('closes outgoing connections when client disconnects', async function () {
this.sandbox.spy(net, 'connect')

return request({
await request({
strictSSL: false,
url: 'https://localhost:8444/replace',
proxy: 'http://localhost:3333',
resolveWithFullResponse: true,
})
.then(() => {
// ensure the outgoing socket created for this connection was destroyed
expect(net.connect).calledOnce

const socket = net.connect.getCalls()[0].returnValue
// ensure the outgoing socket created for this connection was destroyed
expect(net.connect).calledOnce

return new Promise((resolve) => {
const socket = net.connect.getCalls()[0].returnValue

// sometimes the close event happens before we can attach the listener, causing this test to flake
if (!socket.destroyed || !socket.readyState === 'closed') {
await new Promise((resolve) => {
socket.on('close', () => {
expect(socket.destroyed).to.be.true

resolve()
})
})
})
}
})

it('can boot the httpServer', () => {
Expand All @@ -127,7 +129,9 @@ describe('Proxy', () => {
})
})

context('generating certificates', () => {
context('generating certificates', function () {
this.retries(4)

it('reuses existing certificates', function () {
return request({
strictSSL: false,
Expand Down Expand Up @@ -270,13 +274,13 @@ describe('Proxy', () => {
process.env.npm_config_noproxy = 'just,some,nonsense'

process.env.NO_PROXY = ''
process.env.HTTP_PROXY = process.env.HTTPS_PROXY = 'http://localhost:9001'
process.env.HTTP_PROXY = process.env.HTTPS_PROXY = 'http://localhost:2222'

this.upstream = new DebugProxy({
keepRequests: true,
})

return this.upstream.start(9001)
return this.upstream.start(2222)
})

it('passes a request to an https server through the upstream', function () {
Expand Down Expand Up @@ -309,7 +313,7 @@ describe('Proxy', () => {
return true
}

process.env.HTTP_PROXY = (process.env.HTTPS_PROXY = 'http://foo:bar@localhost:9001')
process.env.HTTP_PROXY = process.env.HTTPS_PROXY = 'http://foo:bar@localhost:2222'

return request({
strictSSL: false,
Expand All @@ -335,10 +339,9 @@ describe('Proxy', () => {
expect(net.connect).calledOnce
const socket = net.connect.getCalls()[0].returnValue

// sometimes the close event happens before we can attach the listener,
// causing this test to flake
// sometimes the close event happens before we can attach the listener, causing this test to flake
if (!socket.destroyed || !socket.readyState === 'closed') {
return new Promise((resolve) => {
await new Promise((resolve) => {
socket.on('close', () => {
expect(socket.destroyed).to.be.true

Expand Down
5 changes: 2 additions & 3 deletions packages/server/lib/browsers/browser-cri-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,8 @@ export class BrowserCriClient {
try {
await browserClient.send('Runtime.runIfWaitingForDebugger', undefined, sessionId)
} catch (error) {
// it's possible that the target was closed before we could enable
// network and continue, in that case, just ignore
debug('error running Runtime.runIfWaitingForDebugger:', error)
// it's possible that the target was closed before we could tell it to run, in that case, just ignore
debug('error running Runtime.runIfWaitingForDebugger: %o', error)
}
}

Expand Down
16 changes: 10 additions & 6 deletions packages/server/lib/browsers/cri-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ export class CriClient implements ICriClient {
this._isChildTarget = !!this.host

if (this._isChildTarget) {
// If crash listeners are added at the browser level, tabs/page connections do not
// emit them.
// If crash listeners are added at the browser level, tabs/page connections do not emit them.
this.cdpConnection.on('Target.targetCrashed', async (event) => {
debug('crash event detected', event)
if (event.targetId !== this.targetId) {
Expand Down Expand Up @@ -368,13 +367,18 @@ export class CriClient implements ICriClient {
if (event.targetInfo.type !== 'service_worker' && event.targetInfo.type !== 'page' && event.targetInfo.type !== 'other') {
await this.cdpConnection.send('Network.enable', this.protocolManager?.networkEnableOptions ?? DEFAULT_NETWORK_ENABLE_OPTIONS, event.sessionId)
}
} catch (error) {
// it's possible that the target was closed before we could enable network, in that case, just ignore
debug('error attaching to target cri: %o', { error, event })
}

if (event.waitingForDebugger) {
if (event.waitingForDebugger) {
try {
await this.cdpConnection.send('Runtime.runIfWaitingForDebugger', undefined, event.sessionId)
} catch (error) {
// it's possible that the target was closed before we could tell it to run, in that case, just ignore
debug('error running Runtime.runIfWaitingForDebugger: %o', { error, event })
}
} catch (error) {
// it's possible that the target was closed before we could enable network and continue, in that case, just ignore
debug('error attaching to target cri', error)
}
}

Expand Down
28 changes: 13 additions & 15 deletions packages/server/lib/cloud/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,22 +458,20 @@ export default {
'platform',
])

return retryWithBackoff((attemptIndex) => {
return rp.post({
body,
url: recordRoutes.instances(runId),
json: true,
encrypt: preflightResult.encrypt,
timeout: timeout ?? SIXTY_SECONDS,
headers: {
'x-route-version': '5',
'x-cypress-run-id': runId,
'x-cypress-request-attempt': attemptIndex,
},
})
.catch(RequestErrors.StatusCodeError, formatResponseBody)
.catch(tagError)
return rp.post({
body,
url: recordRoutes.instances(runId),
json: true,
encrypt: preflightResult.encrypt,
timeout: timeout ?? SIXTY_SECONDS,
headers: {
'x-route-version': '5',
'x-cypress-run-id': runId,
'x-cypress-request-attempt': 0,
},
})
.catch(RequestErrors.StatusCodeError, formatResponseBody)
.catch(tagError)
},

postInstanceTests (options) {
Expand Down
Loading

0 comments on commit b7a2224

Please sign in to comment.