pa11y自动化可访问性测试
pa11y 是自动化可访问性测试工具,在命令行运行 HTML CodeSniffer 来生成程序化可访问性报告。
pa11y nature.com
var pa11y = require('pa11y');
pa11y(options, function (error, test, exit) {
test('nature.com', function (error, results) {
/* ... */
});
}); pa11y 要求 Node.js 0.10+ 和 PhantomJS to run.
在 Mac 使用 Homebrew 安装:
$ brew install node
$ brew install phantomjs
命令行工具
Usage: pa11y [options] <url>
Options:
-h, --help output usage information
-V, --version output the version number
-s, --standard <name> the accessibility standard to use: Section508, WCAG2A, WCAG2AA (default), WCAG2AAA
-r, --reporter <reporter> the reporter to use: cli (default), csv, html, json
-l, --level <level> the level of message to fail on (exit with code 2): error, warning, notice
-i, --ignore <ignore> types and codes of messages to ignore separated by semi-colons
-c, --config <path> a JSON config file
-p, --port <port> the port to run PhantomJS on
-t, --timeout <ms> the timeout in milliseconds
-d, --debug output debug messages
评论
