Awesome
nemo-accessibility
nemo-accessibility is a nemo plugin aimed to run accessibility scans during nemo tests. nemo-accessibility plugin uses axe-core, htmlcode smiffer and chrome engines to run accessibility scans on a given page or on a given element on a page.
How to Use
- Install this package
npm install nemo-accessibility --save-dev
- Add nemo-accessibility to your
config/nemo-plugins.json
file like below
"nemo-accessibility":{
"module":"nemo-accessibility",
"arguments": [
{
"engine":"axe"
"engine":"chrome"
"engine":"htmlcs"
}
]
}
- Call Scan method
let results= await nemo.accessibility.scan({'project': 'mynodewebproject', 'page': 'somepageName'})
Details
Once nemo-accessibility
plugin is registered, you should now have nemo.accessibility
namespace available in your tests. nemo.accessibility
exposes a method called scan
to help you run accessibility evaluation against your page/element.
scan
method returns a promise with resulting json` response and you can then write the HTML to a file or parse JSON response for later reporting. For example,
nemo.driver.get('http://www.paypal.com');
nemo.accessibility.scan().then(function (result) {
fs.writeFile('report/accessibility.json', result, function (err) {
done();
});
});
See usingNemoAccessibility.js. You can run that on Debug mode like
DEBUG=nemo* node node_modules/nemo-accessibility/example/usingNemoAccessibility.js
Support
Please file a Nemo a11y plugin issue for any nemo plugin related questions or file a issue for AATT for any AATT related questions
Copyright and License
Copyright 2019, PayPal under the BSD license.
Contributors
- Nilesh Kulkarni , developer for nemo accessibility plugin ||https://github.com/nikulkarni
- Prem Nawaz Khan, developer || https://github.com/mpnkhan || @mpnkhan