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

[Feature]: expect(locator).toHaveAccessibleErrorMessage(…) #31249

Open
MattyBalaam opened this issue Jun 11, 2024 · 0 comments · May be fixed by #33904
Open

[Feature]: expect(locator).toHaveAccessibleErrorMessage(…) #31249

MattyBalaam opened this issue Jun 11, 2024 · 0 comments · May be fixed by #33904

Comments

@MattyBalaam
Copy link

🚀 Feature Request

A previous PR added some jest-dom inspired assertions like toHaveAccessibleDescription #18332.

A very good additional would be to also match toHaveAccessibleErrorMessage https://github.com/testing-library/jest-dom#tohaveaccessibleerrormessage

This allows you to assert that an element has the expected accessible error message.

Example

await component.getByLabel('An input').fill('incorrect value');

await expect(component.getByLabel('An input'). toHaveAccessibleErrorMessage('You have entered invalid text');

Motivation

At the moment to accomplish the same thing multiple assertions need to be made to test this common a11y patterns.

Playwright should aim to provide a first-class experience for testing a11y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants