Skip to content

Commit

Permalink
Add accessibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Roni Laukkarinen committed Jan 29, 2018
1 parent 8a150cf commit 05c1aed
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .accessibilityrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
options: {
browser: true
}
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package air
*/

define( 'AIR_VERSION', '3.4.3' );
define( 'AIR_VERSION', '3.4.4' );

/**
* Requires.
Expand Down
50 changes: 44 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var util = require('gulp-util');
var header = require('gulp-header');
var pixrem = require('gulp-pixrem');
var exec = require('child_process').exec;
var access = require('gulp-accessibility');

/*
Expand All @@ -27,6 +28,7 @@ FILE PATHS

var sassSrc = 'sass/**/*.{sass,scss}';
var sassFile = 'sass/base/global.scss';
var phpSrc = '**/*.php';
var cssDest = 'css';
var customjs = 'js/scripts.js';
var jsSrc = 'js/src/**/*.js';
Expand Down Expand Up @@ -64,19 +66,47 @@ Notes:
gulp.task('browsersync', function() {

var files = [
'**/*.php',
phpSrc,
jsSrc
];
];

browserSync.init(files, {
proxy: "airdev.test",
browser: "Google Chrome",
open: "external",
notify: true
});
});

/*
ACCESSIBILITY
=============
*/

gulp.task('a11y', function() {

// Use https://github.com/digitoimistodude/gulp-sitemap-generator
// Go to http://airdev.test/?show_sitemap to get list and paste here
//var files = ["http:\/\/airdev.test\/2013\/01\/07\/sticky\/","http:\/\/airdev.test\/2012\/01\/07\/template-sticky\/","http:\/\/airdev.test\/test-english-front-page\/","http:\/\/airdev.test\/2016\/08\/12\/uusi-podcast\/","http:\/\/airdev.test\/about\/page-with-a-title-so-long-you-havent-seen-a-title-this-long-before\/","http:\/\/airdev.test\/kauppa\/","http:\/\/airdev.test\/ostoskori\/","http:\/\/airdev.test\/kassa\/","http:\/\/airdev.test\/oma-tili\/","http:\/\/airdev.test\/2015\/12\/06\/moikka-maailma\/","http:\/\/airdev.test\/about-2\/","http:\/\/airdev.test\/about\/page-markup-and-formatting\/","http:\/\/airdev.test\/about\/page-image-alignment\/","http:\/\/airdev.test\/2013\/03\/15\/twitter-embeds\/","http:\/\/airdev.test\/2013\/03\/15\/featured-image-vertical\/","http:\/\/airdev.test\/2013\/03\/15\/featured-image-horizontal\/","http:\/\/airdev.test\/2013\/03\/15\/nested-and-mixed-lists\/","http:\/\/airdev.test\/2013\/03\/15\/more-tag\/","http:\/\/airdev.test\/2013\/03\/15\/excerpt\/","http:\/\/airdev.test\/2013\/01\/11\/markup-and-formatting\/","http:\/\/airdev.test\/2013\/01\/11\/markup-html-tags-and-formatting\/","http:\/\/airdev.test\/2013\/01\/10\/image-alignment\/","http:\/\/airdev.test\/2013\/01\/10\/markup-image-alignment\/","http:\/\/airdev.test\/2013\/01\/09\/text-alignment\/","http:\/\/airdev.test\/2013\/01\/09\/markup-text-alignment\/","http:\/\/airdev.test\/2013\/01\/08\/paginated\/","http:\/\/airdev.test\/2013\/01\/06\/no-content\/","http:\/\/airdev.test\/2013\/01\/05\/non-breaking-text\/","http:\/\/airdev.test\/2013\/01\/05\/title-with-special-characters-2\/","http:\/\/airdev.test\/2013\/01\/05\/title-with-special-characters\/","http:\/\/airdev.test\/2013\/01\/05\/title-with-markup\/","http:\/\/airdev.test\/2013\/01\/05\/markup-title-with-markup\/","http:\/\/airdev.test\/2013\/01\/05\/no-title\/","http:\/\/airdev.test\/2013\/01\/04\/password-protected\/","http:\/\/airdev.test\/2013\/01\/03\/comments\/","http:\/\/airdev.test\/2013\/01\/02\/comments-disabled\/","http:\/\/airdev.test\/2013\/01\/01\/pingbacks-an-trackbacks\/","http:\/\/airdev.test\/2012\/12\/11\/post-format-standard-2\/","http:\/\/airdev.test\/2012\/12\/10\/post-format-gallery-2\/","http:\/\/airdev.test\/2012\/12\/09\/post-format-aside-2\/","http:\/\/airdev.test\/2012\/12\/08\/post-format-chat-2\/","http:\/\/airdev.test\/2012\/12\/07\/post-format-link-2\/","http:\/\/airdev.test\/2012\/12\/06\/post-format-image-caption-2\/","http:\/\/airdev.test\/2012\/12\/05\/post-format-image-2\/","http:\/\/airdev.test\/2012\/12\/04\/post-format-quote-2\/","http:\/\/airdev.test\/2012\/12\/03\/post-format-status-2\/","http:\/\/airdev.test\/2012\/12\/02\/post-format-video-videopress-2\/","http:\/\/airdev.test\/2012\/12\/02\/post-format-video\/","http:\/\/airdev.test\/2012\/12\/01\/post-format-audio-2\/","http:\/\/airdev.test\/2012\/11\/02\/many-categories\/","http:\/\/airdev.test\/2012\/11\/01\/many-tags\/","http:\/\/airdev.test\/2012\/03\/15\/template-featured-image-vertical\/","http:\/\/airdev.test\/2012\/03\/15\/template-featured-image-horizontal\/","http:\/\/airdev.test\/2012\/03\/15\/template-more-tag\/","http:\/\/airdev.test\/2012\/03\/15\/template-excerpt-defined\/","http:\/\/airdev.test\/2012\/03\/14\/template-excerpt-generated\/","http:\/\/airdev.test\/2012\/01\/08\/template-paginated\/","http:\/\/airdev.test\/2012\/01\/04\/template-password-protected\/","http:\/\/airdev.test\/2012\/01\/03\/template-comments\/","http:\/\/airdev.test\/2012\/01\/02\/template-comments-disabled\/","http:\/\/airdev.test\/2012\/01\/01\/template-pingbacks-an-trackbacks\/","http:\/\/airdev.test\/level-1\/level-2\/level-3b\/","http:\/\/airdev.test\/level-1\/level-2\/level-3a\/","http:\/\/airdev.test\/level-1\/level-2b\/","http:\/\/airdev.test\/level-1\/level-2a\/","http:\/\/airdev.test\/page-b\/","http:\/\/airdev.test\/page-a\/","http:\/\/airdev.test\/blog\/","http:\/\/airdev.test\/","http:\/\/airdev.test\/2011\/03\/15\/media-twitter-embeds\/","http:\/\/airdev.test\/2010\/10\/05\/post-format-standard\/","http:\/\/airdev.test\/2010\/09\/10\/post-format-gallery\/","http:\/\/airdev.test\/2010\/09\/09\/post-format-gallery-tiled\/","http:\/\/airdev.test\/2010\/08\/08\/post-format-image\/","http:\/\/airdev.test\/2010\/08\/07\/post-format-image-caption\/","http:\/\/airdev.test\/2010\/08\/06\/post-format-image-linked\/","http:\/\/airdev.test\/about\/clearing-floats\/","http:\/\/airdev.test\/about\/","http:\/\/airdev.test\/2010\/07\/02\/post-format-audio\/","http:\/\/airdev.test\/2010\/06\/03\/post-format-video-wordpresstv\/","http:\/\/airdev.test\/2010\/06\/02\/post-format-video-videopress\/","http:\/\/airdev.test\/2010\/06\/02\/post-format-video-youtube\/","http:\/\/airdev.test\/2010\/05\/09\/post-format-aside\/","http:\/\/airdev.test\/2010\/04\/04\/post-format-status\/","http:\/\/airdev.test\/2010\/03\/07\/post-format-link\/","http:\/\/airdev.test\/2010\/02\/05\/post-format-quote\/","http:\/\/airdev.test\/2010\/01\/08\/post-format-chat\/","http:\/\/airdev.test\/2009\/10\/05\/title-should-not-overflow-the-content-area\/","http:\/\/airdev.test\/2009\/09\/05\/edge-case-no-title\/","http:\/\/airdev.test\/2009\/08\/06\/edge-case-no-content\/","http:\/\/airdev.test\/2009\/07\/02\/edge-case-many-categories\/","http:\/\/airdev.test\/2009\/06\/01\/edge-case-many-tags\/","http:\/\/airdev.test\/2009\/05\/15\/edge-case-nested-and-mixed-lists\/","http:\/\/airdev.test\/level-1\/","http:\/\/airdev.test\/level-1\/level-2\/","http:\/\/airdev.test\/level-1\/level-2\/level-3\/","http:\/\/airdev.test\/about\/page-with-comments-disabled\/","http:\/\/airdev.test\/about\/page-with-comments\/","http:\/\/airdev.test\/lorem-ipsum\/"]

// Coming soon, see: https://github.com/yargalot/gulp-accessibility/issues/21

return gulp.src(files)
.pipe(access({
accessibilityLevel: 'WCAG2AA',
browser: true,
reportType: 'json',
reportLevels: {
notice: false,
warning: false,
error: true
}
}))
.on('error', console.log)
});


/*
STYLES
Expand Down Expand Up @@ -160,11 +190,19 @@ WATCH
*/

// Run the JS task followed by a reload
gulp.task('js-watch', ['js'], browserSync.reload);
gulp.task('watch', ['browsersync'], function() {
gulp.task('watch', ['browsersync'], () => {

gulp.watch(phpSrc, ['a11y'], browserSync ? browserSync.reload : {});
gulp.watch(sassSrc, ['styles']);
gulp.watch(jsSrc, ['js-watch']);
gulp.watch(jsSrc, ['js']);

});

/*
DEFAULT
=====
*/

gulp.task('default', ['watch']);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "air",
"version": "3.4.3",
"version": "3.4.4",
"description": "A minimalist WordPress starter theme.",
"author": "Digitoimisto Dude Oy ([email protected])",
"devDependencies": {
"access-sniff": "^3.1.0",
"browser-sync": "^2.18.13",
"gulp": "^3.9.1",
"gulp-accessibility": "^3.0.1",
"gulp-autoprefixer": "4.0.0",
"gulp-changed": "^3.1.1",
"gulp-clean-css": "3.9.0",
"gulp-concat": "2.6.1",
"gulp-header": "1.8.9",
"gulp-notify": "^3.0.0",
"gulp-php2html": "^0.3.2",
"gulp-pixrem": "^1.0.0",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.1",
Expand Down
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air
Author: Digitoimisto Dude Oy
Author URI: https://www.dude.fi
Description: A minimalist WordPress starter theme.
Version: 3.4.3
Version: 3.4.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: air
Expand All @@ -20,5 +20,5 @@ Tags: one-column, accessibility-ready, translation-ready
*
* @author Roni Laukkarinen (https://github.com/ronilaukkarinen), Timi Wahalahti (https://github.com/timiwahalahti)
* @version 25.01.2018
* @since 28.01.2016
* @since 29.01.2016
*/
13 changes: 13 additions & 0 deletions wcag-test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05c1aed

Please sign in to comment.