Skip to content

Commit

Permalink
Merge branch 'develop' into issue-29605v2
Browse files Browse the repository at this point in the history
  • Loading branch information
senpl authored Sep 30, 2024
2 parents 0b04205 + 80e70b8 commit a3fe83e
Show file tree
Hide file tree
Showing 226 changed files with 12,488 additions and 5,237 deletions.
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

08-13-24
09-12-24
17 changes: 8 additions & 9 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ mainBuildFilters: &mainBuildFilters
- /^release\/\d+\.\d+\.\d+$/
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'jquery-patch-remove-unload'
- 'ryanm/chore/fix-full-snapshot'
- 'publish-binary'
- 'chore/use_build_docker_file_for_centos7'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -43,7 +42,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'fix/webpack-batteries-included-for-yarn-pnp', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/fix-full-snapshot', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -54,8 +53,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'chore/use_build_docker_file_for_centos7', << pipeline.git.branch >> ]
- equal: [ 'jquery-patch-remove-unload', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/fix-full-snapshot', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -78,7 +76,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'fix/webpack-batteries-included-for-yarn-pnp', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/fix-full-snapshot', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -87,7 +85,7 @@ executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers-internal:node18.17.1-chrome124-ff125
- image: cypress/browsers-internal:node18.17.1-chrome128-ff130
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
Expand All @@ -106,7 +104,7 @@ executors:
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/browsers-internal:node18.17.1-chrome124-ff125
- image: cypress/browsers-internal:node18.17.1-chrome128-ff130
user: node
environment:
PLATFORM: linux
Expand Down Expand Up @@ -154,7 +152,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/use_build_docker_file_for_centos7" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/chore/fix-full-snapshot" ]]; then
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
Expand Down Expand Up @@ -2311,6 +2309,7 @@ jobs:
- run:
name: Run Kitchensink example project
command: |
source ./scripts/ensure-node.sh
CYPRESS_PROJECT_ID=$TEST_KITCHENSINK_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_KITCHENSINK_RECORD_KEY \
CYPRESS_INTERNAL_ENV=staging \
Expand Down
35 changes: 8 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Thanks for taking the time to contribute! :smile:

- [Report bugs](https://github.com/cypress-io/cypress/issues/new) by opening an issue.
- [Request features](https://github.com/cypress-io/cypress/issues/new) by opening an issue.
- [Help triage existing issues](#triaging-issues).
- Write code to address an issue. We have some issues labeled as [`good first issue`](https://github.com/cypress-io/cypress/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) that are a good place to start. Please thoroughly read our [Writing Code guide](#writing-code).

## Table of Contents
Expand All @@ -26,19 +25,19 @@ Thanks for taking the time to contribute! :smile:
- [Requirements](#requirements)
- [Getting Started](#getting-started)
- [Coding Style](#coding-style)
- [Adding links within code](#Adding-links-within-code)
- [Adding links within code](#adding-links-within-code)
- [Tests](#tests)
- [Packages](#packages)
- [Committing Code](#committing-code)
- [Branches](#branches)
- [Pull Requests](#pull-requests)
- [Dependencies](#dependencies)
- [Reviewing Code](#reviewing-code)
- [Some rules about Code Review](#Some-rules-about-Code-Review)
- [Steps to take during Code Review](#Steps-to-take-during-Code-Review)
- [Code Review Checklist](#Code-Review-Checklist)
- [Code Review of Dependency Updates](#Code-Review-of-Dependency-Updates)
- [Deployment](#deployment)
- [Some rules about Code Review](#some-rules-about-code-review)
- [Steps to take during Code Review](#steps-to-take-during-code-review)
- [Code Review Checklist](#code-review-checklist)
- [Code Review of Dependency Updates](#code-review-of-dependency-updates)
- [Releases](#releases)

## Code of Conduct

Expand Down Expand Up @@ -172,7 +171,7 @@ Here is a list of the packages in this repository with a short description, loca

| Folder Name | Package Name | Purpose |
| :------------------------------------ | :---------------------- | :--------------------------------------------------------------------------- |
| [electron-mksnapshot](./electron-mksnapshot) | `electron-mksnapshot` | A rewrite of [electron/mksnapshot](https://github.com/electron/mksnapshot) to support multiple versions. |
| [electron-mksnapshot](./tooling/electron-mksnapshot) | `electron-mksnapshot` | A rewrite of [electron/mksnapshot](https://github.com/electron/mksnapshot) to support multiple versions. |
| [packherd](./tooling/packherd) | `packherd` | Herds all dependencies reachable from an entry and packs them. |
| [v8-snapshot](./tooling/v8-snapshot) | `v8-snapshot` | Tool to create a snapshot for Electron applications. |

Expand Down Expand Up @@ -212,7 +211,7 @@ You must have the following installed on your system to contribute locally:

`sudo apt install g++ make` meets the additional requirements to run `node-gyp` in the context of building Cypress from source.
`python` is pre-installed on Debian-based systems including Ubuntu.
The Python versions shipped with Ubuntu versions `20.04`, `23.10` and `22.04` are compatible with Cypress requirements.
The Python versions shipped with Ubuntu versions `20.04` and `22.04` are compatible with Cypress requirements.

Only on Ubuntu `24.04` install Python `3.11` by executing the following commands:

Expand Down Expand Up @@ -406,24 +405,6 @@ There is a script [scripts/run-docker-local.sh](scripts/run-docker-local.sh) tha

The image will start and will map the root of the repository to `/cypress` inside the image. Now you can modify the files using your favorite environment and rerun tests inside the docker environment.

#### Docker for built binary

You can also use Docker to simulate and debug the built binary. In a temporary folder (for example from the folder `/tmp/test-folder/`) start a Docker image:

```shell
$ docker run -it -w /app -v $PWD:/app cypress/base:8 /bin/bash
```

Point the installation at a specific beta binary and NPM package archive (if needed) and _set local cache folder_ to unzip the downloaded binary into a subfolder.

```shell
$ export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/.../cypress.zip
$ export CYPRESS_CACHE_FOLDER=./cypress-cache
$ yarn add https://cdn.cypress.io/beta/npm/.../cypress.tgz
```

Note that unzipping the Linux binary inside a Docker container onto a mapped volume drive is *slow*. But once this is done you can modify the application resource folder in the local folder `/tmp/test-folder/node_modules/cypress/cypress-cache/3.3.0/Cypress/resources/app` to debug issues.

#### Docker as a performance constrained environment

Sometimes performance issues are easier to reproduce in performance constrained environments. A docker container can be a good way to simulate this locally and allow for quick iteration.
Expand Down
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": "128.0.6613.36",
"chrome:stable": "127.0.6533.119",
"chrome:beta": "130.0.6723.19",
"chrome:stable": "129.0.6668.70",
"chrome:minimum": "64.0.3282.0"
}
74 changes: 70 additions & 4 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,81 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.14.0
## 14.01.0

_Released 10/30/2024 (PENDING)_
_Released 10/31/2024 (PENDING)_

**Bugfixes:**

- Fixed an issue where Cypress incorrectly uses the box model of elements that have display:contents when determining visibility of child elements. Fixes [#29605](https://github.com/cypress-io/cypress/issues/29605).

## 13.13.4
## 13.15.0

_Released 9/25/2024_

**Features:**

- Cypress now displays more actionable errors when a Test Replay upload takes too long, and more verbose messages when uncategorized errors occur during the upload process. Addressed in [#30235](https://github.com/cypress-io/cypress/pull/30235).

**Bugfixes:**

- Fixed an issue where Firefox was incorrectly mutating the state of click events on checkboxes after Firefox version `129` and up. Addressed in [#30245](https://github.com/cypress-io/cypress/pull/30245).
- Fixed a regression introduced in 13.13.0 where 'Open in IDE' would not work for filepaths containing spaces and various other characters on Windows. Addresses [#29820](https://github.com/cypress-io/cypress/issues/29820).

**Misc:**

- Pass along the related log to the `createSnapshot` function for protocol usage. Addressed in [#30244](https://github.com/cypress-io/cypress/pull/30244).

**Dependency Updates:**

- Update `@cypress/request` from `3.0.1` to `3.0.4`. Addressed in [#30194](https://github.com/cypress-io/cypress/pull/30194).
- Updated `express` from `4.19.2` to `4.21.0`. This removes the [CVE-2024-43796](https://www.cve.org/CVERecord?id=CVE-2024-43796), [CVE-2024-45590](https://www.cve.org/CVERecord?id=CVE-2024-45590), and [CVE-2024-43800](https://www.cve.org/CVERecord?id=CVE-2024-43800) vulnerabilities being reported in security scans. Addresses [#30241](https://github.com/cypress-io/cypress/pull/30241).
- Update `launch-editor` from `2.8.0` to `2.9.1`. Addressed in [#30247](https://github.com/cypress-io/cypress/pull/30247).
- Updated `loader-utils` from `1.4.0` to `1.4.2`. This removes the [CVE-2022-37601](https://nvd.nist.gov/vuln/detail/CVE-2022-37601) vulnerability being reported in security scans. Addresses [#28208](https://github.com/cypress-io/cypress/issues/28208).
- Updated `send` from `0.17.1` to `0.19.0`. This removes the [CVE-2024-43799](https://www.cve.org/CVERecord?id=CVE-2024-43799) vulnerability being reported in security scans. Addressed in [#30241](https://github.com/cypress-io/cypress/pull/30241).

## 13.14.2

_Released 9/4/2024_

**Bugfixes:**

- Fixed an issue where Cypress could crash with a `WebSocket Connection Closed` error. Fixes [#30100](https://github.com/cypress-io/cypress/issues/30100).
- Fixed an issue where `cy.screenshot()` was timing out and Cypress was failing to start due to `GLib-GIO-ERROR` error. Reverts [#30109](https://github.com/cypress-io/cypress/pull/30109), the change to allow HiDPI screen for Wayland users. Fixes [#30172](https://github.com/cypress-io/cypress/issues/30172) and [#30160](https://github.com/cypress-io/cypress/issues/30160).

## 13.14.1

_Released 8/29/2024_

**Bugfixes:**

- Fixed an issue where no description was available for the `experimentalJustInTimeCompile` feature inside the Cypress application settings page. Addresses [#30126](https://github.com/cypress-io/cypress/issues/30126).

## 13.14.0

_Released 8/27/2024_

**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 new
[`experimentalJustInTimeCompile`](https://docs.cypress.io/guides/references/experiments#Configuration)
configuration option for component testing. This option will only compile resources directly related to your spec, compiling them 'just-in-time' before spec execution. This should result in improved memory management and performance for component tests in `cypress open` and `cypress run` modes, in particular for large component testing suites. [`experimentalJustInTimeCompile`](https://docs.cypress.io/guides/references/experiments#Configuration) is currently supported for [`webpack`](https://www.npmjs.com/package/webpack) and [`vite`](https://www.npmjs.com/package/vite). Addresses [#29244](https://github.com/cypress-io/cypress/issues/29244).
- `.type({upArrow})` and `.type({downArrow})` now also works for date, month, week, time, datetime-local and range input types. Addresses [#29665](https://github.com/cypress-io/cypress/issues/29665).
- Added a `CYPRESS_SKIP_VERIFY` flag to enable suppressing Cypress verification checks. Addresses [#22243](https://github.com/cypress-io/cypress/issues/22243).
- Updated the protocol to allow making Cloud API requests. Addressed in [#30066](https://github.com/cypress-io/cypress/pull/30066).
- Passing `--browser` flag alone will automatically launch browser after being guided through project and/or testing type selection. Addressed in [#28538](https://github.com/cypress-io/cypress/pull/28538).

**Bugfixes:**

- Fixed an issue where files outside the Cypress project directory were not calculating the bundle output path correctly for the `file:preprocessor`. Addresses [#8599](https://github.com/cypress-io/cypress/issues/8599).
- Fixed an issue where Cypress would not run if Node.js version `22.7.0` was being used with TypeScript and ES Modules. Fixes [#30084](https://github.com/cypress-io/cypress/issues/30084).
- Correctly determines current browser family when choosing between `unload` and `pagehide` options in App Runner. Fixes [#29880](https://github.com/cypress-io/cypress/issues/29880).

**Misc:**

_Released 8/27/2024 (PENDING)_
- Allow HiDPI screen running Wayland to use Cypress window/browser by adding `--ozone-platform-hint=auto` flag to Electron's runtime argument. Addresses [#20891](https://github.com/cypress-io/cypress/issues/20891).

**Dependency Updates:**

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
8 changes: 4 additions & 4 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"unit": "cross-env BLUEBIRD_DEBUG=1 NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json"
},
"dependencies": {
"@cypress/request": "^3.0.1",
"@cypress/request": "^3.0.4",
"@cypress/xvfb": "^1.2.4",
"@types/sinonjs__fake-timers": "8.1.1",
"@types/sizzle": "^2.3.2",
Expand Down Expand Up @@ -64,8 +64,8 @@
"yauzl": "^2.10.0"
},
"devDependencies": {
"@babel/cli": "7.24.5",
"@babel/preset-env": "7.24.5",
"@babel/cli": "7.24.8",
"@babel/preset-env": "7.25.3",
"@cypress/angular": "0.0.0-development",
"@cypress/angular-signals": "0.0.0-development",
"@cypress/grep": "0.0.0-development",
Expand All @@ -91,7 +91,7 @@
"chai-string": "1.5.0",
"cross-env": "7.0.3",
"dependency-check": "4.1.0",
"dtslint": "4.0.7",
"dtslint": "4.2.1",
"execa-wrap": "1.4.0",
"hasha": "5.2.2",
"mocha": "6.2.2",
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
8 changes: 8 additions & 0 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,14 @@ declare namespace Cypress {
* @default null
*/
experimentalSkipDomainInjection: string[] | null
/**
* Allows for just-in-time compiling of a component test, which will only compile assets related to the component.
* This results in a smaller bundle under test, reducing resource constraints on a given machine. This option is recommended
* for users with large component testing projects and those who are running into webpack 'chunk load error' issues.
* Supported for vite and webpack. For component testing only.
* @see https://on.cypress.io/experiments#Configuration
*/
experimentalJustInTimeCompile: boolean
/**
* Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
* @default false
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
dev:
image: cypress/browsers:latest
Expand Down
10 changes: 5 additions & 5 deletions guides/building-release-artifacts.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Building Release Artifacts

The `cypress` NPM package consists of two main parts:
The `cypress` npm package consists of two main parts:

1. The `cypress` NPM package `.tgz` (built from [`cli`](../cli))
1. The `cypress` npm package `.tgz` (built from [`cli`](../cli))
* Contains the command line tool `cypress`, type definitions, and the [Module API](https://on.cypress.io/module-api).
* End users install this via NPM to the project's `node_modules`.
2. The "binary" `.zip` (built from [`packages/server`](../packages/server))
* Contains the Electron app, `ffmpeg`, and built versions of the [`server`](../packages/server), [`desktop-gui`](../packages/desktop-gui), [`runner`](../packages/runner), [`example` project](../packages/example), and [`extension`](../packages/extension)
* End users install this via npm to the project's `node_modules` directory or via Yarn or pnpm similarly.
2. The "binary" `.zip` (built from the [`packages`](../packages) directory)
* Contains the Electron app, `ffmpeg`, and built versions of the packages from the [`packages`](../packages) sub-directories (`frontend-shared`, `reporter` and `web-config` are not separately included).
* Also contains all the production dependencies of the above.
* This is installed when the `cli` is installed or when `cypress install` is run, to a system cache.

Expand Down
2 changes: 1 addition & 1 deletion guides/debug-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ localStorage.DEBUG = 'cypress:driver,cypress:driver:*'

For more info, see the [public documentation for printing debug logs](https://docs.cypress.io/guides/references/troubleshooting#Print-DEBUG-logs) and the [`debug` module docs][debug]

[debug]: https://github.com/visionmedia/debug#readme
[debug]: https://github.com/debug-js/debug#readme
2 changes: 1 addition & 1 deletion guides/writing-cross-platform-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This will stop developers on Windows from running `yarn clean` unless they are s
```json
{
"devDependencies": {
"rimraf": "3.0.2",
"rimraf": "5.0.10"
},
"scripts": {
"clean": "rimraf '**/*.js'"
Expand Down
Loading

0 comments on commit a3fe83e

Please sign in to comment.