grunt-tenon
Accessibility testing tool
Grunt task interface to the Tenon.io automated accessibility testing service; learn more about Tenon.io here.
This plugin is currently in beta. Please file an issues as you come across. Contributors welcome.
Getting Started
This plugin requires Grunt ~0.4.4
and Node no later than 0.10.0*.
*Users with newer versions are experiencing issues with the node-curl plugin that is required to make request against the Tenon API.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-tenon --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "tenon" task
Overview
In your project's Gruntfile, add a section named tenon
to the data object passed into grunt.initConfig()
.
grunt;
Properties
urls
Type: Array
Default value: []
A list of publicly accessible URLs that can be tested against the tenon API. Items of array, can be String
or Object
. If an object, additional tenon params can be added to object literal.
grunt;
Options
options.apiKey
Type: String
Default: ''
Registered tenon API key.
options.apiOptions
Type: Object
Default: {}
An object literal of tenon api parameters.
options.contentPaths
Type: Array
Default: []
A list of explicit content paths that are concatenated with the httpBase
to form a publicly accessible URL for the tenon API to crawl.
options.force
Type: Boolean
Default: false
Set force
to true
to report JSHint errors but not fail the task.
options.httpBase
Type: String
Default: ''
Base host for an internal list of URLs to crawl.
options.timeout
Type: Number
Default value: 3000
The number in miliseconds of the request timeout to the tenon API.
options.urlService
Type: String
Default value: ''
A custom service endpoint that must return JSON and has a urls
property. This property is an array
of object literals. An individual object literal has a property called, path
, which is the path tto a page. The path can be fully qualified or relative to the httpBase
.
Usage Examples
Default Options
In this example, the default options are used to set the tenon API key and public URL is crawled by the service.
grunt;
Custom Options
In this example, custom options are used to overwrite the default options.
grunt;
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
v0.0.1
v0.0.2
- Updated Gruntfile.js
v0.0.3
- Updated README.md
v0.0.4
- Updated for NPM
v.0.0.5
- Refactored node modules.
- Added tenon api options as task options
- Moved
urls
from options to dedicated property and made reverse compatible as options. This matches the usage examples now. - Edited custom service description.
- Updated README.md
v.0.0.6
- Updated README.md
v.0.0.7
- Added all tenon options to default (bulk) url requests.
- Added ability to pass all tenon request options to each test URL to override default options, while still retaining ability to pass individual url strings.
- Temporaily deprecated the
src
param, URL testing available in future version - Updated README.md
v.0.0.8
- Updated version of node-curl dependency
v.0.0.9
- Updates to reporter and tenon API endpoint