Now for axe-linter again, they support only a subset of tags, which I believe are WCAG 2.0 AA and AA and WCAG 2.1 AA and AA. So axe-linter does not currently support any AAA rules.
For AxeCore to run only a certain set of rules, we once again will use the axe.run, passing an options object and using the run only property once again. But this time, instead of passing a set of rules, we will pass it a set of tag names. In this case, the WCAG 2 AA and the WCAG 2 AA tags.
Now, a thing to note about these tag names is that the axe will only run rules that match a specific tag. So for example, let's say you wanted to run all WCAG 2 AA conformance, which normally would mean that you've also fulfill WCAG 2 AA conformance. But axe will not run WCAG 2 AA rules if you only pass the WCAG 2 AA tag. It has to be a one to one match. So if you wanted to run all rules to conform to WCAG 2 A, you must pass the WCAG 2 A and WCAG 2 AA.
Now for the test frameworks, you would again initialize axe builder and then use the chainable function with tags and with tags takes a single or an array of tags. And then what's called analyze, only those rules would run. For axe linter, you would use the tags property, which is a list of tags to run, and then you would list whichever tags you wanted to run.
Lastly, I wanted to talk about some of the various options that axe allows you to pass when you run it. A list of all available options can be found on the axe course API doc file. A note about run options, run options are only supported in axe and its integrations, and they are not really supported in axe linter, with two exceptions.
So a short list of run options, we've already talked about the run only and the rules properties. They have similar things in axe linter, the run only being the rules or the tags properties. But we also support a few other things, so for example we can support passing the result types property, and the result types lets you limit which results are shown. So either pass results, incomplete or violations. You can also pass the iframes option and that will tell axe to run or not run within iframes. By default, an axe integration will run in all iframes on the page. So for an example, let's say that we only wanted to have the violations result shown, so we would pass the result types object to axe.run. And then since it's an array, and we would pass the violation string. And what this will do is when axe.runs, you will get back a list of all the rules still, but for those rules that didn't match the particular types, they will only show one node. So for any passes in this example, only one node will show a pass for that rule. What that allows you to do is it's useful for improving performance on very large pages or very complicated pages where you're only interested in a certain type of result.
For the test frameworks, you would use the options chainable function to pass the list of options that way. And that is how you configure axe. Thank you for coming to this presentation.
Comments