diff --git a/index.js b/index.js index 691caf7..636a3d8 100755 --- a/index.js +++ b/index.js @@ -16,6 +16,7 @@ program.version(version) .option('-e, --exclude ', 'CSS selector of included elements, comma separated', utils.splitList) .option('-r, --rules ', 'IDs of rules to run, comma separated', utils.splitList) .option('-t, --tags ', 'Tags of rules to run, comma separated', utils.splitList) +.option('-l, --disable ', '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 ', 'Output directory') diff --git a/lib/axe-test-urls.js b/lib/axe-test-urls.js index b0501cf..ae92f5e 100644 --- a/lib/axe-test-urls.js +++ b/lib/axe-test-urls.js @@ -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'); } diff --git a/readme.MD b/readme.MD index c6d8120..fa6de6d 100644 --- a/readme.MD +++ b/readme.MD @@ -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 @@ -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