From 07b1c3bb4902505b2ad3ddcd6c997e86356d8816 Mon Sep 17 00:00:00 2001 From: Evan Liu <55378595+evanryuu@users.noreply.github.com> Date: Thu, 7 Sep 2023 00:23:18 +0800 Subject: [PATCH 1/8] chore: make indent consistent (#27757) --- packages/driver/src/cy/keyboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/driver/src/cy/keyboard.ts b/packages/driver/src/cy/keyboard.ts index 6bf3660a5f89..35f2f0a5f0c3 100644 --- a/packages/driver/src/cy/keyboard.ts +++ b/packages/driver/src/cy/keyboard.ts @@ -1194,7 +1194,7 @@ export class Keyboard { ) { if ( shouldIgnoreEvent('textInput', key.events) || - this.fireSimulatedEvent(elToType, 'textInput', key, options) + this.fireSimulatedEvent(elToType, 'textInput', key, options) ) { return this.performSimulatedDefault(elToType, key, options) } From 264a118e4858ea6bc401d71895b09f656a4dc938 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 6 Sep 2023 14:47:30 -0400 Subject: [PATCH 2/8] feat(webpack-dev-server): update the generated tsconfig path for angular CT (#27723) * feat(webpack-dev-server): update the generated tsconfig path for angular CT * update changelog * build binary * fix broken tests --- .circleci/workflows.yml | 14 +++++--------- cli/CHANGELOG.md | 8 ++++++++ .../src/helpers/angularHandler.ts | 6 +++--- .../test/handlers/angularHandler.spec.ts | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index b6b50e09b4fb..8de1a73572a1 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -29,9 +29,8 @@ mainBuildFilters: &mainBuildFilters - develop - /^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' - 'publish-binary' - - 'cacie/chore/capture-metadata' + - 'jordanpowell88/update-angular-tsconfig-path' # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -41,8 +40,7 @@ macWorkflowFilters: &darwin-workflow-filters or: - 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: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ] + - equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -52,9 +50,8 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters or: - 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: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] - equal: [ 'publish-binary', << pipeline.git.branch >> ] - - equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -73,8 +70,7 @@ windowsWorkflowFilters: &windows-workflow-filters or: - 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: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ] + - equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -144,7 +140,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" != "publish-binary" && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "ryanm/feat/handle-304s" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "jordanpowell88/update-angular-tsconfig-path" && "$CIRCLE_BRANCH" != "ryanm/feat/handle-304s" ]]; 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 diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 1d7bb07ec36c..4aa25bfd38c6 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,4 +1,12 @@ +## 13.2.0 + +_Released 09/12/2023 (PENDING)_ + +**Features:** + + - Adds support for Nx users who want to run Angular Component Testing in parallel. Addresses [#27723](https://github.com/cypress-io/cypress/pull/27723). + ## 13.1.0 _Released 08/31/2023_ diff --git a/npm/webpack-dev-server/src/helpers/angularHandler.ts b/npm/webpack-dev-server/src/helpers/angularHandler.ts index 03d004646525..59d9e2ff0e4d 100644 --- a/npm/webpack-dev-server/src/helpers/angularHandler.ts +++ b/npm/webpack-dev-server/src/helpers/angularHandler.ts @@ -154,15 +154,15 @@ export async function generateTsConfig (devServerConfig: AngularWebpackDevServer include: includePaths, }, null, 2) - const tsConfigPath = path.join(await getTempDir(), 'tsconfig.json') + const tsConfigPath = path.join(await getTempDir(path.basename(projectRoot)), 'tsconfig.json') await fs.writeFile(tsConfigPath, tsConfigContent) return tsConfigPath } -export async function getTempDir (): Promise { - const cypressTempDir = path.join(tmpdir(), 'cypress-angular-ct') +export async function getTempDir (projectName: string): Promise { + const cypressTempDir = path.join(tmpdir(), 'cypress-angular-ct', projectName) await fs.ensureDir(cypressTempDir) diff --git a/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts b/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts index b382f279da22..c64ee62d51bf 100644 --- a/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts +++ b/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts @@ -194,7 +194,7 @@ const expectLoadsAngularBuildOptions = (buildOptions: BuildOptions) => { const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerConfig, buildOptions: any) => { const { projectRoot } = devServerConfig.cypressConfig let tsConfigPath = await generateTsConfig(devServerConfig, buildOptions) - const tempDir = await getTempDir() + const tempDir = await getTempDir(path.basename(projectRoot)) expect(tsConfigPath).to.eq(path.join(tempDir, 'tsconfig.json')) From b94f4bc0f8b33d35c5ec0ef670ef37f5e5240d73 Mon Sep 17 00:00:00 2001 From: Evan Liu <55378595+evanryuu@users.noreply.github.com> Date: Thu, 7 Sep 2023 20:43:24 +0800 Subject: [PATCH 3/8] docs: fix CONTRIBUTING.md package typo (#27758) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de2fc52b73f5..800dd5bd5904 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,7 +163,7 @@ Here is a list of the core packages in this repository with a short description, | [socket](./packages/socket) | `@packages/socket` | A wrapper around socket.io to provide common libraries. | | [ts](./packages/ts) | `@packages/ts` | A centralized version of typescript. | | [types](./packages/types) | `@packages/types` | The shared internal Cypress types. | - | [v8-snapshot-require](./packages/v8-snapshot-require) | `@packages/v8-snapshot-requie` | Tool to load a snapshot for Electron applications that was created by `@tooling/v8-snapshot`. | + | [v8-snapshot-require](./packages/v8-snapshot-require) | `@packages/v8-snapshot-require` | Tool to load a snapshot for Electron applications that was created by `@tooling/v8-snapshot`. | | [web-config](./packages/web-config) | `@packages/web-config` | The web-related configuration. | Private packages involved in development of the app live within the [`tooling`](./tooling) directory and are in the `@tooling/` namespace. They are discrete modules with different responsibilities, but each is necessary for development of the Cypress app and is not necessarily useful outside of the Cypress app. From 617d7af3281bfe005e05b95ef05349dc1a4d8222 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 7 Sep 2023 09:21:57 -0400 Subject: [PATCH 4/8] chore: release @cypress/webpack-dev-server-v3.6.0 [skip ci] --- npm/webpack-dev-server/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/npm/webpack-dev-server/CHANGELOG.md b/npm/webpack-dev-server/CHANGELOG.md index 7ed74a7fcde6..f0c3fc14da8c 100644 --- a/npm/webpack-dev-server/CHANGELOG.md +++ b/npm/webpack-dev-server/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@cypress/webpack-dev-server-v3.6.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v3.5.3...@cypress/webpack-dev-server-v3.6.0) (2023-09-07) + + +### Features + +* **webpack-dev-server:** update the generated tsconfig path for angular CT ([#27723](https://github.com/cypress-io/cypress/issues/27723)) ([264a118](https://github.com/cypress-io/cypress/commit/264a118e4858ea6bc401d71895b09f656a4dc938)) + # [@cypress/webpack-dev-server-v3.5.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v3.5.2...@cypress/webpack-dev-server-v3.5.3) (2023-08-29) From b85dd752f21494d64b7d7c065f74acbe6564dca8 Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Thu, 7 Sep 2023 15:26:09 -0400 Subject: [PATCH 5/8] dependency: update to electron 25 and node 18 (#27715) * feat: update to electron 25 and bump node dependencies. need to remove custom docker image * chore: update node versions to 18+ [run ci] * chore: bump @types/node from v16 to v18 and bump the typescript supported CLI version from 3.9 to 4.4 * update mock-fs to 5.2.0 to fix BigInt issue (see https://github.com/tschaub/mock-fs/releases/tag/v5.1.4) [run ci] * chore: update electron integrity check to pass create binary job * chore: fix issues with achrinza/node-ipc not yet having node 18 engine support (only up to 17 by patching from 9.2.2 to 9.2.5 as seen in https://github.com/achrinza/node-ipc/pull/38. vue/cli-service is not maintained and we should migrate these over to vue create at some point in the near future to get rid of these resolutions * allow for TLSv1 tests to work with node 18 as the express server running node 18 with tlsv1 needs to allow legacy ciphers * chore: update snyk workflows to use node 18 * chore: add changelog * update timeout * more cleanup during binary build * bump cache and run ci. include ignore engines for rwa and get rid of 16.16 image references * chore: update FF tests to 115 as serialization now works with errors and click events do not get fired on buttons being typed into * chore: don't error when symlink already exists * chore: fix serialization test for newer versions of firefox * chore: fix CI config * chore: fix chrome system tests to work with chrome 114. updates mostly caused by bugs in screen height in chrome. see https://bugs.chromium.org/p/chromium/issues/detail?id=1416398 * chore: test binary against vite update in RWA * remove wait for RWA as it shouldnt be needed for vite. link example recipes update to node 18 chore: remove commented out code * chore: print message when DISABLE_SNAPSHOT_REQUIRE is set * chore: clean out unneeded dependencies always * chore: remove trailing space * fix: propagate click events for enter and typing on firefox 106 or later * chore: fix changelog failures * fix: correctly simulate click events for buttons on keyup and space type in Firefox versions greater than 91 and simulate click for buttons on enter in Firefox versions greater than or equal to 106 * chore: add documentation to type to clarify firefox synthetic events * chore: update protocol snapshot as order or log messages seems to have changed * update comments * sort commandLogChanged events for protocol * chore: remove PR ids from CRA and CER as the PRs are merged into develop --------- Co-authored-by: Ryan Manuel Co-authored-by: Chris Breiding Co-authored-by: Matt Schile --- .circleci/cache-version.txt | 2 +- .circleci/workflows.yml | 33 +- .github/ISSUE_TEMPLATE/1-bug-report.yml | 2 +- .github/ISSUE_TEMPLATE/2-memory-issue.yml | 2 +- .github/ISSUE_TEMPLATE/3-install-issue.yml | 2 +- .github/workflows/snyk_sca_scan.yaml | 4 +- .../workflows/snyk_static_analysis_scan.yaml | 2 +- .github/workflows/update-browser-versions.yml | 2 +- .../workflows/update_v8_snapshot_cache.yml | 2 +- .node-version | 2 +- cli/CHANGELOG.md | 8 + cli/package.json | 4 +- npm/create-cypress-tests/package.json | 4 +- npm/cypress-schematic/package.json | 2 +- npm/webpack-dev-server/package.json | 2 +- package.json | 8 +- .../src/actions/ElectronActions.ts | 2 +- .../cypress/e2e/e2e/origin/config_env.cy.ts | 17 +- .../cypress/e2e/e2e/origin/validation.cy.ts | 2 +- .../cypress/e2e/util/serialization.cy.ts | 28 +- .../driver/src/cy/commands/actions/type.ts | 33 +- .../driver/src/util/serialization/README.md | 8 +- packages/errors/package.json | 2 +- packages/launcher/package.json | 2 +- packages/server/lib/modes/interactive.ts | 2 +- packages/server/package.json | 4 +- packages/types/package.json | 2 +- scripts/after-pack-hook.js | 6 +- scripts/binary/binary-cleanup.js | 7 + .../binary/binary-integrity-check-source.js | 2 +- scripts/run-docker-local.sh | 2 +- .../browser_crash_handling_spec.js | 2 +- .../component_testing_spec.ts.js | 4 +- .../__snapshots__/headless_spec.ts.js | 33 +- system-tests/__snapshots__/protocol_spec.js | 728 +++++++++--------- system-tests/__snapshots__/retries_spec.ts.js | 62 ++ .../vite_dev_server_fresh_spec.ts.js | 56 +- .../webpack_dev_server_fresh_spec.ts.js | 56 +- system-tests/lib/dep-installer/index.ts | 3 + .../lib/protocol-stubs/protocolStub.ts | 5 + .../angular/src/app/zonejs-mocha-skip.cy.ts | 4 +- system-tests/projects/angular-13/package.json | 2 +- system-tests/projects/angular-13/yarn.lock | 8 +- .../ct-public-api-solid-js/package-lock.json | 2 +- .../projects/e2e/cypress/e2e/headless.cy.js | 11 +- .../issue-25951-next-app/package.json | 2 +- .../projects/issue-25951-next-app/yarn.lock | 8 +- .../cypress/e2e/default_size.cy.js | 51 +- .../projects/vuecli4-vue2/package.json | 3 + system-tests/projects/vuecli4-vue2/yarn.lock | 8 +- .../projects/vuecli4-vue3/package.json | 3 + system-tests/projects/vuecli4-vue3/yarn.lock | 8 +- .../vuecli5-vue3-type-module/package.json | 3 + .../vuecli5-vue3-type-module/yarn.lock | 13 +- .../projects/vuecli5-vue3/package.json | 3 + system-tests/projects/vuecli5-vue3/yarn.lock | 8 +- .../vuecli5vue3-unconfigured/package.json | 5 +- .../vuecli5vue3-unconfigured/yarn.lock | 8 +- .../vueclivue2-configured/package.json | 5 +- .../projects/vueclivue2-configured/yarn.lock | 8 +- .../vueclivue2-unconfigured/package.json | 5 +- .../vueclivue2-unconfigured/yarn.lock | 8 +- .../vueclivue3-unconfigured/package.json | 5 +- .../vueclivue3-unconfigured/yarn.lock | 8 +- system-tests/scripts/run.js | 11 + system-tests/test-binary/module_api_spec.ts | 2 +- .../test-binary/node_versions_spec.ts | 2 - system-tests/test/retries_spec.ts | 10 + .../cache/darwin/snapshot-meta.json | 164 ++-- tooling/v8-snapshot/test/.mocharc.js | 2 +- yarn.lock | 88 +-- 71 files changed, 838 insertions(+), 779 deletions(-) diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 34cc30912a69..9b6f1250fb50 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. -08-31-23 +09-3-23 diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 8de1a73572a1..3400182b7dfd 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 - 'publish-binary' - - 'jordanpowell88/update-angular-tsconfig-path' + - 'chore/update_electron25_and_node18' # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -40,7 +40,8 @@ macWorkflowFilters: &darwin-workflow-filters or: - equal: [ develop, << pipeline.git.branch >> ] # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - - equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] + - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] + - equal: [ 'chore/update_electron25_and_node18', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -52,6 +53,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] - equal: [ 'publish-binary', << pipeline.git.branch >> ] + - equal: [ 'chore/update_electron25_and_node18', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -70,7 +72,8 @@ windowsWorkflowFilters: &windows-workflow-filters or: - equal: [ develop, << pipeline.git.branch >> ] # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - - equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ] + - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] + - equal: [ 'chore/update_electron25_and_node18', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -79,7 +82,7 @@ executors: # the Docker image with Cypress dependencies and Chrome browser cy-doc: docker: - - image: cypress/browsers:node16.16.0-chrome106-ff99-edge + - image: cypress/browsers-internal:node18.15.0-chrome114-ff115 # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed. resource_class: medium environment: @@ -89,7 +92,7 @@ executors: # Docker image with non-root "node" user non-root-docker-user: docker: - - image: cypress/browsers:node16.16.0-chrome106-ff99-edge + - image: cypress/browsers-internal:node18.15.0-chrome114-ff115 user: node environment: PLATFORM: linux @@ -140,7 +143,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" != "publish-binary" && "$CIRCLE_BRANCH" != "jordanpowell88/update-angular-tsconfig-path" && "$CIRCLE_BRANCH" != "ryanm/feat/handle-304s" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "chore/update_electron25_and_node18" ]]; 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 @@ -821,13 +824,10 @@ commands: working_directory: /tmp/<> command: yarn types - run: + # NOTE: we do not need to wait for the vite dev server to start working_directory: /tmp/<> command: <> background: true - - run: - condition: <> - name: "Waiting on server to boot: <>" - command: "npx wait-on <>" - when: condition: <> steps: @@ -2242,7 +2242,7 @@ jobs: <<: *defaults resource_class: small docker: - - image: cypress/base:16.16.0 + - image: cypress/base-internal:18.15.0 steps: - restore_workspace_binaries - run: mkdir test-binary @@ -2257,15 +2257,15 @@ jobs: - run: name: Verify Cypress binary working_directory: test-binary - command: $(npm bin)/cypress verify + command: npx cypress verify - run: name: Print Cypress version working_directory: test-binary - command: $(npm bin)/cypress version + command: npx cypress version - run: name: Cypress info working_directory: test-binary - command: $(npm bin)/cypress info + command: npx cypress info test-types-cypress-and-jest: parameters: @@ -2369,6 +2369,7 @@ jobs: - test-binary-against-repo: repo: cypress-example-recipes command: npm run test:ci:firefox + browser: firefox test-binary-against-recipes-chrome: <<: *defaults @@ -2376,6 +2377,7 @@ jobs: - test-binary-against-repo: repo: cypress-example-recipes command: npm run test:ci:chrome + browser: chrome test-binary-against-recipes: <<: *defaults @@ -2383,6 +2385,7 @@ jobs: - test-binary-against-repo: repo: cypress-example-recipes command: npm run test:ci + browser: electron # This is a special job. It allows you to test the current # built test runner against a pull request in the repo @@ -2410,7 +2413,7 @@ jobs: steps: - test-binary-against-repo: repo: cypress-example-kitchensink - browser: "electron" + browser: electron test-binary-against-kitchensink-firefox: <<: *defaults diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml index 17f8f2feee6a..20a8945f0063 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. v16.16.0 + placeholder: ex. v18.15.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 485381b5dfe4..b827f20ea293 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. v16.16.0 + placeholder: ex. v18.15.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 35f657501629..bc373cdfdac2 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. v16.16.0 + placeholder: ex. v18.15.0 validations: required: true - type: dropdown diff --git a/.github/workflows/snyk_sca_scan.yaml b/.github/workflows/snyk_sca_scan.yaml index 0c7823a5a1fc..eb2c591908e0 100644 --- a/.github/workflows/snyk_sca_scan.yaml +++ b/.github/workflows/snyk_sca_scan.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [18.x] steps: - name: Checkout uses: actions/checkout@v3 @@ -26,7 +26,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 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 b5a983397f7f..bf33e1f65e98 100644 --- a/.github/workflows/snyk_static_analysis_scan.yaml +++ b/.github/workflows/snyk_static_analysis_scan.yaml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Run yarn run: yarn diff --git a/.github/workflows/update-browser-versions.yml b/.github/workflows/update-browser-versions.yml index be0e08ad3f5e..b85b8eb89c4e 100644 --- a/.github/workflows/update-browser-versions.yml +++ b/.github/workflows/update-browser-versions.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - name: Check for new Chrome versions id: get-versions uses: actions/github-script@v6 diff --git a/.github/workflows/update_v8_snapshot_cache.yml b/.github/workflows/update_v8_snapshot_cache.yml index 61f06d52a336..f2a9572a2a02 100644 --- a/.github/workflows/update_v8_snapshot_cache.yml +++ b/.github/workflows/update_v8_snapshot_cache.yml @@ -62,7 +62,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Run yarn run: yarn diff --git a/.node-version b/.node-version index 431076a9486e..55bffd620b9a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.16.0 +18.15.0 diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 4aa25bfd38c6..d4ad63cde915 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,14 @@ _Released 09/12/2023 (PENDING)_ - Adds support for Nx users who want to run Angular Component Testing in parallel. Addresses [#27723](https://github.com/cypress-io/cypress/pull/27723). +**Bugfixes:** + +- Fixed an issue where `enter`, `keyup`, and `space` events where not triggering `click` events properly in some versions of Firefox. Addressed in [#27715](https://github.com/cypress-io/cypress/pull/27715). + +**Dependency Updates:** + +- Upgraded Electron from `21.0.0` to `25.8.0`, which updates bundled Chromium from `106.0.5249.51` to `114.0.5735.289`. Addresses [#27595](https://github.com/cypress-io/cypress/issues/27595). Additionally, the Node version the binary has been upgraded from from `16.16.0` to `18.15.0`. This does **NOT** have an impact on the node version you are using with Cypress and is merely an internal update to the repository & shipped binary. Addressed in [#27715](https://github.com/cypress-io/cypress/pull/27715). Addresses [#27595](https://github.com/cypress-io/cypress/issues/27595). + ## 13.1.0 _Released 08/31/2023_ diff --git a/cli/package.json b/cli/package.json index 000947c3e15b..9fe77271a209 100644 --- a/cli/package.json +++ b/cli/package.json @@ -22,7 +22,7 @@ "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -95,7 +95,7 @@ "execa-wrap": "1.4.0", "hasha": "5.2.2", "mocha": "6.2.2", - "mock-fs": "5.1.1", + "mock-fs": "5.2.0", "mocked-env": "1.3.2", "nock": "13.2.9", "proxyquire": "2.1.3", diff --git a/npm/create-cypress-tests/package.json b/npm/create-cypress-tests/package.json index 28c51010ccaa..5d7a30a91a29 100644 --- a/npm/create-cypress-tests/package.json +++ b/npm/create-cypress-tests/package.json @@ -32,12 +32,12 @@ "@types/babel__core": "^7.1.2", "@types/inquirer": "7.3.1", "@types/mock-fs": "4.10.0", - "@types/node": "16.18.39", + "@types/node": "18.17.5", "@types/ora": "^3.2.0", "@types/semver": "7.5.0", "copy": "0.3.2", "mocha": "7.1.1", - "mock-fs": "5.1.1", + "mock-fs": "5.2.0", "snap-shot-it": "7.9.3", "typescript": "^4.7.4" }, diff --git a/npm/cypress-schematic/package.json b/npm/cypress-schematic/package.json index bc5e98c58956..fa6c8fc4f824 100644 --- a/npm/cypress-schematic/package.json +++ b/npm/cypress-schematic/package.json @@ -22,7 +22,7 @@ "@schematics/angular": "^14.2.1", "@types/chai-enzyme": "0.6.7", "@types/mocha": "8.0.3", - "@types/node": "^18.0.6", + "@types/node": "^18.17.5", "chai": "4.2.0", "mocha": "3.5.3", "typescript": "^4.7.4" diff --git a/npm/webpack-dev-server/package.json b/npm/webpack-dev-server/package.json index 5cb2fdb313b7..4153d03eab2b 100644 --- a/npm/webpack-dev-server/package.json +++ b/npm/webpack-dev-server/package.json @@ -30,7 +30,7 @@ "webpack-merge": "^5.4.0" }, "devDependencies": { - "@types/node": "16.18.39", + "@types/node": "18.17.5", "@types/proxyquire": "^1.3.28", "@types/speed-measure-webpack-plugin": "^1.3.4", "@types/webpack-dev-server-3": "npm:@types/webpack-dev-server@^3", diff --git a/package.json b/package.json index 63b7774d23ad..4e6d5b76c3b8 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@types/markdown-it": "12.2.3", "@types/mini-css-extract-plugin": "1.2.3", "@types/mocha": "8.0.3", - "@types/node": "16.18.39", + "@types/node": "18.17.5", "@types/prismjs": "1.16.0", "@types/react": "16.9.50", "@types/react-dom": "16.9.8", @@ -145,7 +145,7 @@ "dedent": "^0.7.0", "del": "3.0.0", "detect-port": "^1.3.0", - "electron": "21.0.0", + "electron": "25.8.0", "electron-builder": "^23.6.0", "enzyme-adapter-react-16": "1.12.1", "eslint": "7.22.0", @@ -185,7 +185,7 @@ "mocha-banner": "1.1.2", "mocha-junit-reporter": "2.2.0", "mocha-multi-reporters": "1.1.7", - "mock-fs": "5.1.1", + "mock-fs": "5.2.0", "p-defer": "^3.0.0", "patch-package": "6.4.7", "playwright-webkit": "1.24.2", @@ -212,7 +212,7 @@ "yarn-deduplicate": "3.1.0" }, "engines": { - "node": ">=16.16.0", + "node": ">=18.15.0", "yarn": ">=1.17.3" }, "productName": "Cypress", diff --git a/packages/data-context/src/actions/ElectronActions.ts b/packages/data-context/src/actions/ElectronActions.ts index fd27e726ccbf..2d99890aa829 100644 --- a/packages/data-context/src/actions/ElectronActions.ts +++ b/packages/data-context/src/actions/ElectronActions.ts @@ -120,7 +120,7 @@ export class ElectronActions { debug('notification created %o', notification) - function clickFn (event: Event) { + function clickFn (event: Electron.Event) { debug('notification clicked %o', event) onClick() notifications.delete(notification) diff --git a/packages/driver/cypress/e2e/e2e/origin/config_env.cy.ts b/packages/driver/cypress/e2e/e2e/origin/config_env.cy.ts index 58b06e242096..91d8221b9dbe 100644 --- a/packages/driver/cypress/e2e/e2e/origin/config_env.cy.ts +++ b/packages/driver/cypress/e2e/e2e/origin/config_env.cy.ts @@ -233,21 +233,10 @@ }) context('structuredClone()', () => { - it('(firefox) uses native structuredClone in firefox and does NOT serialize Error objects in config', { - browser: 'firefox', - }, function () { - Cypress[fnName](USED_KEYS.error, new Error('error')) - - cy.origin('http://www.foobar.com:3500', { args: { fnName, USED_KEYS } }, ({ fnName, USED_KEYS }) => { - const isUndefined = Cypress[fnName](USED_KEYS.error) - - expect(isUndefined).to.be.undefined - }) - }) - // NOTE: chrome 98 and above uses a native structuredClone() method, but that method CAN clone Error objects - it('(chromium) uses ponyfilled or native structuredClone that can serialize Error objects in config', { - browser: { family: 'chromium' }, + // NOTE: firefox 114 can now serialize/clone error objects + it('uses ponyfilled or native structuredClone that can serialize Error objects in config', { + browser: '!webkit', }, () => { Cypress[fnName](USED_KEYS.error, new Error('error')) diff --git a/packages/driver/cypress/e2e/e2e/origin/validation.cy.ts b/packages/driver/cypress/e2e/e2e/origin/validation.cy.ts index dd525e57f437..31b2879569b2 100644 --- a/packages/driver/cypress/e2e/e2e/origin/validation.cy.ts +++ b/packages/driver/cypress/e2e/e2e/origin/validation.cy.ts @@ -315,7 +315,7 @@ describe('cy.origin', { browser: '!webkit' }, () => { if (Cypress.browser.family === 'chromium') { expect(err.message).to.include('HTMLDivElement object could not be cloned') } else if (Cypress.browser.family === 'firefox') { - expect(err.message).to.include('The object could not be cloned') + expect(err.message).to.include('object could not be cloned') } done() diff --git a/packages/driver/cypress/e2e/util/serialization.cy.ts b/packages/driver/cypress/e2e/util/serialization.cy.ts index f5c964789590..7a7f643d8d33 100644 --- a/packages/driver/cypress/e2e/util/serialization.cy.ts +++ b/packages/driver/cypress/e2e/util/serialization.cy.ts @@ -437,9 +437,20 @@ describe('Log Serialization', () => { expect(snapshotBodyBefore.length).to.equal(1) - expect(snapshotBodyBefore[0]).to.be.instanceOf(HTMLBodyElement) + if (Cypress.browser.name === 'firefox') { + // serialized as an object in newer versions of firefox but matches the signature of HTMLBodyElement + expect(snapshotBodyBefore[0].constructor.name).to.equal('HTMLBodyElement') + } else { + expect(snapshotBodyBefore[0]).to.be.instanceOf(HTMLBodyElement) + } + // verify to some degree that the reified elements above can be matched into the snapshot - expect(snapshotBodyBefore[0].querySelector('form#button-inside-a')).to.be.instanceOf(HTMLFormElement) + if (Cypress.browser.name === 'firefox') { + // serialized as an object in newer versions of firefox but matches the signature of HTMLFormElement + expect(snapshotBodyBefore[0].querySelector('form#button-inside-a').constructor.name).to.equal('HTMLFormElement') + } else { + expect(snapshotBodyBefore[0].querySelector('form#button-inside-a')).to.be.instanceOf(HTMLFormElement) + } expect(snapshots[1]).to.have.property('name').that.equals('after') expect(snapshots[1]).to.have.property('htmlAttrs').that.deep.equals({}) @@ -449,10 +460,15 @@ describe('Log Serialization', () => { const snapshotBodyAfter = snapshots[1].body.get() expect(snapshotBodyAfter.length).to.equal(1) - - expect(snapshotBodyAfter[0]).to.be.instanceOf(HTMLBodyElement) - // verify to some degree that the reified elements above can be matched into the snapshot - expect(snapshotBodyAfter[0].querySelector('form#button-inside-a')).to.be.instanceOf(HTMLFormElement) + if (Cypress.browser.name === 'firefox') { + // serialized as an object in newer versions of firefox but matches the signature of HTMLBodyElement + expect(snapshotBodyAfter[0].constructor.name).to.equal('HTMLBodyElement') + expect(snapshotBodyAfter[0].querySelector('form#button-inside-a').constructor.name).to.equal('HTMLFormElement') + } else { + expect(snapshotBodyAfter[0]).to.be.instanceOf(HTMLBodyElement) + // verify to some degree that the reified elements above can be matched into the snapshot + expect(snapshotBodyAfter[0].querySelector('form#button-inside-a')).to.be.instanceOf(HTMLFormElement) + } }) // purpose of these 'DOM Elements' tests is to give a very basic understanding of how DOM element serialization works in the log serializer diff --git a/packages/driver/src/cy/commands/actions/type.ts b/packages/driver/src/cy/commands/actions/type.ts index bdecb07e6bca..9d3c150c1afb 100644 --- a/packages/driver/src/cy/commands/actions/type.ts +++ b/packages/driver/src/cy/commands/actions/type.ts @@ -186,7 +186,9 @@ export default function (Commands, Cypress, cy, state, config) { } const type = function () { + const isFirefoxBefore91 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 91 const isFirefoxBefore98 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 98 + const isFirefox106OrLater = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() >= 106 const simulateSubmitHandler = function () { const form = options.$el.parents('form') @@ -352,14 +354,16 @@ export default function (Commands, Cypress, cy, state, config) { if ( ( - // Before Firefox 98, - // Firefox sends a click event when the Space key is pressed. - // We don't want to send it twice. + // Before Firefox 91, it sends a click event automatically on the + // 'keyup' event for a Space key and we don't want to send it twice !Cypress.isBrowser('firefox') || - // After Firefox 98, - // it sends a click event automatically if the element is a