Data source: National Center for Health Statistics, Summary Health Statistics: National Health Interview Survey, 2015 , https://www.cdc.gov/nchs/fastats/disability.htm.
Accessibility (a11y) is a measure of a computer system's accessibility is to all people, including those with disabilities or impairments. It concerns both software and hardware and how they are configured in order to enable a disabled or impaired person to use that computer system successfully.
Just pretend Det. Lincoln Rhyme needs to be able to navigate your website to solve a homicide
Section 508 is the amendment to the United States Workforce Rehabilitation Act of 1973, a federal law mandating that all electronic and information technology developed, procured, maintained, or used by the federal government be accessible to people with disabilities.
Pa11y is your automated accessibility testing pal. It runs HTML CodeSniffer from the command line for programmatic accessibility reporting.
pa11y http://www.codemash.org/
pa11y --reporter html http://www.codemash.org/ > codemash-report.html
pa11y --ignore "warning;notice" --reporter html http://www.codemash.org/ > codemash-report.html
pa11y --standard Section508 http://www.codemash.org/
but not super useful in a typical workflow
CI runs accessibility tests against multiple URLs and reports on any issues. This is best used during automated testing of your application and can act as a gatekeeper to stop a11y issues from making it to live.
.pa11yci
{
"defaults": {
"standard": "WCAG2AAA"
},
"urls": [
"http://localhost:4200/",
"http://localhost:4200/about/kitties",
{
"url": "http://localhost:4200/ethereum101",
"actions": [
"click element #myButton",
"wait for element modal-container to be hidden"
]
}
]
}
pa11y-ci --threshold 10
How many errors before "failure" is determined
var pa11y = require('pa11y');
var test = pa11y({
//config options
});
test.run('http://localhost:4200/', function(error, result) {
if (error) {
return console.error(error.message);
}
console.log(result);
});
[{
code: 'WCAG2AA.Principle1.Guideline1_1.1_1_1.H30.2',
context: '',
message: 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.',
selector: 'html > body > p:nth-child(1) > a',
type: 'error',
typeCode: 1
}]
pa11y({
actions: [
'click element #tab-1',
'wait for element #tab-1-content to be visible',
'set field #fullname to John Doe',
'check field #terms-and-conditions',
'uncheck field #subscribe-to-marketing',
'wait for #modal to be visible',
'wait for fragment to be #page-2',
'wait for path to not be /login'
]
});
pa11y({
beforeScript: function(page, options, next) {
// Make changes to the page
// When finished call next to continue running Pa11y tests
next();
}
});
https://github.com/baudehlo/node-phantom-simple#node-phantom-simple
pa11y({
hideElements: '.advert, #modal, div[aria-role=presentation]'
});
pa11y({
ignore: [
'notice',
'WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2'
]
});
pa11y({
log: {
debug: console.log.bind(console),
error: console.error.bind(console),
info: console.info.bind(console)
}
});
pa11y({
page: {
headers: {
Cookie: 'foo=bar'
},
settings: {
loadImages: false,
userName: 'nature',
password: 'say the magic word'
},
viewport: {
width: 1024,
height: 768
}
}
});
pa11y({
rules: [
'Principle1.Guideline1_3.1_3_1_AAA'
],
standard: 'WCAG2AAA'
});
pa11y({
screenCapture: __dirname + '/my-screen-capture.png'
});
pa11y({
timeout: 500,
wait: 500
});
pa11y({
verifyPage: 'All About Cryptokitties '
});
https://github.com/tehfedaykin/AllAboutCryptoKitties
My Angular app isn't throwing any errors?
Your code is perfect! JK. It's probably not loading in phantomjs. Take a look at your polyfills:
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/string';
import 'core-js/es6/array';
My layout looks broken in screencaptures?
Are you using flexbox? PhantomJS doesn't support flex = (
My single page app pages aren't loading in the pa11y 5.0 beta!
Puppeteer broke window.pushState support in the current release. You can use actions to click nav items as a temporary workaround.