diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 1dd4a2276a03..c33910231309 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -11-5-24 +11-6-24 diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 68996b55bf1c..dbacc09a4ffe 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -30,7 +30,7 @@ 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' - - 'chore/update_reporter_mobx' + - 'breaking/remove_vue2_support' - 'publish-binary' # usually we don't build Mac app - it takes a long time @@ -42,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: [ 'chore/update_reporter_mobx', << pipeline.git.branch >> ] + - equal: [ 'breaking/remove_vue2_support', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -53,7 +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/update_reporter_mobx', << pipeline.git.branch >> ] + - equal: [ 'breaking/remove_vue2_support', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -76,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: [ 'chore/update_reporter_mobx', << pipeline.git.branch >> ] + - equal: [ 'breaking/remove_vue2_support', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -85,7 +85,7 @@ executors: # the Docker image with Cypress dependencies and Chrome browser cy-doc: docker: - - image: cypress/browsers-internal:node18.17.1-chrome128-ff131 + - image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131 # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed. resource_class: medium environment: @@ -94,7 +94,7 @@ executors: kitchensink-executor: docker: - - image: cypress/browsers-internal:node20.15.0-chrome126-ff131 + - image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131 # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed. resource_class: medium environment: @@ -104,7 +104,7 @@ executors: # Docker image with non-root "node" user non-root-docker-user: docker: - - image: cypress/browsers-internal:node18.17.1-chrome128-ff131 + - image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131 user: node environment: PLATFORM: linux @@ -136,7 +136,7 @@ executors: linux-arm64: &linux-arm64-executor machine: - image: ubuntu-2004:2023.07.1 + image: ubuntu-2004:2024.05.1 resource_class: arm.medium environment: PLATFORM: linux @@ -152,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/update_reporter_mobx" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "breaking/remove_vue2_support" ]]; 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 @@ -361,7 +361,7 @@ commands: steps: - restore_cache: name: Restore cache state, to check for known modules cache existence - key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7 + key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-better-sqlite3 - unless: condition: <> steps: @@ -383,6 +383,24 @@ commands: - run: name: Install Node Modules command: | + if [[ `node ./scripts/get-platform-key.js` == 'linux-arm64' ]]; then + # Building better-sqlite3 on arm64 requires gcc-10 + # on Arm, CI runs as non-root so we need to use sudo + sudo apt install gcc-10 g++-10 + + # Update default to gcc-10 and g++-10 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30 + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 + sudo update-alternatives --set cc /usr/bin/gcc + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 + sudo update-alternatives --set c++ /usr/bin/g++ + sudo update-alternatives --config gcc + sudo update-alternatives --config g++ + + # If we are on arm64 we need to install setuptools as it no longer comes standard with the latest version of python + pip install setuptools + fi source ./scripts/ensure-node.sh # avoid installing Percy's Chromium every time we use @percy/cli # https://docs.percy.io/docs/caching-asset-discovery-browser-in-ci @@ -420,7 +438,7 @@ commands: steps: - save_cache: name: Saving node-modules cache state key - key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7 + key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-better-sqlite3 paths: - node_modules_installed - unless: @@ -513,33 +531,32 @@ commands: echo "Location of Google Chrome Installation: `which google-chrome-<>`" echo "Google Chrome Version: `google-chrome-<> --version`" - # This code builds better-sqlite3 on CentOS 7. This is necessary because CentOS 7 has the oldest glibc version - # that we support. This job uses the cypress/centos7-builder https://hub.docker.com/repository/docker/cypress/centos7-builder/general - # image to build better-sqlite3 against an older version of glibc (2.17). - # Since this is running Docker remote, we need to copy the project into the container, and copy the built plugin out - # of the container because the host running docker does not have access to the project directory so volume mounts are - # not possible. The built plugin is copied to the project directory so it can be injected into the final binary. + # This code builds better-sqlite3 on Debian 10 (Buster). This is necessary because Debian 10 has the oldest glibc version (2.28) that we support. + # + # Since this is running Docker remote (because the job running the command may not be using an executor with the appropriate glibc version), we need to + # copy the project into the container, and copy the built plugin out of the container because the host running docker does not have access to the + # project directory so volume mounts are not possible. The built plugin is copied to the project directory so it can be injected into the final binary. build-better-sqlite3: - description: Build better-sqlite3 for CentOS 7 + description: Build better-sqlite3 for glibc 2.28 steps: - setup_remote_docker - run: - name: Build better-sqlite3 for CentOS 7 + name: Build better-sqlite3 for glibc 2.28 command: | if [[ ! -f better_sqlite3.node ]]; then set -x apt update && apt install -y docker.io - docker run -d --name centos7-builder cypress/centos7-builder:latest /bin/bash -c "sleep 1000000000" - docker cp ~/cypress/node_modules/better-sqlite3 centos7-builder:/better-sqlite3 - docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 27.1.3 --include-regex 'better_sqlite3.node$'" - docker cp centos7-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node - docker rm -f centos7-builder + docker run -d --name better-sqlite3-builder cypress/base-internal:20.15.0-buster-python3.8-gcc-10.5 /bin/bash -c "sleep 1000000000" + docker cp ~/cypress/node_modules/better-sqlite3 better-sqlite3-builder:/better-sqlite3 + docker exec -it better-sqlite3-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 32.2.0 --include-regex 'better_sqlite3.node$'" + docker cp better-sqlite3-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node + docker rm -f better-sqlite3-builder cp ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/better_sqlite3.node else cp ~/cypress/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node fi - save_cache: - key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-centos7 + key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }} paths: - better_sqlite3.node - run: @@ -1280,7 +1297,7 @@ commands: command: ls -la types working_directory: cli/build - run: - command: ls -la vue vue2 mount-utils react + command: ls -la vue mount-utils react working_directory: cli/build - unless: condition: @@ -1783,7 +1800,7 @@ jobs: working_directory: ~/cypress docker: # we need an image with yarn 4 berry installed on it to run this test - - image: cypress/base-internal:18.17.1-yarn-berry + - image: cypress/base-internal:20.18.0-yarn-berry environment: # needed to inform the bootstrap-docker-container.sh script to link the binary in the system-test project directory REPO_DIR: /root/cypress diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml index 2f269318a1d8..50b3b350d544 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml @@ -43,7 +43,7 @@ body: attributes: label: Node version description: What version of node.js are you using to run Cypress? - placeholder: ex. v18.17.0 + placeholder: ex. v20.18.0 validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/2-memory-issue.yml b/.github/ISSUE_TEMPLATE/2-memory-issue.yml index 28e5bbabb1a2..9af01f83121d 100644 --- a/.github/ISSUE_TEMPLATE/2-memory-issue.yml +++ b/.github/ISSUE_TEMPLATE/2-memory-issue.yml @@ -51,7 +51,7 @@ body: attributes: label: Node version description: What version of node.js are you using to run Cypress? - placeholder: ex. v18.17.0 + placeholder: ex. v20.18.0 validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/3-install-issue.yml b/.github/ISSUE_TEMPLATE/3-install-issue.yml index 6e513901e5fc..5298df42b260 100644 --- a/.github/ISSUE_TEMPLATE/3-install-issue.yml +++ b/.github/ISSUE_TEMPLATE/3-install-issue.yml @@ -38,7 +38,7 @@ body: attributes: label: Node version description: What version of node.js are you using to run Cypress? - placeholder: ex. v18.17.0 + placeholder: ex. v20.18.0 validations: required: true - type: dropdown diff --git a/.github/workflows/snyk_sca_scan.yaml b/.github/workflows/snyk_sca_scan.yaml index 45f504bf3a4f..608be5ec7a83 100644 --- a/.github/workflows/snyk_sca_scan.yaml +++ b/.github/workflows/snyk_sca_scan.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - name: Checkout uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: 'yarn' - name: Run yarn run: yarn diff --git a/.github/workflows/snyk_static_analysis_scan.yaml b/.github/workflows/snyk_static_analysis_scan.yaml index 58596a407c8f..b0e0087f1ddb 100644 --- a/.github/workflows/snyk_static_analysis_scan.yaml +++ b/.github/workflows/snyk_static_analysis_scan.yaml @@ -21,7 +21,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: 'yarn' - name: Run yarn run: yarn diff --git a/.github/workflows/update-browser-versions.yml b/.github/workflows/update-browser-versions.yml index 330464273fbb..935ffc247c4a 100644 --- a/.github/workflows/update-browser-versions.yml +++ b/.github/workflows/update-browser-versions.yml @@ -30,7 +30,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Check for new Chrome versions id: get-versions uses: actions/github-script@v7 diff --git a/.github/workflows/update_v8_snapshot_cache.yml b/.github/workflows/update_v8_snapshot_cache.yml index 9b35272ad80c..e3fc5f35d2b3 100644 --- a/.github/workflows/update_v8_snapshot_cache.yml +++ b/.github/workflows/update_v8_snapshot_cache.yml @@ -88,7 +88,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: 'yarn' - name: Run yarn # set the timeout here to try and deal with Windows slowness diff --git a/.gitignore b/.gitignore index 326b00acfcfa..c9029608e3d6 100644 --- a/.gitignore +++ b/.gitignore @@ -293,9 +293,6 @@ typings/ # next.js build output .next -# nuxt.js build output -.nuxt - # rollup.js default build output dist/ diff --git a/.node-version b/.node-version index 4a1f488b6c3b..2a393af592b8 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.17.1 +20.18.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index c387bf62a53c..0bd17c07c3a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ - [`@cypress/svelte`](https://github.com/cypress-io/cypress/blob/develop/npm/svelte/CHANGELOG.md) - [`@cypress/vite-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/vite-dev-server/CHANGELOG.md) - [`@cypress/vue`](https://github.com/cypress-io/cypress/blob/develop/npm/vue/CHANGELOG.md) -- [`@cypress/vue2`](https://github.com/cypress-io/cypress/blob/develop/npm/vue2/CHANGELOG.md) - [`@cypress/webpack-batteries-included-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-batteries-included-preprocessor/CHANGELOG.md) - [`@cypress/webpack-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/CHANGELOG.md) - [`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-preprocessor/CHANGELOG.md) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 597e3979202c..cc89b8bc1db2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -192,7 +192,6 @@ Here is a list of the npm packages in this repository: | [svelte](./npm/svelte) | `@cypress/svelte` | Cypress component testing for Svelte. | | [vite-dev-server](./npm/vite-dev-server) | `@cypress/vite-dev-server` | Vite powered dev server for Component Testing. | | [vue](./npm/vue) | `@cypress/vue` | Cypress component testing for Vue 3. | - | [vue2](./npm/vue2) | `@cypress/vue2` | Cypress component testing for Vue 2. | | [webpack-batteries-included-preprocessor](./npm/webpack-batteries-included-preprocessor) | `@cypress/webpack-batteries-included-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack with dependencies included and support for various ES features, TypeScript, and CoffeeScript. | | [webpack-dev-server](./npm/webpack-dev-server) | `@cypress/webpack-dev-server` | Webpack powered dev server for Component Testing. | | [webpack-preprocessor](./npm/webpack-preprocessor) | `@cypress/webpack-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack. | diff --git a/cli/.eslintignore b/cli/.eslintignore index a0fd3df705de..5132064ff61c 100644 --- a/cli/.eslintignore +++ b/cli/.eslintignore @@ -14,6 +14,5 @@ package.json /react /react18 /vue -/vue2 /svelte /mount-utils \ No newline at end of file diff --git a/cli/.gitignore b/cli/.gitignore index 81806971abcd..c6cf7aaf489a 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -16,7 +16,6 @@ build # ignore packages synced at build-time via # the sync-exported-npm-with-cli.js script vue -vue2 react* mount-utils angular diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index e0583405be4b..cc50d17a4f1f 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,4 +1,44 @@ +## 14.0.0 + +_Released 12/3/2024 (PENDING)_ + +**Breaking Changes:** + +- Removed support for Node.js 16 and Node.js 21. Addresses [#29930](https://github.com/cypress-io/cypress/issues/29930). +- Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc <2.28, for example: Ubuntu 14-18, RHEL 7, CentOS 7, Amazon Linux 2. Addresses [#29601](https://github.com/cypress-io/cypress/issues/29601). +- Cypress now only officially supports the latest 3 major versions of Chrome, Firefox, and Edge - older browser versions may still work, but we recommend keeping your browsers up to date to ensure compatibility with Cypress. A warning will no longer be displayed on browser selection in the Launchpad for any 'unsupported' browser versions. Additionally, the undocumented `minSupportedVersion` property has been removed from `Cypress.browser`. Addressed in [#30462](https://github.com/cypress-io/cypress/pull/30462). +- The `delayMs` option of `cy.intercept()` has been removed. This option was deprecated in Cypress 6.4.0. Please use the `delay` option instead. Addressed in [#30463](https://github.com/cypress-io/cypress/pull/30463). +- The `experimentalFetchPolyfill` configuration option was removed. This option was deprecated in Cypress 6.0.0. We recommend using `cy.intercept()` for handling fetch requests. Addressed in [#30466](https://github.com/cypress-io/cypress/pull/30466). +- We removed yielding the second argument of `before:browser:launch` as an array of browser arguments. This behavior has been deprecated since Cypress 4.0.0. Addressed in [#30460](https://github.com/cypress-io/cypress/pull/30460). +- The `cypress open-ct` and `cypress run-ct` CLI commands were removed. Please use `cypress open --component` or `cypress run --component` respectively instead. Addressed in [#30456](https://github.com/cypress-io/cypress/pull/30456) +- The undocumented methods `Cypress.backend('firefox:force:gc')` and `Cypress.backend('log:memory:pressure')` were removed. Addresses [#30222](https://github.com/cypress-io/cypress/issues/30222). +- Upgraded bundled Node.js version from `18.17.0` to `20.18.0`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547). +- It is no longer possible to make a `fetch` or `XMLHttpRequest` request from the `about:blank` page in Electron (i.e. `cy.window().then((win) => win.fetch('')`). You must use `cy.request` instead or perform some form of initial navigation via `cy.visit()`. Addressed in [#29547](https://github.com/cypress-io/cypress/pull/30394). +- `@cypress/webpack-dev-server` no longer supports `webpack-dev-server` version 3. Additionally, `@cypress/webpack-dev-server` now ships with `webpack-dev-server` version 5 by default. `webpack-dev-server` version 4 will need to be installed along side Cypress if you are still using `webpack` version 4. Addresses [#29308](https://github.com/cypress-io/cypress/issues/29308), [#30347](https://github.com/cypress-io/cypress/issues/30347), and [#30141](https://github.com/cypress-io/cypress/issues/30141). +- `@cypress/vite-dev-server` no longer supports `vite` versions 2 and 3. Addresses [#29377](https://github.com/cypress-io/cypress/issues/29377) and [#29378](https://github.com/cypress-io/cypress/issues/29378). +- Cypress Component Testing no longer supports `Nuxt.js` version 2. Addresses [#30468](https://github.com/cypress-io/cypress/issues/30468). +- Cypress Component Testing no longer supports `Vue` version 2. Addresses [#30295](https://github.com/cypress-io/cypress/issues/30295). +- Cypress Component Testing no longer supports `Next.js` versions 10, 11, 12, and 13. Addresses [#29583](https://github.com/cypress-io/cypress/issues/29583). +- Cypress Component Testing no longer supports `Angular` versions 13, 14, 15, and 16. The minimum supported version is now `17.2.0` in order to fully support Angular [signals](https://angular.dev/guide/signals). Addresses [#29582](https://github.com/cypress-io/cypress/issues/29582). Addressed in [#30539](https://github.com/cypress-io/cypress/pull/30539). + +**Deprecations:** + +- The `resourceType` option on `cy.intercept` has been deprecated. We anticipate the resource types to change or be completely removed in the future. Our intention is to replace essential functionality dependent on the `resourceType` within Cypress in a future version (like hiding network logs that are not fetch/xhr). Please leave feedback on any essential uses of `resourceType` +in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addresses [#30433](https://github.com/cypress-io/cypress/issues/30433). + +**Bugfixes:** + +- Elements with `display: contents` will no longer use box model calculations for visibility, and correctly show as visible when it is visible. Fixed in [#29680](https://github.com/cypress-io/cypress/pull/29680). Fixes [#29605](https://github.com/cypress-io/cypress/issues/29605). +- The CSS pseudo-class `:dir()` is now supported when testing in Electron. Addresses [#29766](https://github.com/cypress-io/cypress/issues/29766). + +**Dependency Updates:** + +- Upgraded `electron` from `27.3.10` to `32.2.0`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547). +- Upgraded bundled Chromium version from `118.0.5993.159` to `128.0.6613.178`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547). +- Updated `jQuery` from `3.4.1` to `3.7.1`. Addressed in [#30345](https://github.com/cypress-io/cypress/pull/30345). +- Updated `react` from `17.0.2` to `18.3.1` and `react-dom` from `17.0.2` to `18.3.1`. Addresses [#30511](https://github.com/cypress-io/cypress/issues/30511). + ## 13.15.2 _Released 11/5/2024_ @@ -17,6 +57,7 @@ _Released 11/5/2024_ - Updated `mobx` from `5.15.4` to `6.13.5` and `mobx-react` from `6.1.8` to `9.1.1`. Addresses [#30509](https://github.com/cypress-io/cypress/issues/30509). - Updated `@cypress/request` from `3.0.4` to `3.0.6`. Addressed in [#30488](https://github.com/cypress-io/cypress/pull/30488). + ## 13.15.1 _Released 10/24/2024_ diff --git a/cli/__snapshots__/cli_spec.js b/cli/__snapshots__/cli_spec.js index feed7158b7d4..300796300cf2 100644 --- a/cli/__snapshots__/cli_spec.js +++ b/cli/__snapshots__/cli_spec.js @@ -223,10 +223,6 @@ exports['cli help command shows help 1'] = ` version [options] prints Cypress version open [options] Opens Cypress in the interactive GUI. run [options] Runs Cypress tests from the CLI without the GUI - open-ct [options] Opens Cypress component testing interactive mode. - Deprecated: use "open --component" - run-ct [options] Runs all Cypress component testing suites. Deprecated: - use "run --component" install [options] Installs the Cypress executable matching this package's version verify [options] Verifies that Cypress is installed correctly and @@ -263,10 +259,6 @@ exports['cli help command shows help for -h 1'] = ` version [options] prints Cypress version open [options] Opens Cypress in the interactive GUI. run [options] Runs Cypress tests from the CLI without the GUI - open-ct [options] Opens Cypress component testing interactive mode. - Deprecated: use "open --component" - run-ct [options] Runs all Cypress component testing suites. Deprecated: - use "run --component" install [options] Installs the Cypress executable matching this package's version verify [options] Verifies that Cypress is installed correctly and @@ -303,10 +295,6 @@ exports['cli help command shows help for --help 1'] = ` version [options] prints Cypress version open [options] Opens Cypress in the interactive GUI. run [options] Runs Cypress tests from the CLI without the GUI - open-ct [options] Opens Cypress component testing interactive mode. - Deprecated: use "open --component" - run-ct [options] Runs all Cypress component testing suites. Deprecated: - use "run --component" install [options] Installs the Cypress executable matching this package's version verify [options] Verifies that Cypress is installed correctly and @@ -344,10 +332,6 @@ exports['cli unknown command shows usage and exits 1'] = ` version [options] prints Cypress version open [options] Opens Cypress in the interactive GUI. run [options] Runs Cypress tests from the CLI without the GUI - open-ct [options] Opens Cypress component testing interactive mode. - Deprecated: use "open --component" - run-ct [options] Runs all Cypress component testing suites. Deprecated: - use "run --component" install [options] Installs the Cypress executable matching this package's version verify [options] Verifies that Cypress is installed correctly and @@ -457,10 +441,6 @@ exports['cli CYPRESS_INTERNAL_ENV allows and warns when staging environment 1'] version [options] prints Cypress version open [options] Opens Cypress in the interactive GUI. run [options] Runs Cypress tests from the CLI without the GUI - open-ct [options] Opens Cypress component testing interactive mode. - Deprecated: use "open --component" - run-ct [options] Runs all Cypress component testing suites. Deprecated: - use "run --component" install [options] Installs the Cypress executable matching this package's version verify [options] Verifies that Cypress is installed correctly and diff --git a/cli/lib/cli.js b/cli/lib/cli.js index 5cec42cafb1c..7ac2f855defc 100644 --- a/cli/lib/cli.js +++ b/cli/lib/cli.js @@ -137,8 +137,6 @@ const knownCommands = [ 'install', 'open', 'run', - 'open-ct', - 'run-ct', 'verify', '-v', '--version', @@ -482,80 +480,6 @@ module.exports = { .catch(util.logErrorExit1) }) - program - .command('open-ct') - .usage('[options]') - .description('Opens Cypress component testing interactive mode. Deprecated: use "open --component"') - .option('-b, --browser ', text('browser')) - .option('-c, --config ', text('config')) - .option('-C, --config-file ', text('configFile')) - .option('-d, --detached [bool]', text('detached'), coerceFalse) - .option('-e, --env ', text('env')) - .option('--global', text('global')) - .option('-p, --port ', text('port')) - .option('-P, --project ', text('project')) - .option('--dev', text('dev'), coerceFalse) - .action((opts) => { - debug('opening Cypress') - - const msg = ` - ${logSymbols.warning} Warning: open-ct is deprecated and will be removed in a future release. - - Use \`cypress open --component\` instead. - ` - - logger.warn() - logger.warn(stripIndent(msg)) - logger.warn() - - require('./exec/open') - .start({ ...util.parseOpts(opts), testingType: 'component' }) - .then(util.exit) - .catch(util.logErrorExit1) - }) - - program - .command('run-ct') - .usage('[options]') - .description('Runs all Cypress component testing suites. Deprecated: use "run --component"') - .option('-b, --browser ', text('browser')) - .option('--ci-build-id ', text('ciBuildId')) - .option('-c, --config ', text('config')) - .option('-C, --config-file ', text('configFile')) - .option('-e, --env ', text('env')) - .option('--group ', text('group')) - .option('-k, --key ', text('key')) - .option('--headed', text('headed')) - .option('--headless', text('headless')) - .option('--no-exit', text('exit')) - .option('--parallel', text('parallel')) - .option('-p, --port ', text('port')) - .option('-P, --project ', text('project')) - .option('-q, --quiet', text('quiet')) - .option('--record [bool]', text('record'), coerceFalse) - .option('-r, --reporter ', text('reporter')) - .option('-o, --reporter-options ', text('reporterOptions')) - .option('-s, --spec ', text('spec')) - .option('-t, --tag ', text('tag')) - .option('--dev', text('dev'), coerceFalse) - .action((opts) => { - debug('running Cypress run-ct') - - const msg = ` - ${logSymbols.warning} Warning: run-ct is deprecated and will be removed in a future release. - Use \`cypress run --component\` instead. - ` - - logger.warn() - logger.warn(stripIndent(msg)) - logger.warn() - - require('./exec/run') - .start({ ...util.parseOpts(opts), testingType: 'component' }) - .then(util.exit) - .catch(util.logErrorExit1) - }) - program .command('install') .usage('[options]') diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index da25f03b8224..469090f75137 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -39,12 +39,6 @@ const isDbusWarning = /Failed to connect to the bus:/ // ERROR: No matching issuer found const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- Certificate i=0 \(OU=Cypress Proxy|^ERROR: No matching issuer found$)/ -// Electron logs a benign warning about WebSwapCGLLayer on MacOS v12 and Electron v18 due to a naming collision in shared libraries. -// Once this is fixed upstream this regex can be removed: https://github.com/electron/electron/issues/33685 -// Sample: -// objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined. -const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./ - /** * Electron logs benign warnings about Vulkan when run on hosts that do not have a GPU. This is coming from the primary Electron process, * and not the browser being used for tests. @@ -74,7 +68,15 @@ const isContainerVulkanDriverWarning = /^Warning: vkCreateInstance/ const isContainerVulkanStack = /^\s*at (CheckVkSuccessImpl|CreateVkInstance|Initialize|Create|operator).+(VulkanError|BackendVk).cpp/ -const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack] +/** + * In Electron 32.0.0 a new debug scenario log message started appearing when iframes navigate to about:blank. This is a benign message. + * https://github.com/electron/electron/issues/44368 + * Sample: + * [78887:1023/114920.074882:ERROR:debug_utils.cc(14)] Hit debug scenario: 4 + */ +const isDebugScenario4 = /^\[[^\]]+debug_utils\.cc[^\]]+\] Hit debug scenario: 4/ + +const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack, isDebugScenario4] const isGarbageLineWarning = (str) => { return _.some(GARBAGE_WARNINGS, (re) => { diff --git a/cli/package.json b/cli/package.json index 52ad05a13970..e4e4039fb9e8 100644 --- a/cli/package.json +++ b/cli/package.json @@ -76,7 +76,6 @@ "@cypress/sinon-chai": "2.9.1", "@cypress/svelte": "0.0.0-development", "@cypress/vue": "0.0.0-development", - "@cypress/vue2": "0.0.0-development", "@packages/root": "0.0.0-development", "@types/bluebird": "3.5.33", "@types/chai": "4.2.15", @@ -96,7 +95,7 @@ "execa-wrap": "1.4.0", "hasha": "5.2.2", "mocha": "6.2.2", - "mock-fs": "5.2.0", + "mock-fs": "5.4.0", "mocked-env": "1.3.2", "nock": "13.2.9", "proxyquire": "2.1.3", @@ -116,7 +115,6 @@ "mount-utils", "vue", "react", - "vue2", "react18", "angular", "svelte", @@ -126,7 +124,7 @@ "cypress": "bin/cypress" }, "engines": { - "node": "^16.0.0 || ^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "types": "types", "exports": { @@ -140,11 +138,6 @@ "import": "./vue/dist/cypress-vue.esm-bundler.js", "require": "./vue/dist/cypress-vue.cjs.js" }, - "./vue2": { - "types": "./vue2/dist/index.d.ts", - "import": "./vue2/dist/cypress-vue2.esm-bundler.js", - "require": "./vue2/dist/cypress-vue2.cjs.js" - }, "./package.json": { "import": "./package.json", "require": "./package.json" diff --git a/cli/scripts/post-build.js b/cli/scripts/post-build.js index 752578adf983..5a225cf7d409 100644 --- a/cli/scripts/post-build.js +++ b/cli/scripts/post-build.js @@ -11,7 +11,6 @@ const npmModulesToCopy = [ 'react', 'react18', 'vue', - 'vue2', 'angular', 'angular-signals', 'svelte', diff --git a/cli/test/lib/cli_spec.js b/cli/test/lib/cli_spec.js index 3e0de35ddfae..5d17558ffc41 100644 --- a/cli/test/lib/cli_spec.js +++ b/cli/test/lib/cli_spec.js @@ -635,34 +635,10 @@ describe('cli', () => { expect(spawn.start.firstCall.args[0]).to.include('component') }) - it('spawns server with correct args for deprecated component-testing command', () => { - this.exec('open-ct --dev') - expect(spawn.start.firstCall.args[0]).to.include('--testing-type') - expect(spawn.start.firstCall.args[0]).to.include('component') - }) - it('runs server with correct args for component-testing', () => { this.exec('run --component --dev') expect(spawn.start.firstCall.args[0]).to.include('--testing-type') expect(spawn.start.firstCall.args[0]).to.include('component') }) - - it('runs server with correct args for deprecated component-testing command', () => { - this.exec('run-ct --dev') - expect(spawn.start.firstCall.args[0]).to.include('--testing-type') - expect(spawn.start.firstCall.args[0]).to.include('component') - }) - - it('does display open-ct command in the help', () => { - return execa('bin/cypress', ['help']).then((result) => { - expect(result).to.include('open-ct') - }) - }) - - it('does display run-ct command in the help', () => { - return execa('bin/cypress', ['help']).then((result) => { - expect(result).to.include('run-ct') - }) - }) }) }) diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index 76a0f7799c66..00738df40612 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -83,8 +83,6 @@ describe('lib/exec/spawn', function () { ----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=www.googletagmanager.com) ----- ERROR: No matching issuer found - objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined. - Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this verison of Vulkan (Policy #LDP_DRIVER_7) @@ -97,6 +95,8 @@ describe('lib/exec/spawn', function () { at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344) at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266) at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521) + + [78887:1023/114920.074882:ERROR:debug_utils.cc(14)] Hit debug scenario: 4 ` const lines = _ diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index f0f0c914b1c3..e6d4592d6960 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -75,13 +75,6 @@ declare namespace Cypress { } interface Backend { - /** - * Firefox only: Force Cypress to run garbage collection routines. - * No-op if not running in Firefox. - * - * @see https://on.cypress.io/firefox-gc-issue - */ - (task: 'firefox:force:gc'): Promise (task: 'net', eventName: string, frame: any): Promise } @@ -125,11 +118,7 @@ declare namespace Cypress { */ warning?: string /** - * The minimum majorVersion of this browser supported by Cypress. - */ - minSupportedVersion?: number - /** - * If `true`, this browser is too old to be supported by Cypress. + * If `true`, this browser version is not supported in Cypress. */ unsupportedVersion?: boolean } @@ -3188,10 +3177,6 @@ declare namespace Cypress { * The user agent the browser sends in all request headers. */ userAgent: null | string - /** - * Polyfills `window.fetch` to enable Network spying and stubbing - */ - experimentalFetchPolyfill: boolean /** * Override default config options for Component Testing runner. @@ -3531,7 +3516,7 @@ declare namespace Cypress { type DevServerConfigOptions = { bundler: 'webpack' - framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'svelte' + framework: 'react' | 'vue' | 'vue-cli' | 'create-react-app' | 'next' | 'svelte' webpackConfig?: ConfigHandler> } | { bundler: 'vite' diff --git a/cli/types/tests/cypress-npm-api-test.ts b/cli/types/tests/cypress-npm-api-test.ts index bea7236891ca..3f5d1c3de58b 100644 --- a/cli/types/tests/cypress-npm-api-test.ts +++ b/cli/types/tests/cypress-npm-api-test.ts @@ -114,16 +114,6 @@ const componentConfigVueCliWebpack: Cypress.ConfigOptions = { } } -const componentConfigNuxtWebpack: Cypress.ConfigOptions = { - component: { - devServer: { - bundler: 'webpack', - framework: 'nuxt', - webpackConfig: {} - } - } -} - const componentConfigCRAWebpack: Cypress.ConfigOptions = { component: { devServer: { diff --git a/docker-compose.yml b/docker-compose.yml index 3f3c200c3658..93a193a5cb83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,7 +31,7 @@ services: - .:/opt/cypress ci: # This should mirror the image used in workflows.yml - image: cypress/browsers-internal:node18.17.1-chrome118-ff115 + image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131 ports: - 5566:5566 - 5567:5567 diff --git a/npm/angular/package.json b/npm/angular/package.json index 6917b8c30358..c7b1541fb207 100644 --- a/npm/angular/package.json +++ b/npm/angular/package.json @@ -12,17 +12,17 @@ }, "dependencies": {}, "devDependencies": { - "@angular/common": "^14.2.0", - "@angular/core": "^14.2.0", - "@angular/platform-browser-dynamic": "^14.2.0", + "@angular/common": "^17.2.0", + "@angular/core": "^17.2.0", + "@angular/platform-browser-dynamic": "^17.2.0", "@cypress/mount-utils": "0.0.0-development", "typescript": "~5.4.5", "zone.js": "~0.11.4" }, "peerDependencies": { - "@angular/common": ">=13", - "@angular/core": ">=13", - "@angular/platform-browser-dynamic": ">=13", + "@angular/common": ">=17.2", + "@angular/core": ">=17.2", + "@angular/platform-browser-dynamic": ">=17.2", "zone.js": ">=0.11.0" }, "files": [ diff --git a/npm/cypress-schematic/README.md b/npm/cypress-schematic/README.md index 71be26beeaa1..13d1a6d2d442 100644 --- a/npm/cypress-schematic/README.md +++ b/npm/cypress-schematic/README.md @@ -31,7 +31,7 @@ ## Requirements -- Angular 14+ +- Angular 17.2.0+ ## Usage ⏯ diff --git a/npm/cypress-schematic/package.json b/npm/cypress-schematic/package.json index 43214a662e39..2af4628482e2 100644 --- a/npm/cypress-schematic/package.json +++ b/npm/cypress-schematic/package.json @@ -7,29 +7,28 @@ "build": "tsc -p tsconfig.json", "build:watch": "tsc -p tsconfig.json --watch", "lint": "eslint --ext .ts,.json, .", - "test": "mocha -r @packages/ts/register --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json src/**/*.spec.ts" + "test": "vitest run --no-file-parallelism" }, "dependencies": { - "jsonc-parser": "^3.0.0", - "rxjs": "~6.6.0" + "jsonc-parser": "^3.3.1", + "rxjs": "~7.8.1" }, "devDependencies": { - "@angular-devkit/architect": "^0.1402.1", - "@angular-devkit/core": "^14.2.1", - "@angular-devkit/schematics": "^14.2.1", - "@angular-devkit/schematics-cli": "^14.2.1", - "@angular/cli": "^14.2.1", - "@schematics/angular": "^14.2.1", - "@types/chai-enzyme": "0.6.7", + "@angular-devkit/architect": "^0.1802.11", + "@angular-devkit/core": "^18.2.11", + "@angular-devkit/schematics": "^18.2.11", + "@angular-devkit/schematics-cli": "^18.2.11", + "@angular/cli": "^18.2.11", + "@schematics/angular": "^18.2.11", + "@types/chai-enzyme": "0.6.13", "@types/mocha": "8.0.3", - "@types/node": "^18.17.5", - "chai": "4.2.0", - "mocha": "3.5.3", - "typescript": "~5.4.5" + "@types/node": "^20.16.0", + "typescript": "~5.4.5", + "vitest": "2.1.4" }, "peerDependencies": { - "@angular/cli": ">=14", - "@angular/core": ">=14" + "@angular/cli": ">=17.2", + "@angular/core": ">=17.2" }, "license": "MIT", "repository": { diff --git a/system-tests/projects/angular-cli-configured/src/assets/.gitkeep b/npm/cypress-schematic/projects/sandbox/src/.gitkeep similarity index 100% rename from system-tests/projects/angular-cli-configured/src/assets/.gitkeep rename to npm/cypress-schematic/projects/sandbox/src/.gitkeep diff --git a/system-tests/project-fixtures/nuxtjs2/cypress/support/component.js b/npm/cypress-schematic/projects/sandbox/src/fake-component.component.ts similarity index 100% rename from system-tests/project-fixtures/nuxtjs2/cypress/support/component.js rename to npm/cypress-schematic/projects/sandbox/src/fake-component.component.ts diff --git a/npm/cypress-schematic/src/ct.spec.ts b/npm/cypress-schematic/src/ct.spec.ts index 0e1929dd3be4..cea4d95625a3 100644 --- a/npm/cypress-schematic/src/ct.spec.ts +++ b/npm/cypress-schematic/src/ct.spec.ts @@ -1,3 +1,4 @@ +import { describe, it } from 'vitest' import Fixtures, { ProjectFixtureDir } from '@tooling/system-tests' import * as FixturesScaffold from '@tooling/system-tests/lib/dep-installer' import execa from 'execa' @@ -35,11 +36,9 @@ const copyAngularMount = async (projectPath: string) => { const cypressSchematicPackagePath = path.join(__dirname, '..') -const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-14', 'angular-15'] - -describe('ng add @cypress/schematic / e2e and ct', function () { - this.timeout(1000 * 60 * 5) +const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-17', 'angular-18'] +describe('ng add @cypress/schematic / e2e and ct', { timeout: 1000 * 60 * 5 }, function () { for (const project of ANGULAR_PROJECTS) { it('should install ct files with option and no component specs', async () => { const projectPath = await scaffoldAngularProject(project) diff --git a/npm/cypress-schematic/src/e2e.spec.ts b/npm/cypress-schematic/src/e2e.spec.ts index bd231bc8ea7f..080a9de1e6de 100644 --- a/npm/cypress-schematic/src/e2e.spec.ts +++ b/npm/cypress-schematic/src/e2e.spec.ts @@ -1,3 +1,4 @@ +import { describe, it } from 'vitest' import Fixtures, { ProjectFixtureDir } from '@tooling/system-tests' import * as FixturesScaffold from '@tooling/system-tests/lib/dep-installer' import execa from 'execa' @@ -24,11 +25,9 @@ const runCommandInProject = (command: string, projectPath: string) => { const cypressSchematicPackagePath = path.join(__dirname, '..') -const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-14', 'angular-15'] - -describe('ng add @cypress/schematic / only e2e', function () { - this.timeout(1000 * 60 * 5) +const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-17', 'angular-18'] +describe('ng add @cypress/schematic / only e2e', { timeout: 1000 * 60 * 5 }, function () { for (const project of ANGULAR_PROJECTS) { it('should install e2e files by default', async () => { const projectPath = await scaffoldAngularProject(project) diff --git a/npm/cypress-schematic/src/schematics/ng-add/index.spec.ts b/npm/cypress-schematic/src/schematics/ng-add/index.spec.ts index bef3bf33c0e1..bb7e26473a9f 100644 --- a/npm/cypress-schematic/src/schematics/ng-add/index.spec.ts +++ b/npm/cypress-schematic/src/schematics/ng-add/index.spec.ts @@ -1,8 +1,6 @@ -/// - +import { describe, beforeEach, it, expect } from 'vitest' import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing' import { join } from 'path' -import { expect } from 'chai' import { JsonObject } from '@angular-devkit/core' describe('@cypress/schematic: ng-add', () => { @@ -33,12 +31,12 @@ describe('@cypress/schematic: ng-add', () => { } beforeEach(async () => { - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise() - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise() + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions) + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'application', appOptions, appTree) }) it('should create cypress files for e2e testing by default', async () => { - await schematicRunner.runSchematicAsync('ng-add', {}, appTree).toPromise().then((tree: UnitTestTree) => { + await schematicRunner.runSchematic('ng-add', {}, appTree).then((tree: UnitTestTree) => { const files = tree.files expect(files).to.contain('/projects/sandbox/cypress/e2e/spec.cy.ts') @@ -51,7 +49,7 @@ describe('@cypress/schematic: ng-add', () => { }) it('should create cypress files for component testing', async () => { - await schematicRunner.runSchematicAsync('ng-add', { 'component': true }, appTree).toPromise().then((tree: UnitTestTree) => { + await schematicRunner.runSchematic('ng-add', { 'component': true }, appTree).then((tree: UnitTestTree) => { const files = tree.files expect(files).to.contain('/projects/sandbox/cypress/support/component.ts') @@ -66,7 +64,7 @@ describe('@cypress/schematic: ng-add', () => { }) it('should add @cypress/schematic to the schemaCollections array', async () => { - const tree = await schematicRunner.runSchematicAsync('ng-add', { 'component': true }, appTree).toPromise() + const tree = await schematicRunner.runSchematic('ng-add', { 'component': true }, appTree) const angularJson = readAngularJson(tree) const cliOptions = angularJson.cli as JsonObject @@ -86,7 +84,7 @@ describe('@cypress/schematic: ng-add', () => { }, })) - const tree = await schematicRunner.runSchematicAsync('ng-add', { 'component': true }, appTree).toPromise() + const tree = await schematicRunner.runSchematic('ng-add', { 'component': true }, appTree) angularJson = readAngularJson(tree) const cliOptions = angularJson.cli as JsonObject diff --git a/npm/cypress-schematic/src/schematics/ng-generate/component/index.spec.ts b/npm/cypress-schematic/src/schematics/ng-generate/component/index.spec.ts index 2c60abc2cf65..24fda3bc67df 100644 --- a/npm/cypress-schematic/src/schematics/ng-generate/component/index.spec.ts +++ b/npm/cypress-schematic/src/schematics/ng-generate/component/index.spec.ts @@ -1,5 +1,5 @@ +import { describe, beforeEach, it, expect } from 'vitest' import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing' -import { expect } from 'chai' import { join } from 'path' describe('ng-generate @cypress/schematic:component', () => { @@ -12,10 +12,10 @@ describe('ng-generate @cypress/schematic:component', () => { const workspaceOptions = { name: 'workspace', newProjectRoot: 'projects', - version: '12.0.0', + version: '18.0.0', } - const appOptions: Parameters[2] = { + const appOptions: Parameters[2] = { name: 'sandbox', inlineTemplate: false, routing: false, @@ -24,12 +24,12 @@ describe('ng-generate @cypress/schematic:component', () => { } beforeEach(async () => { - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise() - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise() + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions) + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'application', appOptions, appTree) }) it('should create cypress ct alongside the generated component', async () => { - const tree = await schematicRunner.runSchematicAsync('component', { name: 'foo', project: 'sandbox' }, appTree).toPromise() + const tree = await schematicRunner.runSchematic('component', { name: 'foo', project: 'sandbox', skipImport: true }, appTree) expect(tree.files).to.contain('/projects/sandbox/src/app/foo/foo.component.ts') expect(tree.files).to.contain('/projects/sandbox/src/app/foo/foo.component.html') @@ -39,9 +39,9 @@ describe('ng-generate @cypress/schematic:component', () => { }) it('should not generate component which does exist already', async () => { - let tree = await schematicRunner.runSchematicAsync('component', { name: 'foo', project: 'sandbox' }, appTree).toPromise() + let tree = await schematicRunner.runSchematic('component', { name: 'foo', project: 'sandbox', skipImport: true }, appTree) - tree = await schematicRunner.runSchematicAsync('component', { name: 'foo', project: 'sandbox' }, appTree).toPromise() + tree = await schematicRunner.runSchematic('component', { name: 'foo', project: 'sandbox', skipImport: true }, appTree) expect(tree.files.filter((f) => f === '/projects/sandbox/src/app/foo/foo.component.ts').length).to.eq(1) expect(tree.files.filter((f) => f === '/projects/sandbox/src/app/foo/foo.component.html').length).to.eq(1) @@ -50,7 +50,7 @@ describe('ng-generate @cypress/schematic:component', () => { }) it('should generate component given a component containing a directory', async () => { - const tree = await schematicRunner.runSchematicAsync('component', { name: 'foo/bar', project: 'sandbox' }, appTree).toPromise() + const tree = await schematicRunner.runSchematic('component', { name: 'foo/bar', project: 'sandbox', skipImport: true }, appTree) expect(tree.files).to.contain('/projects/sandbox/src/app/foo/bar/bar.component.ts') expect(tree.files).to.contain('/projects/sandbox/src/app/foo/bar/bar.component.html') diff --git a/npm/cypress-schematic/src/schematics/ng-generate/cypress-ct-tests/index.spec.ts b/npm/cypress-schematic/src/schematics/ng-generate/cypress-ct-tests/index.spec.ts index cba6783c3ba8..2ab1b49257a5 100644 --- a/npm/cypress-schematic/src/schematics/ng-generate/cypress-ct-tests/index.spec.ts +++ b/npm/cypress-schematic/src/schematics/ng-generate/cypress-ct-tests/index.spec.ts @@ -1,9 +1,6 @@ -/// - +import { describe, it, beforeEach, expect } from 'vitest' import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing' import { join } from 'path' -import { expect } from 'chai' -import { take } from 'rxjs/operators' describe('ng-generate @cypress/schematic:specs-ct', () => { const schematicRunner = new SchematicTestRunner( @@ -15,10 +12,10 @@ describe('ng-generate @cypress/schematic:specs-ct', () => { const workspaceOptions = { name: 'workspace', newProjectRoot: 'projects', - version: '12.0.0', + version: '18.0.0', } - const appOptions: Parameters[2] = { + const appOptions: Parameters[2] = { name: 'sandbox', inlineTemplate: false, routing: false, @@ -27,11 +24,13 @@ describe('ng-generate @cypress/schematic:specs-ct', () => { } beforeEach(async () => { - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise() - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise() + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions) + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'application', appOptions, appTree) }) it('should create cypress component tests alongside components', async () => { - return schematicRunner.runSchematicAsync('specs-ct', { project: 'sandbox' }, appTree).pipe(take(1)).subscribe((tree: UnitTestTree) => expect(tree.files).to.contain('/projects/sandbox/app/src/app.component.cy.ts')) + const tree = await schematicRunner.runSchematic('specs-ct', { project: 'sandbox' }, appTree) + + expect(tree.files).to.contain('/projects/sandbox/src/fake-component.component.cy.ts') }) }) diff --git a/npm/cypress-schematic/src/schematics/ng-generate/cypress-test/index.spec.ts b/npm/cypress-schematic/src/schematics/ng-generate/cypress-test/index.spec.ts index 4b70527f5e29..d32826edfb9b 100644 --- a/npm/cypress-schematic/src/schematics/ng-generate/cypress-test/index.spec.ts +++ b/npm/cypress-schematic/src/schematics/ng-generate/cypress-test/index.spec.ts @@ -1,8 +1,6 @@ -/// - +import { describe, it, beforeEach, expect } from 'vitest' import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing' import { join } from 'path' -import { expect } from 'chai' describe('ng-generate @cypress/schematic:spec', () => { const schematicRunner = new SchematicTestRunner( @@ -17,7 +15,7 @@ describe('ng-generate @cypress/schematic:spec', () => { version: '12.0.0', } - const appOptions: Parameters[2] = { + const appOptions: Parameters[2] = { name: 'sandbox', inlineTemplate: false, routing: false, @@ -26,15 +24,19 @@ describe('ng-generate @cypress/schematic:spec', () => { } beforeEach(async () => { - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise() - appTree = await schematicRunner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise() + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions) + appTree = await schematicRunner.runExternalSchematic('@schematics/angular', 'application', appOptions, appTree) }) it('should create cypress e2e spec file by default', async () => { - await schematicRunner.runSchematicAsync('spec', { name: 'foo', project: 'sandbox' }, appTree).toPromise().then((tree: UnitTestTree) => expect(tree.files).to.contain('/projects/sandbox/cypress/e2e/foo.cy.ts')) + const tree = await schematicRunner.runSchematic('spec', { name: 'foo', project: 'sandbox' }, appTree) + + expect(tree.files).to.contain('/projects/sandbox/cypress/e2e/foo.cy.ts') }) it('should create cypress ct spec file when testingType is component', async () => { - await schematicRunner.runSchematicAsync('spec', { name: 'foo', project: 'sandbox', component: true }, appTree).toPromise().then((tree: UnitTestTree) => expect(tree.files).to.contain('/projects/sandbox/src/app/foo.component.cy.ts')) + const tree = await schematicRunner.runSchematic('spec', { name: 'foo', project: 'sandbox', component: true }, appTree) + + expect(tree.files).to.contain('/projects/sandbox/src/app/foo.component.cy.ts') }) }) diff --git a/npm/puppeteer/package.json b/npm/puppeteer/package.json index 84d5dafd18b7..2c9816035864 100644 --- a/npm/puppeteer/package.json +++ b/npm/puppeteer/package.json @@ -21,7 +21,7 @@ "puppeteer-core": "^21.2.1" }, "devDependencies": { - "@types/node": "^18.17.5", + "@types/node": "^20.16.0", "chai-as-promised": "^7.1.1", "chokidar": "^3.5.3", "express": "4.19.2", diff --git a/npm/react/cypress.config.js b/npm/react/cypress.config.js index 2764f9c4c037..6dbae3753b06 100644 --- a/npm/react/cypress.config.js +++ b/npm/react/cypress.config.js @@ -5,7 +5,6 @@ module.exports = { 'env': { 'reactDevtools': true, }, - 'experimentalFetchPolyfill': true, 'component': { experimentalSingleTabRunMode: true, 'excludeSpecPattern': [ diff --git a/npm/react/cypress/component/basic/network/README.md b/npm/react/cypress/component/basic/network/README.md index 2d1c2eea9bd8..a5d90d66d20a 100644 --- a/npm/react/cypress/component/basic/network/README.md +++ b/npm/react/cypress/component/basic/network/README.md @@ -1,4 +1,3 @@ # Mocking network - [1-users-spec.js](1-users-spec.js) tests [1-users.jsx](1-users.jsx) that uses Axios to GET a list of users. Axios uses XMLHttpRequest to receive the data -- [2-users-fetch-spec.js](2-users-fetch-spec.js) tests [2-users-fetch.jsx](2-users-fetch.jsx) that uses `fetch` directly, assuming `"experimentalFetchPolyfill": true` in `cypress.json`, read [Experimental Fetch Polyfill](https://www.cypress.io/blog/2020/06/29/experimental-fetch-polyfill/) diff --git a/npm/react18/src/index.ts b/npm/react18/src/index.ts index 4d5c3f6766df..9ab7390dfc87 100644 --- a/npm/react18/src/index.ts +++ b/npm/react18/src/index.ts @@ -1,5 +1,4 @@ import React from 'react' -// @ts-expect-error import ReactDOM from 'react-dom/client' import { getContainerEl } from '@cypress/mount-utils' import { @@ -53,6 +52,7 @@ export function mount (jsx: React.ReactNode, options: MountOptions = {}, rerende // to wipe away any state cleanup() const internalOptions: InternalMountOptions = { + // @ts-expect-error reactDom: ReactDOM, render: (reactComponent: ReturnType, el: HTMLElement) => { if (!root) { @@ -65,6 +65,7 @@ export function mount (jsx: React.ReactNode, options: MountOptions = {}, rerende cleanup, } + // @ts-expect-error return makeMountFn('mount', jsx, { ReactDom: ReactDOM, ...options }, rerenderKey, internalOptions) } diff --git a/npm/vite-dev-server/cypress/e2e/react.cy.ts b/npm/vite-dev-server/cypress/e2e/react.cy.ts index b42eee9231d4..b3f441396077 100644 --- a/npm/vite-dev-server/cypress/e2e/react.cy.ts +++ b/npm/vite-dev-server/cypress/e2e/react.cy.ts @@ -4,7 +4,7 @@ import dedent from 'dedent' type ProjectDirs = typeof fixtureDirs -const VITE_REACT: ProjectDirs[number][] = ['vite2.8.6-react', 'vite2.9.1-react'] +const VITE_REACT: ProjectDirs[number][] = ['vite4.5.5-react', 'vite5.4.10-react'] // Add to this list to focus on a particular permutation const ONLY_PROJECTS: ProjectDirs[number][] = [] diff --git a/npm/vite-dev-server/cypress/e2e/vite-dev-server.cy.ts b/npm/vite-dev-server/cypress/e2e/vite-dev-server.cy.ts index 8a7d64aceb81..7c4959580c45 100644 --- a/npm/vite-dev-server/cypress/e2e/vite-dev-server.cy.ts +++ b/npm/vite-dev-server/cypress/e2e/vite-dev-server.cy.ts @@ -44,22 +44,23 @@ describe('Config options', () => { }) it('supports supportFile = false', () => { - cy.scaffoldProject('vite2.9.1-react') - cy.openProject('vite2.9.1-react', ['--config-file', 'cypress-vite-no-support.config.ts', '--component']) + cy.scaffoldProject('vite5.4.10-react') + cy.openProject('vite5.4.10-react', ['--config-file', 'cypress-vite-no-support.config.ts', '--component']) cy.startAppServer('component') cy.visitApp() cy.specsPageIsVisible() cy.contains('App.cy.jsx').click() cy.waitForSpecToFinish() - cy.get('.passed > .num').should('contain', 1) + // no support file means there is no mount function registered, so all tests should fail + cy.get('.failed > .num').should('contain', 2) }) it('supports serving files with whitespace', () => { const specWithWhitespace = 'spec with whitespace.cy.jsx' - cy.scaffoldProject('vite2.9.1-react') - cy.openProject('vite2.9.1-react', ['--config-file', 'cypress-vite.config.ts', '--component']) + cy.scaffoldProject('vite5.4.10-react') + cy.openProject('vite5.4.10-react', ['--config-file', 'cypress-vite.config.ts', '--component']) cy.startAppServer('component') cy.withCtx(async (ctx, { specWithWhitespace }) => { @@ -76,8 +77,8 @@ describe('Config options', () => { }) it('supports @cypress/vite-dev-server', () => { - cy.scaffoldProject('vite2.9.1-react') - cy.openProject('vite2.9.1-react', ['--config-file', 'cypress-vite-dev-server-function.config.ts', '--component']) + cy.scaffoldProject('vite5.4.10-react') + cy.openProject('vite5.4.10-react', ['--config-file', 'cypress-vite-dev-server-function.config.ts', '--component']) cy.startAppServer('component') cy.visitApp() @@ -88,8 +89,8 @@ describe('Config options', () => { }) it('supports viteConfig as an async function', () => { - cy.scaffoldProject('vite2.9.1-react') - cy.openProject('vite2.9.1-react', ['--config-file', 'cypress-vite-async-function-config.config.ts', '--component']) + cy.scaffoldProject('vite5.4.10-react') + cy.openProject('vite5.4.10-react', ['--config-file', 'cypress-vite-async-function-config.config.ts', '--component']) cy.startAppServer('component') cy.visitApp() @@ -119,8 +120,8 @@ describe('sourcemaps', () => { }) ` - cy.scaffoldProject('vite3.0.2-react') - cy.openProject('vite3.0.2-react', ['--config-file', 'cypress-vite.config.ts', '--component']) + cy.scaffoldProject('vite5.4.10-react') + cy.openProject('vite5.4.10-react', ['--config-file', 'cypress-vite.config.ts', '--component']) cy.startAppServer('component') cy.withCtx(async (ctx, o) => { @@ -159,9 +160,9 @@ describe('sourcemaps', () => { cy.get('.runnable-err-file-path', { timeout: 250 }).should('contain', `${specName}:${line}:${column}`) } - verifySourcemap('JsErrorSpec.cy.js', 7, 9) + verifySourcemap('JsErrorSpec.cy.js', 7, 8) - verifySourcemap('JsWithImportErrorSpec.cy.js', 9, 9) + verifySourcemap('JsWithImportErrorSpec.cy.js', 9, 8) verifySourcemap('JsxErrorSpec.cy.jsx', 7, 8) diff --git a/npm/vue/cypress.config.ts b/npm/vue/cypress.config.ts index d4c8b1be979c..35f6d7cc2298 100644 --- a/npm/vue/cypress.config.ts +++ b/npm/vue/cypress.config.ts @@ -5,7 +5,6 @@ export default defineConfig({ 'viewportHeight': 500, 'responseTimeout': 2500, 'projectId': '134ej7', - 'experimentalFetchPolyfill': true, 'e2e': { 'supportFile': false, }, diff --git a/npm/vue2/.eslintignore b/npm/vue2/.eslintignore deleted file mode 100644 index 79afe972da7d..000000000000 --- a/npm/vue2/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -**/dist -**/*.d.ts -**/package-lock.json -**/tsconfig.json -**/cypress/fixtures \ No newline at end of file diff --git a/npm/vue2/.eslintrc b/npm/vue2/.eslintrc deleted file mode 100644 index f191aaa0e6d3..000000000000 --- a/npm/vue2/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "plugins": [ - "cypress" - ], - "extends": [ - "plugin:@cypress/dev/tests" - ], - "env": { - "cypress/globals": true - }, - "rules": { - "mocha/no-global-tests": "off", - "no-console": "off" - } -} diff --git a/npm/vue2/.npmrc b/npm/vue2/.npmrc deleted file mode 100644 index ff1f40faed0b..000000000000 --- a/npm/vue2/.npmrc +++ /dev/null @@ -1,3 +0,0 @@ -save-exact=true -progress=false -package-lock=true diff --git a/npm/vue2/.releaserc.js b/npm/vue2/.releaserc.js deleted file mode 100644 index 17d3bb871472..000000000000 --- a/npm/vue2/.releaserc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../.releaserc'), -} diff --git a/npm/vue2/CHANGELOG.md b/npm/vue2/CHANGELOG.md deleted file mode 100644 index 29b1f52a8007..000000000000 --- a/npm/vue2/CHANGELOG.md +++ /dev/null @@ -1,107 +0,0 @@ -# [@cypress/vue2-v2.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v2.1.0...@cypress/vue2-v2.1.1) (2024-06-07) - - -### Bug Fixes - -* update cypress to Typescript 5 ([#29568](https://github.com/cypress-io/cypress/issues/29568)) ([f3b6766](https://github.com/cypress-io/cypress/commit/f3b67666a5db0438594339c379cf27e1fd1e4abc)) - -# [@cypress/vue2-v2.1.0](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v2.0.1...@cypress/vue2-v2.1.0) (2024-03-12) - - -### Features - -* supported type of vue@2.7+ ([#28818](https://github.com/cypress-io/cypress/issues/28818)) ([854a649](https://github.com/cypress-io/cypress/commit/854a6497be2315881b8ad9c92674d3c29a76d581)) - -# [@cypress/vue2-v2.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v2.0.0...@cypress/vue2-v2.0.1) (2022-11-14) - - -### Bug Fixes - -* vue2 global directives in component testing ([#24488](https://github.com/cypress-io/cypress/issues/24488)) ([741019d](https://github.com/cypress-io/cypress/commit/741019d9618b7be79db64c9039ebca07741dd5c7)) - -# [@cypress/vue2-v2.0.0](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.1.2...@cypress/vue2-v2.0.0) (2022-11-07) - - -### Bug Fixes - -* remove dependence on @cypress/ types ([#24415](https://github.com/cypress-io/cypress/issues/24415)) ([58e0ab9](https://github.com/cypress-io/cypress/commit/58e0ab91604618ea6f75932622f7e66e419270e6)) -* remove last mounted component upon subsequent mount calls ([#24470](https://github.com/cypress-io/cypress/issues/24470)) ([f39eb1c](https://github.com/cypress-io/cypress/commit/f39eb1c19e0923bda7ae263168fc6448da942d54)) -* remove some CT functions and props ([#24419](https://github.com/cypress-io/cypress/issues/24419)) ([294985f](https://github.com/cypress-io/cypress/commit/294985f8b3e0fa00ed66d25f88c8814603766074)) - - -### Features - -* include component and wrapper in return type for vue mount adapter ([#24479](https://github.com/cypress-io/cypress/issues/24479)) ([33875d7](https://github.com/cypress-io/cypress/commit/33875d75505416b1f65ca7c6d5dedc46f3289f1b)) - - -### BREAKING CHANGES - -* remove last mounted component upon subsequent mount calls of mount -* Vue mount returns wrapper and component rather than wrapper only - -# [@cypress/vue2-v1.1.2](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.1.1...@cypress/vue2-v1.1.2) (2022-11-01) - - -### Bug Fixes - -* Hovering over mount in command log does not show component in AUT ([#24346](https://github.com/cypress-io/cypress/issues/24346)) ([355d210](https://github.com/cypress-io/cypress/commit/355d2101d38ea4d1e93b9c571cf77babab2bbbfc)) - -# [@cypress/vue2-v1.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.1.0...@cypress/vue2-v1.1.1) (2022-10-13) - - -### Bug Fixes - -* angular and nuxt ct tests now fail on uncaught exceptions ([#24122](https://github.com/cypress-io/cypress/issues/24122)) ([53eef4f](https://github.com/cypress-io/cypress/commit/53eef4fbd7e1caf32f0183cadbc0e4cf05524c34)) - - -# [@cypress/vue2-v1.1.0](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.0.2...@cypress/vue2-v1.1.0) (2022-08-30) - - -### Features - -* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8)) - -# [@cypress/vue2-v1.0.2](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.0.1...@cypress/vue2-v1.0.2) (2022-08-11) - - -### Bug Fixes - -* remove CT side effects from mount when e2e testing ([#22633](https://github.com/cypress-io/cypress/issues/22633)) ([a9476ec](https://github.com/cypress-io/cypress/commit/a9476ecb3d43f628b689e060294a1952937cb1a7)) - -# [@cypress/vue2-v1.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vue2-v1.0.0...@cypress/vue2-v1.0.1) (2022-06-13) - - -### Bug Fixes - -* remove http npm registry link for vue2 ([0bd3069](https://github.com/cypress-io/cypress/commit/0bd306962bce2a32d7b87fc1811a7b9feeb63ae2)) - -# @cypress/vue2-v1.0.0 (2022-06-13) - - -### Bug Fixes - -* add package.json metadata for webpack-dev-server ([#22292](https://github.com/cypress-io/cypress/issues/22292)) ([9cfec97](https://github.com/cypress-io/cypress/commit/9cfec9750f2ddc9fe691aabbe2ecc9bc02a3d915)) -* display cy.mount command log ([#21500](https://github.com/cypress-io/cypress/issues/21500)) ([140b4ba](https://github.com/cypress-io/cypress/commit/140b4ba2110243712a614a39b2408c30cce4d0b1)) -* Doc changes around vue2 ([#21066](https://github.com/cypress-io/cypress/issues/21066)) ([17905a7](https://github.com/cypress-io/cypress/commit/17905a79ee5106b0d72c8e74bb717fcd7b796dee)) - - -### chore - -* prep npm packages for use with Cypress v10 ([b924d08](https://github.com/cypress-io/cypress/commit/b924d086ee2e2ccc93303731e001b2c9e9d0af17)) - - -### Features - -* Add vue2 package from npm/vue/v2 branch ([#21026](https://github.com/cypress-io/cypress/issues/21026)) ([3aa69e2](https://github.com/cypress-io/cypress/commit/3aa69e2538aae5702bfc48789c54f37263ce08fc)) -* swap the #__cy_root id selector to become data-cy-root for component mounting ([#20951](https://github.com/cypress-io/cypress/issues/20951)) ([0e7b555](https://github.com/cypress-io/cypress/commit/0e7b555f93fb403f431c5de4a07ae7ad6ac89ba2)) - - -### BREAKING CHANGES - -* new version of packages for Cypress v10 - -# @cypress/vue2-v1.0.0 (2021-06-17) - -### Features - -* Split out as separate package from `@cypress/vue`, based on the `npm/vue/v2` branch. diff --git a/npm/vue2/README.md b/npm/vue2/README.md deleted file mode 100644 index 0dcb604eebaf..000000000000 --- a/npm/vue2/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# @cypress/vue2 - -Mount Vue 2 components in the open source [Cypress.io](https://www.cypress.io/) test runner - -> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Vue Component Testing Docs](https://docs.cypress.io/guides/component-testing/vue/overview) for mounting Vue components. Installing and importing `mount` from `@cypress/vue2` should only be done for advanced use-cases. - -## [Changelog](./CHANGELOG.md) diff --git a/npm/vue2/babel.config.json b/npm/vue2/babel.config.json deleted file mode 100644 index 589f7ada6cbd..000000000000 --- a/npm/vue2/babel.config.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "plugins": [ - "@babel/plugin-transform-modules-commonjs", - [ - "babel-plugin-istanbul", - { - "extension": [ - ".js", - ".vue" - ] - } - ] - ] -} diff --git a/npm/vue2/docs/styles.md b/npm/vue2/docs/styles.md deleted file mode 100644 index d6b0542f9228..000000000000 --- a/npm/vue2/docs/styles.md +++ /dev/null @@ -1,47 +0,0 @@ -# styles - -If your component imports its own style, the style should be applied during the Cypress test. - -```js -// MyComponent.vue - - - -``` - -You can also load styles in the following ways: - -## Import in the spec file - -```js -import '../styles/main.css' - -const myComponent = { - template: '' -} - -mount(myComponent) -``` - -## Import in the component support file - -If you have stylesheets that should apply to all of your components, you can import those from your component support file. - -```js -// cypress/support/component.js -import '../styles/main.css' -... - -// MyComponent.spec.js -const myComponent = { - template: '' -} - -mount(myComponent) -``` diff --git a/npm/vue2/package.json b/npm/vue2/package.json deleted file mode 100644 index e71a42d2f880..000000000000 --- a/npm/vue2/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@cypress/vue2", - "version": "0.0.0-development", - "description": "Browser-based Component Testing for Vue.js@2 with Cypress.io ✌️🌲", - "main": "dist/cypress-vue2.cjs.js", - "scripts": { - "build": "rimraf dist && yarn rollup -c rollup.config.mjs", - "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js", - "check-ts": "tsc --noEmit", - "lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .", - "test": "echo \"Tests for @cypress/vue2 are run from system-tests\"", - "test-ci": "node ../../scripts/run-ct-examples.js --examplesList=./examples.env", - "watch": "yarn build --watch --watch.exclude ./dist/**/*" - }, - "devDependencies": { - "@cypress/mount-utils": "0.0.0-development", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-replace": "^2.3.1", - "@vue/test-utils": "^1.3.1", - "tslib": "^2.1.0", - "typescript": "~5.4.5", - "vue": "2.7.16" - }, - "peerDependencies": { - "cypress": ">=4.5.0", - "vue": "^2.0.0" - }, - "files": [ - "dist/**/*", - "src/**/*.js" - ], - "engines": { - "node": ">=8" - }, - "types": "dist/index.d.ts", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/cypress-io/cypress.git" - }, - "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/vue/#readme", - "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fvue&template=1-bug-report.md&title=", - "keywords": [ - "cypress", - "vue" - ], - "unpkg": "dist/cypress-vue2.browser.js", - "module": "dist/cypress-vue2.esm-bundler.js", - "publishConfig": { - "access": "public" - }, - "nx": { - "targets": { - "build": { - "outputs": [ - "{workspaceRoot}/cli/vue2", - "{projectRoot}/dist" - ] - } - }, - "implicitDependencies": [ - "!cypress" - ] - } -} diff --git a/npm/vue2/rollup.config.mjs b/npm/vue2/rollup.config.mjs deleted file mode 100644 index b693c9343a49..000000000000 --- a/npm/vue2/rollup.config.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { createEntries } from '@cypress/mount-utils/create-rollup-entry.mjs' -import json from '@rollup/plugin-json' -import replace from '@rollup/plugin-replace' - -const dtsOptions = { - respectExternal: false, -} - -const config = { - external: [ - 'vue', - ], - plugins: [ - json(), - /** - * Vue 2 core tries to load require.resolve(`./package.json`) in the browser for the - * sole purpose of throwing an error about Vue Loader. - * Just truncate this for now for simplicity. - */ - replace({ - 'vueVersion && vueVersion !== packageVersion': JSON.stringify(false), - preventAssignment: false, - }), - ], - output: { - globals: { - vue: 'Vue', - }, - }, -} - -export default createEntries({ formats: ['es', 'cjs'], input: 'src/index.ts', config, dtsOptions }) diff --git a/npm/vue2/src/index.ts b/npm/vue2/src/index.ts deleted file mode 100644 index c5c7a6c5541a..000000000000 --- a/npm/vue2/src/index.ts +++ /dev/null @@ -1,478 +0,0 @@ -/// -import Vue from 'vue' -import { - createLocalVue, - mount as testUtilsMount, - VueTestUtilsConfigOptions, - Wrapper, -} from '@vue/test-utils' -import { - getContainerEl, - setupHooks, - checkForRemovedStyleOptions, -} from '@cypress/mount-utils' -import { ComponentPublicInstanceConstructor } from 'vue/types/v3-component-public-instance' - -const defaultOptions: (keyof MountOptions)[] = [ - 'vue', - 'extensions', -] - -const DEFAULT_COMP_NAME = 'unknown' - -const registerGlobalComponents = (Vue, options) => { - const globalComponents = Cypress._.get(options, 'extensions.components') - - if (Cypress._.isPlainObject(globalComponents)) { - Cypress._.forEach(globalComponents, (component, id) => { - Vue.component(id, component) - }) - } -} - -const installFilters = (Vue, options) => { - const filters: VueFilters | undefined = Cypress._.get( - options, - 'extensions.filters', - ) - - if (Cypress._.isPlainObject(filters)) { - Object.keys(filters).forEach((name) => { - Vue.filter(name, filters[name]) - }) - } -} - -const installPlugins = (Vue, options, props) => { - const plugins: VuePlugins = - Cypress._.get(props, 'plugins') || - Cypress._.get(options, 'extensions.use') || - Cypress._.get(options, 'extensions.plugins') || - [] - - // @ts-ignore - plugins.forEach((p) => { - Array.isArray(p) ? Vue.use(...p) : Vue.use(p) - }) -} - -const installMixins = (Vue, options) => { - const mixins = - Cypress._.get(options, 'extensions.mixin') || - Cypress._.get(options, 'extensions.mixins') - - if (Cypress._.isArray(mixins)) { - mixins.forEach((mixin) => { - Vue.mixin(mixin) - }) - } -} - -const registerGlobalDirectives = (Vue, options) => { - const directives = - Cypress._.get(options, 'extensions.directives') - - if (Cypress._.isPlainObject(directives)) { - Object.keys(directives).forEach((name) => { - Vue.directive(name, directives[name]) - }) - } -} - -const hasStore = ({ store }: { store: any }) => Boolean(store && store._vm) - -const forEachValue = (obj: Record, fn: (value: T, key: string) => void) => { - return Object.keys(obj).forEach((key) => fn(obj[key], key)) -} - -const resetStoreVM = (Vue, { store }) => { - // bind store public getters - store.getters = {} - const wrappedGetters = store._wrappedGetters as Record void> - const computed = {} - - forEachValue(wrappedGetters, (fn, key) => { - // use computed to leverage its lazy-caching mechanism - computed[key] = () => fn(store) - Object.defineProperty(store.getters, key, { - get: () => store._vm[key], - enumerable: true, // for local getters - }) - }) - - store._watcherVM = new Vue() - store._vm = new Vue({ - data: { - $$state: store._vm._data.$$state, - }, - computed, - }) - - return store -} - -/** - * Type for component passed to "mount" - * - * @interface VueComponent - * @example - * import Hello from './Hello.vue' - * ^^^^^ this type - * mount(Hello) - */ -type VueComponent = Vue.ComponentOptions | Vue.VueConstructor | ComponentPublicInstanceConstructor - -/** - * Options to pass to the component when creating it, like - * props. - * - * @interface ComponentOptions - */ -type ComponentOptions = Record - -// local placeholder types -type VueLocalComponents = Record - -type VueFilters = { - [key: string]: (value: string) => string -} - -type VueDirectives = { - [key: string]: Function | Object -} - -type VueMixin = unknown -type VueMixins = VueMixin | VueMixin[] - -type VuePluginOptions = unknown -type VuePlugin = unknown | [unknown, VuePluginOptions] -/** - * A single Vue plugin or a list of plugins to register - */ -type VuePlugins = VuePlugin[] - -/** - * Additional Vue services to register while mounting the component, like - * local components, plugins, etc. - * - * @interface MountOptionsExtensions - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - */ -interface MountOptionsExtensions { - /** - * Extra local components - * - * @memberof MountOptionsExtensions - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - * @example - * import Hello from './Hello.vue' - * // imagine Hello needs AppComponent - * // that it uses in its template like - * // during testing we can replace it with a mock component - * const appComponent = ... - * const components = { - * 'app-component': appComponent - * }, - * mount(Hello, { extensions: { components }}) - */ - components?: VueLocalComponents - - /** - * Optional Vue filters to install while mounting the component - * - * @memberof MountOptionsExtensions - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - * @example - * const filters = { - * reverse: (s) => s.split('').reverse().join(''), - * } - * mount(Hello, { extensions: { filters }}) - */ - filters?: VueFilters - - /** - * Optional Vue mixin(s) to install when mounting the component - * - * @memberof MountOptionsExtensions - * @alias mixins - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - */ - mixin?: VueMixins - - /** - * Optional Vue mixin(s) to install when mounting the component - * - * @memberof MountOptionsExtensions - * @alias mixin - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - */ - mixins?: VueMixins - - /** - * A single plugin or multiple plugins. - * - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - * @alias plugins - * @memberof MountOptionsExtensions - */ - use?: VuePlugins - - /** - * A single plugin or multiple plugins. - * - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - * @alias use - * @memberof MountOptionsExtensions - */ - plugins?: VuePlugins - - /** - * Optional Vue directives to install while mounting the component - * - * @memberof MountOptionsExtensions - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - * @example - * const directives = { - * custom: { - * name: 'custom', - * bind (el, binding) { - * el.dataset['custom'] = binding.value - * }, - * unbind (el) { - * el.removeAttribute('data-custom') - * }, - * }, - * } - * mount(Hello, { extensions: { directives }}) - */ - directives?: VueDirectives -} - -/** - * Options controlling how the component is going to be mounted, - * including global Vue plugins and extensions. - * - * @interface MountOptions - */ -interface MountOptions { - /** - * Vue instance to use. - * - * @deprecated - * @memberof MountOptions - */ - vue: unknown - - /** - * Extra Vue plugins, mixins, local components to register while - * mounting this component - * - * @memberof MountOptions - * @see https://github.com/cypress-io/cypress/tree/develop/npm/vue#examples - */ - extensions: MountOptionsExtensions -} - -/** - * Utility type for union of options passed to "mount(..., options)" - */ -type MountOptionsArgument = Partial - -// when we mount a Vue component, we add it to the global Cypress object -// so here we extend the global Cypress namespace and its Cypress interface -declare global { - // eslint-disable-next-line no-redeclare - namespace Cypress { - interface Cypress { - /** - * Mounted Vue instance is available under Cypress.vue - * @memberof Cypress - * @example - * mount(Greeting) - * .then(() => { - * Cypress.vue.message = 'Hello There' - * }) - * // new message is displayed - * cy.contains('Hello There').should('be.visible') - */ - vue: Vue - vueWrapper: Wrapper - } - } -} - -const cleanup = () => { - Cypress.vueWrapper?.destroy() -} - -/** - * Direct Vue errors to the top error handler - * where they will fail Cypress test - * @see https://vuejs.org/v2/api/#errorHandler - * @see https://github.com/cypress-io/cypress/issues/7910 - */ -function failTestOnVueError (err, vm, info) { - // Vue 2 try catches the error-handler so push the error to be caught outside - // of the handler. - setTimeout(() => { - throw err - }) -} - -/** - * Extract the component name from the object passed to mount - * @param componentOptions the component passed to mount - * @returns name of the component - */ -function getComponentDisplayName (componentOptions: any): string { - if (componentOptions.name) { - return componentOptions.name - } - - if (componentOptions.__file) { - const filepathSplit = componentOptions.__file.split('/') - const fileName = filepathSplit[filepathSplit.length - 1] ?? DEFAULT_COMP_NAME - - // remove the extension .js, .ts or .vue from the filename to get the name of the component - const baseFileName = fileName.replace(/\.(js|ts|vue)?$/, '') - - // if the filename is index, then we can use the direct parent foldername, else use the name itself - return (baseFileName === 'index' ? filepathSplit[filepathSplit.length - 2] : baseFileName) - } - - return DEFAULT_COMP_NAME -} - -/** - * Mounts a Vue component inside Cypress browser. - * @param {VueComponent} component imported from Vue file - * @param {MountOptionsArgument} optionsOrProps used to pass options to component being mounted - * @returns {Cypress.Chainable<{wrapper: Wrapper, component: T} - * @example - * import { mount } from '@cypress/vue' - * import { Stepper } from './Stepper.vue' - * - * it('mounts', () => { - * cy.mount(Stepper) - * cy.get('[data-cy=increment]').click() - * cy.get('[data-cy=counter]').should('have.text', '1') - * }) - * @see {@link https://on.cypress.io/mounting-vue} for more details. - * - */ -export const mount = ( - component: VueComponent, - optionsOrProps: MountOptionsArgument = {}, -): Cypress.Chainable<{ - wrapper: Wrapper - component: Wrapper['vm'] -}> => { - checkForRemovedStyleOptions(optionsOrProps) - // Remove last mounted component if cy.mount is called more than once in a test - cleanup() - - const options: Partial = Cypress._.pick( - optionsOrProps, - defaultOptions, - ) - const props: Partial = Cypress._.omit( - optionsOrProps, - defaultOptions, - ) - - const componentName = getComponentDisplayName(component) - const message = `<${componentName} ... />` - - return cy - .window({ - log: false, - }) - .then((win) => { - const localVue = createLocalVue() - - // @ts-ignore - win.Vue = localVue - localVue.config.errorHandler = failTestOnVueError - - // set global Vue instance: - // 1. convenience for debugging in DevTools - // 2. some libraries might check for this global - // appIframe.contentWindow.Vue = localVue - - // refresh inner Vue instance of Vuex store - // @ts-ignore - if (hasStore(component)) { - // @ts-ignore - component.store = resetStoreVM(localVue, component) - } - - // @ts-ignore - const document: Document = cy.state('document') - - let el = getContainerEl() - - const componentNode = document.createElement('div') - - el.append(componentNode) - - // setup Vue instance - installFilters(localVue, options) - installMixins(localVue, options) - installPlugins(localVue, options, props) - registerGlobalDirectives(localVue, options) - registerGlobalComponents(localVue, options) - - props.attachTo = componentNode - - const wrapper = localVue.extend(component as any) - - const VTUWrapper = testUtilsMount(wrapper, { localVue, ...props }) - - Cypress.vue = VTUWrapper.vm - Cypress.vueWrapper = VTUWrapper - - return { - wrapper: VTUWrapper, - component: VTUWrapper.vm, - } - }) - .then(() => { - if (optionsOrProps.log !== false) { - return Vue.nextTick(() => { - Cypress.log({ - name: 'mount', - message: [message], - }) - }) - } - }) -} - -/** - * Helper function for mounting a component quickly in test hooks. - * @example - * import {mountCallback} from '@cypress/vue2' - * beforeEach(mountVue(component, options)) - * - * Removed as of Cypress 11.0.0. - * @see https://on.cypress.io/migration-11-0-0-component-testing-updates - */ -export const mountCallback = ( - component: VueComponent, - options?: MountOptionsArgument, -) => { - return () => { - // @ts-expect-error - undocumented API - Cypress.utils.throwErrByPath('mount.mount_callback') - } -} - -// Side effects from "import { mount } from '@cypress/'" are annoying, we should avoid doing this -// by creating an explicit function/import that the user can register in their 'component.js' support file, -// such as: -// import 'cypress//support' -// or -// import { registerCT } from 'cypress/' -// registerCT() -// Note: This would be a breaking change -setupHooks(cleanup) diff --git a/npm/vue2/tsconfig.json b/npm/vue2/tsconfig.json deleted file mode 100644 index ea20f06c3e05..000000000000 --- a/npm/vue2/tsconfig.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, - "skipLibCheck": true, - "lib": [ - "es2015", - "dom" - ] /* Specify library files to be included in the compilation: */, - "allowJs": true /* Allow javascript files to be compiled. */, - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true /* Generates corresponding '.d.ts' file. */, - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "dist" /* Redirect output structure to the directory. */, - // "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": false /* Enable all strict type-checking options. */, - "noImplicitAny": false, - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": [ - "cypress" - ] /* Type declaration files to be included in compilation. */, - "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "esModuleInterop": true - }, - "include": ["src/**/*.*"], - "exclude": ["src/**/*-spec.*"] -} diff --git a/npm/vue2/webpack.config.js b/npm/vue2/webpack.config.js deleted file mode 100644 index aa4b03573e40..000000000000 --- a/npm/vue2/webpack.config.js +++ /dev/null @@ -1,53 +0,0 @@ -// A basic webpack configuration -// The default for running tests in this project -// https://vue-loader.vuejs.org/guide/#manual-setup -const VueLoaderPlugin = require('vue-loader/lib/plugin') -const path = require('path') -const pkg = require('package.json') - -module.exports = { - mode: 'development', - output: { - path: path.join(__dirname, 'dist'), - filename: 'js/[name].js', - publicPath: '/', - chunkFilename: 'js/[name].js', - }, - - resolve: { - extensions: ['.js', '.json', '.vue'], - alias: { - // point at the built file - '@cypress/vue2': path.join(__dirname, pkg.main), - vue: 'vue/dist/vue.esm.js', - }, - }, - module: { - rules: [ - { - test: /\.vue$/, - loader: 'vue-loader', - }, - { - test: /\.js$/, - loader: 'babel-loader', - }, - // this will apply to both plain `.css` files - // AND ` - - -
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
-
-The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
-
-We've detected that your code is still using the previous, deprecated interface signature.
-
-This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
-
\ No newline at end of file diff --git a/packages/errors/__snapshot-html__/EXPERIMENTAL_COMPONENT_TESTING_REMOVED.html b/packages/errors/__snapshot-html__/EXPERIMENTAL_COMPONENT_TESTING_REMOVED.html index 3a9784cc3e03..349eec66a283 100644 --- a/packages/errors/__snapshot-html__/EXPERIMENTAL_COMPONENT_TESTING_REMOVED.html +++ b/packages/errors/__snapshot-html__/EXPERIMENTAL_COMPONENT_TESTING_REMOVED.html @@ -38,9 +38,9 @@ Please remove this flag from: /path/to/cypress.config.js -Component Testing is now a standalone command. You can now run your component tests with: +Component Testing is now a supported testing type. You can run your component tests with: - $ cypress open-ct + $ cypress open --component https://on.cypress.io/migration-guide \ No newline at end of file diff --git a/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html b/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html deleted file mode 100644 index fd88bc7d472c..000000000000 --- a/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - -
Cypress does not support running chrome version 64. To use chrome with Cypress, install a version of chrome newer than or equal to 64.
-
\ No newline at end of file diff --git a/packages/errors/package.json b/packages/errors/package.json index 51c153843cc6..c5098dd2d383 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -26,7 +26,7 @@ "@packages/types": "0.0.0-development", "@types/chai": "4.2.15", "@types/mocha": "8.2.2", - "@types/node": "18.17.5", + "@types/node": "20.16.0", "@types/pngjs": "^6.0.1", "ansi-styles": "^5", "chai": "4.2.0", diff --git a/packages/errors/src/errors.ts b/packages/errors/src/errors.ts index 589353504a4e..79dd5f6422c4 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -386,16 +386,6 @@ export const AllCypressErrors = { https://on.cypress.io/auto-cancellation-mismatch` }, - DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS: () => { - return errTemplate`\ - Deprecation Warning: The ${fmt.highlight(`before:browser:launch`)} plugin event changed its signature in ${fmt.cypressVersion(`4.0.0`)} - - The event switched from yielding the second argument as an ${fmt.highlightSecondary(`array`)} of browser arguments to an options ${fmt.highlightSecondary(`object`)} with an ${fmt.highlightSecondary(`args`)} property. - - We've detected that your code is still using the previous, deprecated interface signature. - - This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args` - }, DUPLICATE_TASK_KEY: (arg1: string[]) => { return errTemplate`\ Warning: Multiple attempts to register the following task(s): @@ -1257,9 +1247,9 @@ export const AllCypressErrors = { Please remove this flag from: ${fmt.path(arg1.configFile)} - Component Testing is now a standalone command. You can now run your component tests with: + Component Testing is now a supported testing type. You can run your component tests with: - ${fmt.terminal(`cypress open-ct`)} + ${fmt.terminal(`cypress open --component`)} https://on.cypress.io/migration-guide` }, @@ -1426,6 +1416,7 @@ export const AllCypressErrors = { https://on.cypress.io/component-testing` }, + UNSUPPORTED_BROWSER_VERSION: (errorMsg: string) => { return errTemplate`${fmt.off(errorMsg)}` }, diff --git a/packages/errors/test/unit/visualSnapshotErrors_spec.ts b/packages/errors/test/unit/visualSnapshotErrors_spec.ts index 8960060f24fe..9c3a912dadc9 100644 --- a/packages/errors/test/unit/visualSnapshotErrors_spec.ts +++ b/packages/errors/test/unit/visualSnapshotErrors_spec.ts @@ -570,11 +570,6 @@ describe('visual error templates', () => { }], } }, - DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS: () => { - return { - default: [], - } - }, DUPLICATE_TASK_KEY: () => { const tasks = ['foo', 'bar', 'baz'] diff --git a/packages/frontend-shared/cypress/fixtures/config.json b/packages/frontend-shared/cypress/fixtures/config.json index a88d6e939039..9b9f487204f2 100644 --- a/packages/frontend-shared/cypress/fixtures/config.json +++ b/packages/frontend-shared/cypress/fixtures/config.json @@ -23,7 +23,6 @@ "displayName": "Chrome", "version": "97.0.4692.71", "path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", - "minSupportedVersion": 64, "majorVersion": 97 }, { @@ -33,7 +32,6 @@ "displayName": "Firefox", "version": "95.0.2", "path": "/Applications/Firefox.app/Contents/MacOS/firefox", - "minSupportedVersion": 86, "majorVersion": 95 }, { @@ -87,11 +85,6 @@ "from": "default", "field": "experimentalCspAllowList" }, - { - "value": false, - "from": "default", - "field": "experimentalFetchPolyfill" - }, { "value": true, "from": "default", diff --git a/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts b/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts index 68b53727e0e8..fb13244856ab 100644 --- a/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts +++ b/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts @@ -84,9 +84,9 @@ export const longBrowsersList = [ displayName: 'Edge Beta', family: 'chromium', channel: 'beta', - version: 'unsupported', + version: '85.0.309.71', path: '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta', - majorVersion: '79', + majorVersion: '85', isFocusSupported: true, isVersionSupported: false, disabled: false, @@ -126,9 +126,8 @@ export const longBrowsersList = [ version: '69.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '69', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -140,9 +139,8 @@ export const longBrowsersList = [ version: '75.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '75', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -169,7 +167,7 @@ export const longBrowsersList = [ path: '/Applications/Firefox Nightly/Contents/MacOS/Firefox Nightly', majorVersion: '69', isFocusSupported: false, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -182,7 +180,7 @@ export const longBrowsersList = [ path: '/Applications/Fake Browser/Contents/MacOS/Fake Browser', majorVersion: '79', isFocusSupported: false, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, ] as const diff --git a/packages/frontend-shared/src/assets/logos/nuxt.svg b/packages/frontend-shared/src/assets/logos/nuxt.svg deleted file mode 100644 index 0517b9b66abb..000000000000 --- a/packages/frontend-shared/src/assets/logos/nuxt.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx b/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx index 0d9ed5595d47..16d82495cd7f 100644 --- a/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx +++ b/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx @@ -53,11 +53,6 @@ describe('', { viewportWidth: 1000, viewportHeight: 750 }, ( }) cy.contains('Unsupported browser').should('be.visible') - - /* - TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23436 - cy.percySnapshot('unsupported browser tooltip') - */ }) describe('breadcrumbs', () => { diff --git a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue index 96bb32b445d9..6ee142b30fb2 100644 --- a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue +++ b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue @@ -11,7 +11,6 @@ 'cursor-pointer': !browser.disabled && browser.isVersionSupported }" data-cy="top-nav-browser-list-item" - :data-browser-id="browser.id" @click="handleBrowserChoice(browser)" > @@ -24,7 +23,7 @@
-
-