axe-core-npm icon indicating copy to clipboard operation
axe-core-npm copied to clipboard

Playwright: How to configure options for a check?

Open eeter opened this issue 2 years ago • 2 comments

Product: playwright

Expectation: I would like to configure options for color-contrast check in Axe analysis with Playwright.

Actual: Can't use configure() for AxeBuilder, and according to the documentation it isn't available in the API.

Motivation: With axe-core I have been able to configure color-contrast options with:

axe.configure({
  checks: [
    {
      id: 'color-contrast',
      options: { ... }
}]});

Is there a way to configure check options with Playwright?

axe-core version: 4.4.1 @axe-core/playwright: 4.4.0

eeter avatar Mar 10 '22 06:03 eeter

Advanced rule configuration is not something we're planning to support in our free packages. Such features are available in axe DevTools for Enterprise.

I am curious though what you're looking to use this for. Depending on what it is, there might be another solution, or perhaps something we can provide that doesn't involve exposing all of axe.configure open, because there be dragons.

WilcoFiers avatar May 09 '22 15:05 WilcoFiers

Hi, the need for using rule configuration would be to change boldValue of the color-contrast check (https://github.com/dequelabs/axe-core/blob/develop/lib/checks/color/color-contrast.json#L8). It's for a case where the specific font used on the page is such that it's seen as passing the accessibility criteria when boldValue is 600.

eeter avatar May 10 '22 13:05 eeter

Closing as this is an enterprise feature

michael-siek avatar Dec 08 '22 18:12 michael-siek

Nothing to QA here.

somaalapati avatar Dec 09 '22 06:12 somaalapati