This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Miller
committed
Jan 18, 2014
1 parent
12044c4
commit 7abf910
Showing
1 changed file
with
57 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
grunt-quail | ||
=== | ||
|
||
> Accessibility testing for your Grunt workflow. | ||
This task is similar to [Qunit for Grunt](https://github.com/gruntjs/grunt-contrib-qunit) in that it loads a list of files and using PhantomJS tests them for accessibility with the [Quail accessibility plugion](http://quailjs.org). | ||
|
||
Getting started | ||
--- | ||
|
||
This task is not currently on NPM until we get more stable, but here's how it will work in the future: | ||
|
||
``` | ||
npm install grunt-quail --save-dev | ||
``` | ||
|
||
Then add the following to your `Gruntfile`: | ||
|
||
``` | ||
grunt.loadNpmTasks('grunt-quail'); | ||
``` | ||
|
||
Options | ||
--- | ||
Configuration options are pretty limited at the moment: | ||
|
||
### files | ||
|
||
A list of files that you would like to test for accessibility. It can handle partial HTML markup, and should not have problems with most templating languages. These follow the standard Grunt file patterns like wildcards, expand, etc. | ||
|
||
### options | ||
A list of options to pass to quail, these include: | ||
|
||
#### accessibiltyTests | ||
An array of test names to run. You can also pass the strings `wcag` or `508` to use a pre-defined guideline. | ||
|
||
#### context | ||
A jQuery-compatible selector of areas of the page to test. If you do not define a context, Quail will run on `*:first`. | ||
|
||
``` | ||
grunt.initConfig({ | ||
quail: { | ||
testing: { | ||
files: [{ | ||
expand : true, | ||
cwd : 'test/', | ||
src : ['*.html'] | ||
}], | ||
options: { | ||
context : 'body', | ||
accessibilityTests: [ | ||
"imgHasAlt" | ||
] | ||
} | ||
} | ||
}, | ||
``` |