Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
feat: add flag that enables supplying a list of rules to be skipped d…
Browse files Browse the repository at this point in the history
…uring the analysis

* chore: upgrade axe/webdriverjs versions (#35)

* chore: upgrade axe/webdriverjs versions

axe-core 2.4.1
axe-webdriverjs 1.1.4

* feat: upgrade to axe-webdriverjs@1.1.5

* docs: Add changeling for 1.0.2

* chore: update changelog for 1.1.0

* chore: update changelog to match npm version

* fix: package.json & .snyk to reduce vulnerabilities (#39)

The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/npm:debug:20170905

Latest report for dequelabs/axe-cli:
https://snyk.io/test/github/dequelabs/axe-cli

* feat: add flag that enables supplying a list of rules to be skipped during the analysis

It works in the same way adding a rule/tag does.

* doc: add documentation for the new parameter available (--disable)

+ Also removed an extra "the" in the previous method docu
  • Loading branch information
JayKid authored and WilcoFiers committed Nov 17, 2017
1 parent 9169ffa commit d22903d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -16,6 +16,7 @@ program.version(version)
.option('-e, --exclude <list>', 'CSS selector of included elements, comma separated', utils.splitList)
.option('-r, --rules <list>', 'IDs of rules to run, comma separated', utils.splitList)
.option('-t, --tags <list>', 'Tags of rules to run, comma separated', utils.splitList)
.option('-l, --disable <list>', 'IDs of rules to disable, comma separated', utils.splitList)
.option('-b, --browser [browser-name]', 'Which browser to run (Webdriver required)')
.option('-s, --save [filename]', 'Save the output as a JSON file. Filename is optional')
.option('-d, --dir <path>', 'Output directory')
Expand Down
3 changes: 3 additions & 0 deletions lib/axe-test-urls.js
Expand Up @@ -67,6 +67,9 @@ function testPages(urls, config, events) {
} else if (config.rules) {
axe.withRules(config.rules)
}
if (config.disable) {
axe.disableRules(config.disable)
}
if (config.timer) {
console.time('axe-core execution time');
}
Expand Down
8 changes: 7 additions & 1 deletion readme.MD
Expand Up @@ -28,7 +28,7 @@ You can run multiple pages at once, simply add more URLs to the command. If you

## Running specific rules

You can use the `--rules` flag to set which rules you wish to run, or you can use the `--tags` to tell axe to run all rules that have that specific tag. For example:
You can use the `--rules` flag to set which rules you wish to run, or you can use `--tags` to tell axe to run all rules that have that specific tag. For example:

axe www.deque.com --rules color-contrast,html-has-lang

Expand All @@ -37,6 +37,12 @@ Or, to run all wcag2a rules:
axe www.deque.com --tags wcag2a


In case you want to disable some rules, you can use `--disable` followed by a list of rules. These will be skipped when analyzing the site:

axe www.deque.com --disable color-contrast

This option can be combined with either `--tags` or `--rules`.

A list of rules and what tags they have is available at: https://dequeuniversity.com/rules/worldspace/2.0/.

## Saving the results
Expand Down

0 comments on commit d22903d

Please sign in to comment.