Skip to content

Commit

Permalink
Bug AOEpeople#4, add accessibility testing "grunt-rsids-pa11y" WCAG 2…
Browse files Browse the repository at this point in the history
….0 AAA

* Automated accessibility testing via ~ http://pa11y.org/
  • Loading branch information
nfreear committed Jun 3, 2018
1 parent 4fb90c7 commit f02c0d2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
21 changes: 18 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ module.exports = function (grunt) {
}
}
},
rsids_pa11y: { // Accessibility testing, via ~ http://pa11y.org/
test: {
options: { // Task-specific options go here.
// screenCapture: './_pa11y-screen-capture.png',
standard: 'WCAG2AAA',
timeout: 5000,
wait: 500,
rootElement: '#cookieNotice',
verifyPage: 'id="cookieNotice"'
},
url: [ 'http://localhost:8000/tests/data.html' ]
//, file: [ 'array of files, globbing permitted' ]
}
},
strip_code: {

src: {
Expand All @@ -45,9 +59,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-strip-code');
grunt.loadNpmTasks('grunt-rsids-pa11y');

// Default task(s).
grunt.registerTask('default', ['connect', 'qunit', 'strip_code', 'uglify']);
grunt.registerTask('test', ['connect', 'qunit']);
grunt.registerTask('default', [ 'test', 'strip_code', 'uglify' ]);
grunt.registerTask('test', [ 'connect', 'qunit', 'rsids_pa11y' ]);

};
};
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
],
"author": "Alessandro Benoit, Bernhard Behrendt",
"contributors": [
{ "name": "Bernhard Behrendt" },
{ "name": "Nick Freear" }
{
"name": "Bernhard Behrendt"
},
{
"name": "Nick Freear"
}
],
"license": "MIT",
"devDependencies": {
Expand All @@ -26,13 +30,14 @@
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-qunit": "^2.0.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt-rsids-pa11y": "^0.3.4",
"grunt-strip-code": "^1.0.6",
"jquery": "^3.3.1",
"phantomjs-prebuilt": "^2.1.16",
"qunit": "^2.6.1"
},
"engines" : {
"node" : ">=6.0"
"engines": {
"node": ">=6.0"
},
"files": [
"dist/",
Expand Down
19 changes: 19 additions & 0 deletions tests/data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> data-cookie-notice </title>
</head>
<body>

<h1> data-cookie-notice </h1>


<script data-cookie-notice=
'{ "learnMoreLinkEnabled": true, "learnMoreLinkHref": "/privacy.html", "X-cookieNoticePosition": "top", "debug": true }'
data-CDN-src="https://unpkg.com/cookie-notice@^1/dist/cookie.notice.min.js"
src="../src/cookie.notice.js"
></script>

</body>
</html>

0 comments on commit f02c0d2

Please sign in to comment.