Skip to content

Commit e902a4f

Browse files
devversionjelbourn
authored andcommitted
chore: fix axe-core accessibility errors
axe-core didn't run in the past due to a runtime dependency resolution error. Protractor didn't report this as an error and silently skipped the plugin. Now that the plugin runs again, we need to fix all axe-core errors. We want to leave the `missing-label` rule to be active since it could catch issues with real components.
1 parent 453a5bb commit e902a4f

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

src/e2e-app/input/input-e2e.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<section>
22
<p>
33
<mat-form-field>
4-
<input matInput type="text" id="text-input" placeholder="Enter some text">
4+
<mat-label>Enter some text</mat-label>
5+
<input matInput type="text" id="text-input">
56
</mat-form-field>
67
</p>
78
<p>
89
<mat-form-field>
9-
<input matInput type="number" id="number-input" placeholder="Enter a number">
10+
<mat-label>Enter a number</mat-label>
11+
<input matInput type="number" id="number-input">
1012
</mat-form-field>
1113
</p>
1214
<p>
1315
<mat-form-field>
14-
<textarea matInput id="text-area" placeholder="Enter some text"></textarea>
16+
<mat-label>Enter some text</mat-label>
17+
<textarea matInput id="text-area"></textarea>
1518
</mat-form-field>
1619
</p>
1720
<p>
1821
<mat-form-field>
19-
<textarea matInput cdkTextareaAutosize cdkAutosizeMaxRows="10" id="autosize-text-area"
20-
placeholder="Enter some text"></textarea>
22+
<mat-label>Enter some text</mat-label>
23+
<textarea matInput cdkTextareaAutosize cdkAutosizeMaxRows="10" id="autosize-text-area">
24+
</textarea>
2125
</mat-form-field>
2226
</p>
2327
</section>

src/e2e-app/mdc-tabs/mdc-tabs-e2e.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<mat-tab>
44
<ng-template mat-tab-label>One</ng-template>
55
<mat-form-field>
6-
<textarea matInput placeholder="Autosize textarea" cdkTextareaAutosize>This is an autosize textarea, it should adjust to the size of its content.</textarea>
6+
<mat-label>Autosize textarea</mat-label>
7+
<textarea matInput cdkTextareaAutosize>
8+
This is an autosize textarea, it should adjust to the size of its content.
9+
</textarea>
710
</mat-form-field>
811
</mat-tab>
912
<mat-tab>

src/e2e-app/tabs/tabs-e2e.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<mat-tab>
44
<ng-template mat-tab-label>One</ng-template>
55
<mat-form-field>
6-
<textarea matInput placeholder="Autosize textarea" cdkTextareaAutosize>This is an autosize textarea, it should adjust to the size of its content.</textarea>
6+
<mat-label>Autosize textarea</mat-label>
7+
<textarea matInput cdkTextareaAutosize>
8+
This is an autosize textarea, it should adjust to the size of its content.
9+
</textarea>
710
</mat-form-field>
811
</mat-tab>
912
<mat-tab>

tools/axe-protractor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const checkedPages = [];
1313
/**
1414
* Protractor plugin hook which always runs when Angular successfully bootstrapped.
1515
*/
16-
function onPageStable() {
17-
AxeBuilder(browser.driver)
16+
async function onPageStable() {
17+
await AxeBuilder(browser.driver)
1818
.configure(this.config || {})
1919
.analyze(results => handleResults(this, results));
2020
}
@@ -32,7 +32,7 @@ function handleResults(context, results) {
3232
checkedPages.push(results.url);
3333

3434
results.violations.forEach(violation => {
35-
35+
3636
let specName = `${violation.help} (${results.url})`;
3737
let message = '\n' + buildMessage(violation);
3838

0 commit comments

Comments
 (0)