Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab key events can be dispatched to the AUT #31050

Open
3 tasks
cacieprins opened this issue Feb 7, 2025 · 0 comments
Open
3 tasks

Tab key events can be dispatched to the AUT #31050

cacieprins opened this issue Feb 7, 2025 · 0 comments
Labels
type: feature New feature that does not currently exist

Comments

@cacieprins
Copy link
Contributor

cacieprins commented Feb 7, 2025

What would you like?

In order to more accurately test keyboard-only accessibility pathways, users would like to dispatch a native "tab" keypress to the AUT.

Acceptance Criteria

  • By invoking the cy.press command, users can dispatch a native "Tab" keydown followed immediately by a "Tab" keyup.
  • This command works in Chrome, Firefox, and Edge.

Implementation Notes

Proposed command signature

type PressCommand<T: keyof Cypress.Keyboard.Keys> = {
  (
    key: Cypress.Keyboard.Keys[T],
    options?: Cypress.Keyboard.KeyPressModifiers &
      Partial<Cypress.Loggable & Cypress.Timeoutable>
  ): void;
}

declare namespace Cypress {
  interface Cypress {
    Keyboard: {
      Keys: {
        TAB: 'tab'
      }
    }
  }
}

Automation

Chrome can dispatch this via CDP; Firefox can dispatch this via BiDi. Firefox BiDi is a prerequisite.

  • CDP Automation
  • BiDi Automation
  • Command implementation in @packages/driver
@cacieprins cacieprins changed the title Users can dispatch tab key events to the AUT Tab key events can be dispatched to the AUT Feb 7, 2025
@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants