Closed soykje closed 5 months ago
Thanks for the issue (and moving it for us :)). Out of curiosity, would the include
option make more sense for your use case? You could do .include('.docs-story')
and it should only evaluate that subtree.
@straker Thx for you quick answer! Well... If I'm not wrong, just including doesn't means that the rest of the DOM would be omitted, right?
In my case I have this kind of page: https://sparkui.vercel.app/?path=/docs/components-snackbar--docs which I want to parse, but for obvious reasons only the examples blocks (`.docs-story
).
I tried this:
.exclude('*')
.include('.docs-story')
But this didn't seem to work either. My final attempt (.include('*:not(.docs-story)')
) apparently does the job. On my understanding this declaration means that we will only parse DOM nodes that matches *:not(.docs-story)
selector, but if so I don't understand why I still get errors related to html tag, for example... But maybe it's me (not native english reader) that misunderstand something? :slightly_smiling_face:
Just including actually means to test just that part of the DOM you are including. include
and exclude
are passed directly to axe-core as the context
option. You can read more about the context
option in axe-core's context documentation.
@straker Wow! Thx a lot for sharing this resource, I didn't knew it was there! Things are a lot clearer to me right now, thx again! :pray:
User Question
Product
webdriverjs
Question
Hi there :wave:
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: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 apage-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! :+1:
Thx in advance! :pray: