axe-core-cucumber 2.6.1.pre.0f0b25b → 4.0.0.pre.2b814f9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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: 2609b6f24be811bd13ad2f4107cb6c1e3cd87595a253ccb9a8b151eed1630355
|
4
|
+
data.tar.gz: e845f086e404d0ba06250584478aeaf412f3150c1886cf8124cbef6533c47f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc4226176942a0102f58453107dfc80553df95c711d83481a01587336eaf554f672aea6cf96d80d15bf24f3efc2f272e0a1727f3f2dfeecce3371946b4b2f914
|
7
|
+
data.tar.gz: e9b891d8cc5b9c4b2388c3a043894887e66b65f64fef9c1b99c057fae461f2cc45e7f0fe7a3cb9cef589cfda71821a1ed6ac1752c52dd92140fde8f506dd3034
|
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.2b814f9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deque Systems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dumb_delegator
|