-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get develop-2x up to date with support docs #635
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -2,6 +2,16 @@ | |
|
||
aXe runs a series of tests to check for accessibility of content and functionality on a website. A test is made up of a series of Rules which are, themselves, made up of Checks. aXe executes these Rules asynchronously and, when the Rules are finished running, runs a callback function which is passed a Result structure. Since some Rules run on the page level while others do not, tests will also run in one of two ways. If a document is specified, the page level rules will run, otherwise they will not. | ||
|
||
1. [Getting Started](#getting-started) | ||
1. [Architecture Overview](#architecture-overview) | ||
1. [Rules](#rules) | ||
1. [Checks](#checks) | ||
1. [Common Functions](#common-functions) | ||
1. [Core Utilities](#core-utilities) | ||
1. [Test Utilities](#test-utilities) | ||
1. [Test Util Name: axe.testUtils.MockCheckContext](#test-util-name-axetestutilsmockcheckcontext) | ||
1. [Test Util Name: axe.testUtils.fixtureSetup](#test-util-name-axetestutilsfixturesetup) | ||
|
||
## Getting Started | ||
|
||
### Environment Pre-requisites | ||
|
@@ -16,9 +26,9 @@ To build axe.js, simply run `grunt build`. axe.js and axe.min.js are placed int | |
|
||
### Running Tests | ||
|
||
To run all tests from the command line you can run `grunt test`, which will run all unit and integration tests using PhantomJS. | ||
To run all tests from the command line you can run `grunt test`, which will run all unit and integration tests using PhantomJS and Selenium Webdriver. | ||
|
||
You can also load tests in any supported browser, which is helpful for debugging. Tests require a local server to run, you must first start a local server to serve files. You can use Grunt to start one by running `grunt connect watch`. Once your local server is running you can load the following pages in any browser to run tests: | ||
You can also load tests in any supported browser, which is helpful for debugging. Tests require a local server to run, you must first start a local server to serve files. You can use Grunt to start one by running `grunt dev`. Once your local server is running you can load the following pages in any browser to run tests: | ||
|
||
|
||
1. [Core Tests](../test/core/) | ||
|
@@ -78,6 +88,7 @@ Similar to Rules, Checks are defined by JSON files in the [lib/checks directory] | |
* `messages` - `Object` These messages are displayed when the Check passes or fails | ||
* `pass` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check passes | ||
* `fail` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check fails | ||
* `incomplete` – `String|Object` – [doT.js](http://olado.github.io/doT/) template string displayed when the Check is incomplete OR an object with `missingData` on why it returned incomplete. Refer to [rules.md](./rules.md). | ||
|
||
#### Check `evaluate` | ||
|
||
|
@@ -115,9 +126,20 @@ return results.filter(function (r) { | |
}); | ||
``` | ||
|
||
#### Pass and Fail Templates | ||
#### Pass, Fail and Incomplete Templates | ||
|
||
Occasionally, you may want to add additional information about why a Check passed, failed or returned undefined into its message. For example, the [aria-valid-attr](../lib/checks/aria/valid-attr.json) will add information about any invalid ARIA attributes to its fail message. The message uses the [doT.js](http://olado.github.io/doT/) and is compiled to a JavaScript function at build-time. In the Check message, you have access to the `CheckResult` as `it`. | ||
|
||
```javascript | ||
// aria-valid-attr check | ||
"messages": { | ||
"pass": "ARIA attributes are used correctly for the defined role", | ||
"fail": "ARIA attribute{{=it.data && it.data.length > 1 ? 's are' : ' is'}} not allowed:{{~it.data:value}} {{=value}}{{~}}" | ||
} | ||
``` | ||
|
||
Occasionally, you may want to add additional information about why a Check passed or failed into its message. For example, the [aria-valid-attr](../lib/checks/aria/valid-attr.json) will add information about any invalid ARIA attributes to its fail message. The message uses the [doT.js](http://olado.github.io/doT/) and is compiled to a JavaScript function at build-time. In the Check message, you have access to the `CheckResult` as `it`. | ||
See [Developing Axe-core Rules](./rule-development.md) for more information | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section made it in twice somehow. Will remove. |
||
on writing rules and checks, including incomplete results. | ||
|
||
See [Developing Axe-core Rules](./rule-development.md) for more information | ||
on writing rules and checks, including incomplete results. | ||
|
@@ -140,6 +162,21 @@ Common functions are an internal library used by the rules and checks. If you h | |
|
||
Core Utilities are an internal library that provides aXe with functionality used throughout its core processes. Most notably among these are the queue function and the DqElement constructor. | ||
|
||
#### ARIA Lookup Tables | ||
|
||
axe.commons.aria provides a namespace for ARIA-related utilities, including a lookupTable for attributes and roles. | ||
|
||
* `axe.commons.aria.lookupTable.attributes` | ||
* `axe.commons.aria.lookupTable.globalAttributes` | ||
* `axe.commons.aria.lookupTable.role` | ||
|
||
#### Common Utility Functions | ||
|
||
In addition to the ARIA lookupTable, there are also utility functions on the axe.commons.aria and axe.commons.dom namespaces: | ||
|
||
* `axe.commons.aria.implicitRole` - Get the implicit role for a given node | ||
* `axe.commons.aria.label` - Gets the accessible ARIA label text of a given element | ||
* `axe.commons.dom.isVisible` - Determine whether an element is visible | ||
|
||
#### Queue Function | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
var href = node.getAttribute('href'); | ||
|
||
if(href === '#'){ | ||
if (href === '#') { | ||
return false; | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have an
incomplete
example?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, although I just took what was on jsdoc/develop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilcoFiers the previous sentence mentions the rule-development doc, which has thorough instructions for incomplete messages. I'd prefer not to have it in multiple places.