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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure to understand how .exclude() works... 馃 #4423

Closed
soykje opened this issue Apr 23, 2024 · 1 comment
Closed

Not sure to understand how .exclude() works... 馃 #4423

soykje opened this issue Apr 23, 2024 · 1 comment
Labels
question ungroomed Ticket needs a maintainer to prioritize and label

Comments

@soykje
Copy link

soykje commented Apr 23, 2024

Product

axe-core

Question

Hi there 馃憢

I'm currently working on a a11y script based on webdriverjs. But I'm having troubles using the .exclude() method. As I understood, it can take an array of CSS selectors, right?
In my actual setup I have something like:

const results = await new AxeBuilder(driver)
        .options({
          resultTypes: ['violations', 'incomplete'],
          rules: {
            // 'meta-viewport': { enabled: false },
            'page-has-heading-one': { enabled: false },
            'landmark-one-main': { enabled: false },
            region: { enabled: false },
            'color-contrast': { enabled: false },
          },
          runOnly: ['best-practice', 'wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'],
          reporter: 'v2',
        })
        .exclude('*:not(.docs-story)')
        .analyze()

In my current setup (I'm working on a Design System documented with Storybook), I want to only check .docs-story DOM nodes. Afaik the selector should work, but for some reason I end with a page-has-heading-one error, which should not pop as not related to the defined excluding perimeter, right?

I'll be very gratefull to get some more detailed infos about how this works, to be sure I'm building my script correctly! 馃憤

Thx in advance! 馃檹

@soykje soykje added question ungroomed Ticket needs a maintainer to prioritize and label labels Apr 23, 2024
@soykje
Copy link
Author

soykje commented Apr 23, 2024

I guess I was not writing the issue in the right place... So I moved it there and close this one. Sorry guys 馃槄

@soykje soykje closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

1 participant