Skip to content

[Feature]: Expose aria-invalid in ARIA Snapshots #34839

Description

@foxable

🚀 Feature Request

In order to allow testing form validation with ARIA snapshots, snapshots of input fields should include the invalid state, namely aria-invalid="true".

Example

Example input field:

<input type="text" value="Invalid value" aria-label="Label" aria-invalid="true" />

Potential ARIA snapshot:

- textbox "Label" [invalid]: Invalid value

Motivation

ARIA Snapshots are a great addition to Playwright, allowing to write assertions which include larger portions of the page, while also providing basic validation for the accessibility of features.

Forms and input fields are an important part of web applications and critical regarding accessibility. Being able to test them using ARIA snapshots including validation would enable testing forms with dependent form validations. In such scenarios, snapshotting the whole form would allow to reliably test dependent validations with a lower risk that later regressions affecting some form fields are missed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions