You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/rule-development.md
+21-16Lines changed: 21 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Before you start writing axe-core rules, be sure to create a proposal for them in a GitHub issue. Read [Proposing Axe-core rules](./rule-proposal.md) for details.
4
4
5
-
A rule is a JSON Object that defines a test for axe-core to run. At a high level, think of a rule as doing two things. First it finds all elements that it should test, and after that it runs a number of checks to see if those selected elements pass or fail the rule.
5
+
A rule is a JSON Object that defines a test for axe-core to run. At a high level, think of a rule as doing two things. First it finds all elements that it should test, and after that it runs a number of checks to see if those selected elements pass or fail the rule. The code for rules is in the [`lib/rules`](../lib/rules/) and the checks in [`lib/checks`](../lib/checks/).
6
6
7
7
## Rule Select and Matches
8
8
@@ -20,20 +20,22 @@ The actual testing of elements in axe-core is done by checks. A rule has one or
| metadata.messages.pass | Describes why the check passed |
48
49
| metadata.messages.fail | Describes why the check failed |
49
50
| metadata.messages.incomplete | Describes why the check didn’t complete |
@@ -121,3 +122,7 @@ Rules of thumb for determining whether an `after` function is required - if any
121
122
2. Does the rule evaluate hierarchy of things across a whole page?
122
123
123
124
Rules that use an `after` function MUST have iframe test cases that assert correct data passing between iframes and handle all the relevant cases across iframes.
125
+
126
+
## rule generation
127
+
128
+
Axe comes with a script to help generate rule files. To use this, call `npm run rule-gem` from the root of the project. If you haven't already, make sure to call `npm install` before to get all dependencies installed first.
0 commit comments