-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug #8, add
.pa11yci.conf.js
dynamic configuration [iet:10308781][c…
…i skip]
- Loading branch information
Showing
5 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,6 @@ node_modules | |
|
||
phantomjs | ||
rasterize.js | ||
.pa11yci.json | ||
/*.png | ||
|
||
# End. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*! | ||
Pa11y-ci Configuration. | ||
Dynamically generate a '.pa11yci' JSON config object, using an environment variable. | ||
© Nick Freear, 07-March-2018. | ||
https://gist.github.com/nfreear/cece86bf6d5d4d531bf0646417a868fb | ||
https://github.com/pa11y/pa11y-ci | ||
USAGE: | ||
export TEST_SRV=https://example.edu/moodle | ||
pa11y-ci -c .pa11yci.js | ||
*/ | ||
|
||
// Was: const substitute = require('shellsubstitute'); | ||
|
||
var defaults = { | ||
screenCapture: './_pa11y-screen-capture.png', | ||
standard: 'WCAG2AA', | ||
ignore: [ 'notice' ], | ||
timeout: 5000, | ||
wait: 1500 | ||
}; | ||
|
||
var urls = [ | ||
'${TEST_SRV}/course/?_ua=pa11y', | ||
'${TEST_SRV}/auth/ouopenid/?_ua=pa11y', | ||
'${TEST_SRV}/survey-end/?_ua=pa11y#!-Missing-param-error' | ||
]; | ||
|
||
module.exports = (function my_pa11y_ci_config () { | ||
|
||
console.error('Env:', process.env.TEST_SRV, process.env.MDL_SRV); | ||
|
||
for (var idx = 0; idx < urls.length; idx++) { | ||
urls[ idx ] = urls[ idx ].replace('${TEST_SRV}', process.env.TEST_SRV); // substitute(urls[ idx ]); | ||
} | ||
|
||
return { | ||
defaults: defaults, | ||
urls: urls | ||
} | ||
})(); | ||
|
||
/* { | ||
"urls": [ | ||
"${MDL_SRV}/course/" | ||
] | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters