Hierarchy

  • ByRoleOptions

Properties

busy?: boolean

If true only includes elements in the query set that are marked as busy in the accessibility tree, i.e., aria-busy="true"

checked?: boolean

If true only includes elements in the query set that are marked as checked in the accessibility tree, i.e., aria-checked="true"

current?: string | boolean

Filters elements by their aria-current state. true and false match aria-current="true" and aria-current="false" (as well as a missing aria-current attribute) respectively.

description?: string | RegExp | ((accessibleDescription, element) => boolean)

Only considers elements with the specified accessible description.

Type declaration

    • (accessibleDescription, element): boolean
    • Parameters

      • accessibleDescription: string
      • element: Element

      Returns boolean

expanded?: boolean

If true only includes elements in the query set that are marked as expanded in the accessibility tree, i.e., aria-expanded="true"

hidden?: boolean

If true includes elements in the query set that are usually excluded from the accessibility tree. role="none" or role="presentation" are included in either case.

level?: number

Includes elements with the "heading" role matching the indicated level, either by the semantic HTML heading elements <h1>-<h6> or matching the aria-level attribute.

name?: string | RegExp | ((accessibleName, element) => boolean)

Only considers elements with the specified accessible name.

Type declaration

    • (accessibleName, element): boolean
    • Parameters

      • accessibleName: string
      • element: Element

      Returns boolean

pressed?: boolean

If true only includes elements in the query set that are marked as pressed in the accessibility tree, i.e., aria-pressed="true"

queryFallbacks?: boolean

Includes every role used in the role attribute For example *ByRole('progressbar', {queryFallbacks: true}) will find <div role="meter progressbar">.

selected?: boolean

If true only includes elements in the query set that are marked as selected in the accessibility tree, i.e., aria-selected="true"

suggest?: boolean

suppress suggestions for a specific query

value?: {
    max?: number;
    min?: number;
    now?: number;
    text?: Matcher;
}

Type declaration

  • Optional max?: number
  • Optional min?: number
  • Optional now?: number
  • Optional text?: Matcher

Generated using TypeDoc