dequelabs / axe-core-npm

Mozilla Public License 2.0
592 stars 67 forks source link

[playwright] allow passing selector to rules config #975

Closed stefanprobst closed 7 months ago

stefanprobst commented 8 months ago

Product

playwright

Feature Description

i am using react-aria-components, which in their documentation suggest adding the following axe rules config to avoid false positives (see here):

{
  rules: [
    {
      id: 'aria-hidden-focus',
      selector: 'body *:not([data-a11y-ignore="aria-hidden-focus"])'
    }
  ]
}

this can for example be passed directly to the storybook a11y plugin, which under the hood passes it on to axe.configure() (see here).

it would be cool if i could pass the same config directly to AxeBuilder#options from @axe-core/playwright as well. afaict this is currently not possible, because it only allows enabling/disabling individual rules, but not passing any additional rule config.

thanks!

straker commented 7 months ago

Thanks for the issue. This is not a feature we are planning on adding any time soon, but you can somewhat workaround the issue by passing a selector to exclude to completely ignore the element from accessibility checks.

padmavemulapati commented 6 months ago

@michael-siek can you please provide me QA-notes here

padmavemulapati commented 6 months ago

Closing it as QA-none