testaro 4.7.1 → 4.9.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "4.7.1",
3
+ "version": "4.9.0",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/labClash.js CHANGED
@@ -71,33 +71,32 @@ exports.reporter = async (page, withItems) => {
71
71
  }
72
72
  }
73
73
  }
74
- // Content label if details required.
75
- if (withItems) {
76
- // Of button.
77
- if (labelee.tagName === 'BUTTON') {
78
- const content = debloat(labelee.textContent);
79
- if (content) {
80
- texts.content = content;
81
- }
74
+ // Content label.
75
+ // Of button.
76
+ if (labelee.tagName === 'BUTTON') {
77
+ const content = debloat(labelee.textContent);
78
+ if (content) {
79
+ texts.content = content;
82
80
  }
83
- // Of submit input.
84
- else if (labelee.tagName === 'INPUT' && labelee.type === 'submit' && labelee.value) {
85
- const content = debloat(labelee.value);
86
- if (content) {
87
- texts.content = content;
88
- }
81
+ }
82
+ // Of submit input.
83
+ else if (labelee.tagName === 'INPUT' && labelee.type === 'submit' && labelee.value) {
84
+ const content = debloat(labelee.value);
85
+ if (content) {
86
+ texts.content = content;
87
+ }
88
+ }
89
+ // Of image input.
90
+ else if (labelee.tagName === 'INPUT' && labelee.type === 'image' && labelee.alt) {
91
+ const content = debloat(labelee.alt);
92
+ if (content) {
93
+ texts.content = content;
89
94
  }
90
95
  }
91
96
  const {totals} = data;
92
97
  const labelTypeCount = labelTypes.length;
93
98
  // If it is well labeled:
94
- if (
95
- labelTypeCount === 1
96
- || ! labelTypeCount && (
97
- labelee.tagName === 'BUTTON' && debloat(labelee.textContent).length
98
- || labelee.tagName === 'INPUT' && labelee.type === 'submit' && labelee.value
99
- )
100
- ) {
99
+ if (labelTypeCount === 1 || (texts.content && ! labelTypeCount)) {
101
100
  // Increment the count of well-labeled items in the report.
102
101
  totals.wellLabeled++;
103
102
  // Add data on the item to the report, if required.
package/tests/role.js CHANGED
@@ -22,8 +22,6 @@ exports.reporter = async page => await page.$eval('body', body => {
22
22
  'complementary',
23
23
  'contentinfo',
24
24
  'definition',
25
- 'dialog',
26
- 'document',
27
25
  'figure',
28
26
  'graphics-document',
29
27
  'gridcell',
@@ -38,7 +36,6 @@ exports.reporter = async page => await page.$eval('body', body => {
38
36
  'option',
39
37
  'progressbar',
40
38
  'radio',
41
- 'region',
42
39
  'row',
43
40
  'rowgroup',
44
41
  'rowheader',
@@ -42,13 +42,14 @@
42
42
  "withItems": true,
43
43
  "what": "focus indication",
44
44
  "expect": [
45
- ["totals.total", "=", 7],
46
- ["totals.types.indicatorMissing.total", "=", 2],
45
+ ["totals.total", "=", 9],
46
+ ["totals.types.indicatorMissing.total", "=", 3],
47
47
  ["totals.types.indicatorMissing.tagNames.A", "=", 1],
48
- ["totals.types.indicatorMissing.tagNames.INPUT", "=", 1],
49
- ["totals.types.nonOutlinePresent.total", "=", 2],
48
+ ["totals.types.indicatorMissing.tagNames.INPUT", "=", 2],
49
+ ["totals.types.nonOutlinePresent.total", "=", 3],
50
50
  ["totals.types.nonOutlinePresent.tagNames.A", "=", 1],
51
51
  ["totals.types.nonOutlinePresent.tagNames.BUTTON", "=", 1],
52
+ ["totals.types.nonOutlinePresent.tagNames.INPUT", "=", 1],
52
53
  ["totals.types.outlinePresent.total", "=", 3],
53
54
  ["totals.types.outlinePresent.tagNames.A", "=", 1],
54
55
  ["totals.types.outlinePresent.tagNames.BUTTON", "=", 1],
@@ -20,7 +20,7 @@
20
20
  "expect": [
21
21
  ["totals.mislabeled", "=", 0],
22
22
  ["totals.unlabeled", "=", 0],
23
- ["totals.wellLabeled", "=", 6]
23
+ ["totals.wellLabeled", "=", 7]
24
24
  ]
25
25
  },
26
26
  {
@@ -35,7 +35,7 @@
35
35
  "withItems": false,
36
36
  "expect": [
37
37
  ["totals.mislabeled", "=", 3],
38
- ["totals.unlabeled", "=", 2],
38
+ ["totals.unlabeled", "=", 3],
39
39
  ["totals.wellLabeled", "=", 0]
40
40
  ]
41
41
  }
@@ -7,22 +7,28 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <style>
9
9
  #button:focus, #checkbox:focus {
10
- outline: 3px blue solid;
10
+ outline: 3px solid blue;
11
11
  outline-offset: 2px;
12
12
  }
13
- #slowLink:focus, #sluggishLink:focus {
14
- border: 2px green solid;
15
- outline: none;
16
- }
17
13
  #checkbox {
18
14
  transition-property: outline;
19
15
  transition-delay: 35ms;
20
16
  transition-duration: 40ms;
21
17
  }
18
+ #outlinedInput {
19
+ outline: 2px solid black;
20
+ }
21
+ #outlinedInput:focus {
22
+ outline: 2px solid brown;
23
+ }
22
24
  #slowLink {
23
25
  transition-property: border;
24
26
  transition-delay: 125ms;
25
27
  }
28
+ #slowLink:focus, #sluggishLink:focus {
29
+ border: 2px solid green;
30
+ outline: none;
31
+ }
26
32
  #sluggishLink {
27
33
  transition-property: border;
28
34
  transition-delay: 525ms;
@@ -35,6 +41,12 @@
35
41
  #textInput:focus {
36
42
  outline: none;
37
43
  }
44
+ #thickOutlineInput {
45
+ outline: 1px solid black;
46
+ }
47
+ #thickOutlineInput:focus {
48
+ outline: 4px solid black;
49
+ }
38
50
  </style>
39
51
  </head>
40
52
  <body>
@@ -43,6 +55,8 @@
43
55
  <p>This paragraph contains a link to <a href="https://en.wikipedia.org">English information</a>, which exhibits a default focus indicator.</p>
44
56
  <p>This paragraph contains a <button id="button" type="button">button</button> with a custom outline as its focus indicator.</p>
45
57
  <p>This paragraph contains a <label>text input <input id="textInput" type="text"></label> with the focus indicator suppressed.</p>
58
+ <p>This paragraph contains a <label>text input <input id="outlinedInput" type="text"></label> with a custom outline, which changes only color when the input is focused.</p>
59
+ <p>This paragraph contains a <label>text input <input id="thickOutlineInput" type="text"></label> with a custom outline, which changes only thickness when the input is focused.</p>
46
60
  <p>This paragraph contains a checkbox with an enhanced focus-indication outline that finishes appearing 75 ms after the checkbox becomes focused. <label><input id="checkbox" type="checkbox"> I am a bad page.</label></p>
47
61
  <p>This paragraph contains a link to <a id="slowLink" href="https://fr.wikipedia.org">French information</a> with a custom border as its only focus indicator. The border appears 125 ms after the link becomes focused.</p>
48
62
  <p>This paragraph contains a link to <a id="sluggishLink" href="https://de.wikipedia.org">German information</a> with a custom border as its only focus indicator. The border appears 525 ms after the link becomes focused.</p>
@@ -12,6 +12,10 @@
12
12
  <p>This paragraph contains an empty <button type="button" aria-label></button> button, with no accessible name.</p>
13
13
  <p>This is another <button id="labButton" type="button" aria-labelledby="buttonLabel">button</button> with its text content overridden by both an explicit label and a reference label as a <label id="buttonLabel" for="labButton">special type of button</label>.</p>
14
14
  <p>This is an implicitly and attribute-labeled <label>checkbox input <input id="cbox" type="checkbox" aria-label="a checkbox-type input"></label>.</p>
15
+ <p style="display: flex; align-items: center;">
16
+ <span>Here is an image input without a text alternative:</span>
17
+ <input type="image" src="delete.png" width="30rem">
18
+ </p>
15
19
  <p><span id="textInputLabel">Who is your favorite actor?</span> <input type="text" aria-labelledby="textInputLabel" aria-label="your favorite actor">.</p>
16
20
  <p>What do you think? Enter your thoughts into this text area, which is unlabeled.</p>
17
21
  <p><textarea aria-label></textarea></p>
@@ -10,6 +10,10 @@
10
10
  <main>
11
11
  <h1>Page with standard labeling</h1>
12
12
  <p>This paragraph contains a <button type="button">button</button> with its text content as accessible name, another <button id="labButton" type="button">button</button> with its text content overridden by an explicit label as a <label for="labButton">special type of button</label>, an <label>implicitly labeled text input <input type="text"></label>, and an explicitly labeled <label for="cbox">checkbox input</label>: <input id="cbox" type="checkbox">.</p>
13
+ <p style="display: flex; align-items: center;">
14
+ <span>Here is an image input with a text alternative:</span>
15
+ <input type="image" src="delete.png" alt="delete" width="30rem">
16
+ </p>
13
17
  <p>This <label>implicitly labeled text input <input id="textInput" type="text"></label> also has an explicit label, which validly provides <label for="textInput">additional information</label>.</p>
14
18
  <p><span id="what">What do you think?</span> Enter your thoughts into this text area, which is labeled by reference.</p>
15
19
  <p><textarea aria-labelledby="what"></textarea></p>
@@ -19,7 +19,7 @@
19
19
  </section>
20
20
  <section>
21
21
  <h2>Conflict</h2>
22
- <p>The parent section of these sections has an unnecessary explicit role.</p>
22
+ <p>The parent section of these sections has an unnecessary explicit role, instead of an element with the same implicit role.</p>
23
23
  </section>
24
24
  </section>
25
25
  </body>