Widen / expect-axe-playwright

Expect matchers to perform Axe accessibility tests in your Playwright tests.
ISC License
21 stars 5 forks source link

Log details of violation(s) #3

Closed ewolfe closed 2 years ago

ewolfe commented 2 years ago

How do I get insight into the violation that was thrown? There's not much in the log:

Error: expect(received).toBeAccessible(expected)

Expected: No violations
Received: 1 violations

Violations: list(1)

  68 |   const header = await page.$('header');
> 69 |   await expect(header).toBeAccessible();
     |                        ^
mskelton commented 2 years ago

@ewolfe Given that Playwright Test is the recommended approach for testing over Jest Playwright, our plan is to release a major version of this library that only supports Playwright Test which would allow us to attach a report file of violations that would be printed with the error.

For now, I'd recommend manually testing the page with the Axe browser extension. That's unfortunately all I can tell you right now, but hopefully we can get that new version released soon enough. I'm going to be making a v2 milestone for this library which I'll add this issue to.