axe-core-cucumber 2.6.1.pre.78a535c → 4.0.0.pre.2bf4a90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -20
- data/lib/axe-cucumber.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d067d098c322b5f54b8a1c572c288f598c60b1f12e83041e72e83eec98cd1a9f
|
4
|
+
data.tar.gz: bfc4ed89cf8ac8a709b6310be640172cdfb9ec962d9fa228caabc57bdc50f040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660024474cefb91942cda1712b78f9937db4f08f3c1255c0249e6927f8e1766df23f03cc436664205c0f3f7a969d6bd114b561d37400df81ea584df6ca0dc79a
|
7
|
+
data.tar.gz: 6c627603981bcb31ab892d8dad51dd5b99e7305dd5107b77801856e41fab61c610b1a86f865b35030085b1994c735b0136c6d6d73abc88e0b87d23259ff942c0
|
data/README.md
CHANGED
@@ -23,15 +23,15 @@ require 'axe-cucumber-steps'
|
|
23
23
|
|
24
24
|
### Base Step
|
25
25
|
|
26
|
-
The base step `be
|
26
|
+
The base step `be axe clean` is the core component of the step. It is a complete step on its own and will verify the currently loaded page is axe clean using the default configuration of [axe.run][axe-run] (the entire document is checked using the default rules).
|
27
27
|
|
28
28
|
```gherkin
|
29
|
-
Then the page should be
|
29
|
+
Then the page should be axe clean
|
30
30
|
```
|
31
31
|
|
32
32
|
#### Clauses
|
33
33
|
|
34
|
-
Clauses are chainable methods for the `be
|
34
|
+
Clauses are chainable methods for the `be axe clean` custom step.Configurable clauses allows for greater granularity with testing and expectaions.
|
35
35
|
|
36
36
|
##### `within` - Inclusion clause
|
37
37
|
|
@@ -39,7 +39,7 @@ The inclusion clause ( `within "#selector"` ) specifies which elements of the pa
|
|
39
39
|
*see additional [context parameter documentation][context-param]*
|
40
40
|
|
41
41
|
``` gherkin
|
42
|
-
Then the page should be
|
42
|
+
Then the page should be axe clean within "#selector"
|
43
43
|
```
|
44
44
|
|
45
45
|
##### `excluding` - Exclusion clause
|
@@ -48,14 +48,14 @@ The exclusion clause ( `excluding "#selector"` ) specifies which elements of the
|
|
48
48
|
*see additional [context parameter documentation][context-param]*
|
49
49
|
|
50
50
|
``` gherkin
|
51
|
-
Then the page should be
|
51
|
+
Then the page should be axe clean excluding "#selector"
|
52
52
|
```
|
53
53
|
|
54
54
|
If desired, a semicolon ( `;` ) or the word `but` may be used to separate the exclusion clause from the inclusion clause (if present).
|
55
55
|
|
56
56
|
``` gherkin
|
57
|
-
Then the page should be
|
58
|
-
Then the page should be
|
57
|
+
Then the page should be axe clean within "main"; excluding "aside"
|
58
|
+
Then the page should be axe clean within "main" but excluding "aside"
|
59
59
|
```
|
60
60
|
|
61
61
|
##### `according to` - Accessibility Standard (Tag) clause
|
@@ -64,13 +64,13 @@ The tag clause specifies which accessibility standard (or standards) should be u
|
|
64
64
|
The acceptable [tag names are documented][options-param] as well as a [complete listing of rules][rules] that correspond to each tag.
|
65
65
|
|
66
66
|
``` gherkin
|
67
|
-
Then the page should be
|
67
|
+
Then the page should be axe clean according to: tag-name
|
68
68
|
```
|
69
69
|
|
70
70
|
If desired, a semicolon ( `;` ) may be used to separate the tag clause from the preceding clause.
|
71
71
|
|
72
72
|
``` gherkin
|
73
|
-
Then the page should be
|
73
|
+
Then the page should be axe clean within "#header"; according to: best-practice
|
74
74
|
```
|
75
75
|
|
76
76
|
##### `checking` - Checking Rules clause
|
@@ -78,7 +78,7 @@ Then the page should be accessible within "#header"; according to: best-practice
|
|
78
78
|
The checking-rules clause specifies which *additional* rules to run (in addition to the specified tags, if any, or the default ruleset). The rules are specified by comma-separated rule IDs.
|
79
79
|
|
80
80
|
``` gherkin
|
81
|
-
Then the page should be
|
81
|
+
Then the page should be axe clean checking: ruleId
|
82
82
|
```
|
83
83
|
|
84
84
|
*see [rules documentation][rules] for a list of valid rule IDs*
|
@@ -86,8 +86,8 @@ Then the page should be accessible checking: ruleId
|
|
86
86
|
If desired, a semicolon ( `;` ) or the word `and` may be used to separate the checking-rules clause from the preceding clause.
|
87
87
|
|
88
88
|
``` gherkin
|
89
|
-
Then the page should be
|
90
|
-
Then the page should be
|
89
|
+
Then the page should be axe clean according to: wcag2a; checking: color-contrast
|
90
|
+
Then the page should be axe clean according to: wcag2a and checking: color-contrast
|
91
91
|
```
|
92
92
|
|
93
93
|
##### `checking only` - Exclusive Rules clause
|
@@ -95,7 +95,7 @@ Then the page should be accessible according to: wcag2a and checking: color-cont
|
|
95
95
|
This clause is not really a separate clause. But rather, by adding the word `only` to the checking-rules clause, the meaning of the step can be changed. As described above, by default the checking-rules clause specifies *additional* rules to run. If the word `only` is used, then *only* the specified rules are checked.
|
96
96
|
|
97
97
|
``` gherkin
|
98
|
-
Then the page should be
|
98
|
+
Then the page should be axe clean checking only: ruleId
|
99
99
|
```
|
100
100
|
|
101
101
|
##### `skipping` - Skipping Rules clause
|
@@ -103,7 +103,7 @@ Then the page should be accessible checking only: ruleId
|
|
103
103
|
The skipping-rules clause specifies which rules to skip. This allows an accessibility standard to be provided (via the tag clause) while ignoring a particular rule. The rules are specified by comma-separated rule IDs.
|
104
104
|
|
105
105
|
``` gherkin
|
106
|
-
Then the page should be
|
106
|
+
Then the page should be axe clean skipping: ruleId
|
107
107
|
```
|
108
108
|
|
109
109
|
*see [rules documentation][rules] for a list of valid rule IDs*
|
@@ -111,8 +111,8 @@ Then the page should be accessible skipping: ruleId
|
|
111
111
|
If desired, a semicolon ( `;` ) or the word `but` may be used to separate the skipping-rules clause from the preceding clause.
|
112
112
|
|
113
113
|
``` gherkin
|
114
|
-
Then the page should be
|
115
|
-
Then the page should be
|
114
|
+
Then the page should be axe clean according to: wcag2a; skipping: accesskeys
|
115
|
+
Then the page should be axe clean according to: wcag2a but skipping: accesskeys
|
116
116
|
```
|
117
117
|
|
118
118
|
##### Interoperability between clauses
|
@@ -120,13 +120,13 @@ Then the page should be accessible according to: wcag2a but skipping: accesskeys
|
|
120
120
|
All of the described clauses may be mixed and matched with method chaining. Below are some examples.
|
121
121
|
|
122
122
|
``` gherkin
|
123
|
-
Then the page should be
|
123
|
+
Then the page should be axe clean within "main, header" but excluding "footer"
|
124
124
|
|
125
|
-
Then the page should be
|
125
|
+
Then the page should be axe clean excluding "#sidebar" according to: wcag2a, wcag2aa but skipping: color-contrast
|
126
126
|
|
127
|
-
Then the page should be
|
127
|
+
Then the page should be axe clean checking only: document-title, label
|
128
128
|
|
129
|
-
Then the page should be
|
129
|
+
Then the page should be axe clean according to: best-practice and checking: aria-roles, definition-list
|
130
130
|
```
|
131
131
|
|
132
132
|
[inclusion-clause]: #inclusion-clause
|
data/lib/axe-cucumber.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
|
-
require "axe/matchers/
|
3
|
+
require "axe/matchers/be_axe_clean"
|
4
4
|
require "axe/finds_page"
|
5
5
|
require "axe/expectation"
|
6
6
|
|
@@ -16,7 +16,7 @@ module AxeCucumber
|
|
16
16
|
# Extracting regex into variable to allow for easier consumption elsewhere
|
17
17
|
###############
|
18
18
|
# require initial phrasing, with 'not' to negate the matcher
|
19
|
-
REGEX_CAPTURE_NEGATE = "(?-x:the page should( not)? be
|
19
|
+
REGEX_CAPTURE_NEGATE = "(?-x:the page should( not)? be axe clean)"
|
20
20
|
# optionally specify which subtree to check, via CSS selector
|
21
21
|
REGEX_CAPTURE_INCLUSION = '(?-x:;? within "(.*?)")?'
|
22
22
|
# optionally specify subtrees to be excluded, via CSS selector
|
@@ -52,7 +52,7 @@ module AxeCucumber
|
|
52
52
|
skip_rules = "",
|
53
53
|
options = nil
|
54
54
|
)
|
55
|
-
|
55
|
+
is_axe_clean = Axe::Matchers::BeAxeClean.new.tap do |a|
|
56
56
|
a.within(*selector(inclusion))
|
57
57
|
a.excluding(*selector(exclusion))
|
58
58
|
a.according_to(*split(tags))
|
@@ -62,7 +62,7 @@ module AxeCucumber
|
|
62
62
|
a.with_options to_hash(options)
|
63
63
|
end
|
64
64
|
|
65
|
-
Axe::AccessibilityExpectation.create(negate).assert @page,
|
65
|
+
Axe::AccessibilityExpectation.create(negate).assert @page, is_axe_clean
|
66
66
|
end
|
67
67
|
|
68
68
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axe-core-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.pre.2bf4a90
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deque Systems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dumb_delegator
|