Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from nfl/feature/allowConfig
Browse files Browse the repository at this point in the history
Allow users to pass in auditConfiguration objects
  • Loading branch information
sjelin committed Oct 28, 2016
2 parents 52158d7 + e599e0a commit c6ac939
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Expand Up @@ -39,7 +39,27 @@ Enable this plugin in your config file:
...
plugins: [{
chromeA11YDevTools: {
treatWarningsAsFailures: true
treatWarningsAsFailures: true,
auditConfiguration: {
auditRulesToRun: [
'audioWithoutControls',
'badAriaAttributeValue',
'badAriaRole',
'controlsWithoutLabel',
'elementsWithMeaningfulBackgroundImage',
'focusableElementNotVisibleAndNotAriaHidden',
'imagesWithoutAltText',
'linkWithUnclearPurpose',
'lowContrastElements',
'mainRoleOnInappropriateElement',
'nonExistentAriaLabelledbyElement',
'pageWithoutTitle',
'requiredAriaAttributeMissing',
'unfocusableElementsWithOnClick',
'videoWithoutCaptions'
],
auditRulesToSkip: []
}
},
package: 'protractor-accessibility-plugin'
}]
Expand Down
4 changes: 2 additions & 2 deletions index.js
@@ -1,7 +1,7 @@
var q = require('q'),
fs = require('fs'),
path = require('path'),
_ = require('lodash');
_ = require('lodash'),
request = require('request'),
Entities = require('html-entities').XmlEntities;

Expand Down Expand Up @@ -148,7 +148,7 @@ function runTenonIO(context) {
function runChromeDevTools(context) {

var data = fs.readFileSync(AUDIT_FILE, 'utf-8');
data = data + ' return axs.Audit.run();';
data = data + ' var configuration = new axs.AuditConfiguration(' + JSON.stringify(context.config.chromeA11YDevTools.auditConfiguration) + '); return axs.Audit.run(configuration);';

var elementPromises = [],
elementStringLength = 200;
Expand Down

0 comments on commit c6ac939

Please sign in to comment.