Skip to content

Tab key events can be dispatched to the AUT #31050

@cacieprins

Description

@cacieprins

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

Metadata

Metadata

Assignees

Labels

type: featureNew feature that does not currently exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions