From 0ba8b39fa100391288c197a9aae60f698cf41ce5 Mon Sep 17 00:00:00 2001 From: Nick Freear Date: Thu, 15 Feb 2018 11:38:36 +0000 Subject: [PATCH] Bug #36, add `pa11y-ci` accessibility testing to Travis [iet:10305316] --- .env.DIST | 7 +++++++ .travis.yml | 1 + CHANGELOG.md | 5 +++-- README.md | 4 ++++ package.json | 5 ++++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.env.DIST b/.env.DIST index 3af304c..c221735 100644 --- a/.env.DIST +++ b/.env.DIST @@ -3,4 +3,11 @@ # ## NF_COMPOSER_SUGGEST=ou-sams +# +# Used for "pa11y" accessibility testing. +# +# Travis-CI ~ set in: https://travis-ci.org/IET-OU/openEssayist-slim/settings +# +## export OES_SERVER_1=https://example-1.open.ac.uk + # End. diff --git a/.travis.yml b/.travis.yml index a3c4cc5..0d0fb0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ after_script: - composer validate - ls -alh - ls -alh public_html/assets/ + - npm run pa11y #- git status # End. diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1a97b..6e52ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,13 @@ ## [Version 3.0.1][v3.0.1-beta] - * _Date: ~ 14 February 2018_, + * _Date: ~ 16 February 2018_, * Add database column `users.visit_count`; record user's login (Bug #35), * Set `maxlength` to _30,000_ characters in [`app/config.php`][cfg], * Fix for user-roles in SAMS authentication, * Fix user-interface texts in templates ('_My assignments_', '_Feedback_'), - * Fix handling of database connection errors. + * Fix handling of database connection errors, + * Add automated accessibility testing — `pa11y-ci` (Bug #36). ## [Version 3.0.0][v3.0.0-beta] diff --git a/README.md b/README.md index 80b1026..a258d4b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build status — Travis-CI][travis-icon]][travis] [![js-semistandard-style][semi-icon]][semi] +[![Accessibility testing][pa11y-icon]][pa11y-ci] # openEssayist-slim @@ -86,6 +87,9 @@ app/cli.php --create-tables [semi]: https://github.com/Flet/semistandard [semi-icon]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square "Javascript coding style — 'semistandard'" +[pa11y-ci]: https://github.com/pa11y/pa11y-ci + "Automated accessibility testing - via 'pa11y-ci' (work-in-progress)" +[pa11y-icon]: https://img.shields.io/badge/accessibility-pa11y--ci-blue.svg [slim]: https://docs.slimframework.com/ "Slim PHP Framework v2" [db]: https://github.com/IET-OU/openEssayist-slim/blob/3.x/app/_data/openessayist-schema.sql#L24 "SQL database schema" diff --git a/package.json b/package.json index 1fd337e..6860502 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "description": "(See - 'composer.json') | © The Open University.", "version": "3.0.1-beta", "license": "UNLICENSED", - "repository": "https://github.com/IET-OU/openEssayist-slim", + "repository": "https://github.com/IET-OU/openEssayist-slim.git", "peerDependencies": { "twitter-bootstrap": "2.3.2", @@ -38,6 +38,7 @@ "log4javascript": "https://sourceforge.net/projects/log4javascript/#1.4.6" }, "devDependencies": { + "pa11y-ci": "^1.3.1", "semistandard": "^12.0.0", "uglify-js": "^3.3.9" }, @@ -51,6 +52,8 @@ "#- ug": "uglifyjs pub*/as*/openes*/*/*core.js pub*/as*/openes*/*/*init.js -b --comments /^!/ -o public_html/assets/app.js", "# ug": "uglifyjs public_html/assets/openessayist/js/openessayist.core.js", "hash-js": "cd public_html/assets; ln -fs app.js app.r$(git rev-parse --short HEAD).js", + "pa11y": "pa11y -s WCAG2AA -i notice ${OES_SERVER_1}/?_ua=pa11y-ci", + "pa11y-ci": "pa11y-ci --config .pa11yci.json", "test": "semistandard public_html/assets/openessayist/js/open*.js", "fix": "semistandard --fix" }