Skip to content

Commit

Permalink
fix: correctly simulate click events for buttons on keyup and space t…
Browse files Browse the repository at this point in the history
…ype in Firefox versions greater than 91 and simulate click for buttons on enter in Firefox versions greater than or equal to 106
  • Loading branch information
AtofStryker committed Sep 7, 2023
1 parent c8ba331 commit 100c434
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ _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).
Expand Down
3 changes: 2 additions & 1 deletion packages/driver/src/cy/commands/actions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ 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

Expand Down Expand Up @@ -362,7 +363,7 @@ export default function (Commands, Cypress, cy, state, config) {
// but it does not if the element is an <input>.
// event.target is null when used with shadow DOM.
(!isFirefoxBefore98 && event.target && $elements.isInput(event.target)) ||
(isFirefox106OrLater && $elements.isButton(event.target))
(!isFirefoxBefore91 && event.target && $elements.isButton(event.target))
) &&
// Click event is sent after keyup event with space key.
event.type === 'keyup' && event.code === 'Space' &&
Expand Down

5 comments on commit 100c434

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 100c434 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/linux-x64/chore/update_electron25_and_node18-100c434d027bc8e15f0b9a20113b1371fb591d9d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 100c434 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/linux-arm64/chore/update_electron25_and_node18-100c434d027bc8e15f0b9a20113b1371fb591d9d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 100c434 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/darwin-arm64/chore/update_electron25_and_node18-100c434d027bc8e15f0b9a20113b1371fb591d9d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 100c434 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/darwin-x64/chore/update_electron25_and_node18-100c434d027bc8e15f0b9a20113b1371fb591d9d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 100c434 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/win32-x64/chore/update_electron25_and_node18-100c434d027bc8e15f0b9a20113b1371fb591d9d/cypress.tgz

Please sign in to comment.