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 56466e6767e0..d1ae408689c4 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -32,7 +32,7 @@ mainBuildFilters: &mainBuildFilters - 'update-v8-snapshot-cache-on-develop' - 'feature/test-burn-in' - 'publish-binary' - - 'cacie/chore/capture-metadata' + - '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 @@ -52,7 +52,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - equal: [ 'feature/test-burn-in', << pipeline.git.branch >> ] - equal: [ 'publish-binary', << pipeline.git.branch >> ] - - equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ] + - equal: [ 'chore/update_electron25_and_node18', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -81,7 +81,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: @@ -91,7 +91,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 @@ -823,13 +823,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: @@ -2244,7 +2241,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 @@ -2259,15 +2256,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: @@ -2371,6 +2368,7 @@ jobs: - test-binary-against-repo: repo: cypress-example-recipes command: npm run test:ci:firefox + browser: firefox test-binary-against-recipes-chrome: <<: *defaults @@ -2378,6 +2376,7 @@ jobs: - test-binary-against-repo: repo: cypress-example-recipes command: npm run test:ci:chrome + browser: chrome test-binary-against-recipes: <<: *defaults @@ -2385,6 +2384,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 @@ -2412,7 +2412,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 443bdaf15ebd..adc9091d938a 100644 --- a/.github/workflows/update_v8_snapshot_cache.yml +++ b/.github/workflows/update_v8_snapshot_cache.yml @@ -63,7 +63,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/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. diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 1d7bb07ec36c..d4ad63cde915 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,4 +1,20 @@ +## 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). + +**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/CHANGELOG.md b/npm/create-cypress-tests/CHANGELOG.md index 3b2f80df83dd..86aab50ae430 100644 --- a/npm/create-cypress-tests/CHANGELOG.md +++ b/npm/create-cypress-tests/CHANGELOG.md @@ -1,3 +1,5 @@ +# [create-cypress-tests-v2.0.3](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v2.0.2...create-cypress-tests-v2.0.3) (2023-09-07) + # [create-cypress-tests-v2.0.2](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v2.0.1...create-cypress-tests-v2.0.2) (2023-04-07) # [create-cypress-tests-v2.0.1](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v2.0.0...create-cypress-tests-v2.0.1) (2023-01-03) 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/CHANGELOG.md b/npm/cypress-schematic/CHANGELOG.md index 21f00b1230b2..d2fb989a6401 100644 --- a/npm/cypress-schematic/CHANGELOG.md +++ b/npm/cypress-schematic/CHANGELOG.md @@ -1,3 +1,5 @@ +# [@cypress/schematic-v2.5.1](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v2.5.0...@cypress/schematic-v2.5.1) (2023-09-07) + # [@cypress/schematic-v2.5.0](https://github.com/cypress-io/cypress/compare/@cypress/schematic-v2.4.0...@cypress/schematic-v2.5.0) (2023-01-25) 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/CHANGELOG.md b/npm/webpack-dev-server/CHANGELOG.md index 7ed74a7fcde6..66217c1173b7 100644 --- a/npm/webpack-dev-server/CHANGELOG.md +++ b/npm/webpack-dev-server/CHANGELOG.md @@ -1,3 +1,12 @@ +# [@cypress/webpack-dev-server-v3.6.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v3.6.0...@cypress/webpack-dev-server-v3.6.1) (2023-09-07) + +# [@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) 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/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')) 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