mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore: run a11y audits on protractor (#2010)
* chore: run a11y audits on protractor * Fixes accessibility issue in grid-list with `role="listitem"` * Adds protractor plugin to run aXe-core accessibility audits * Fixes a bunch of a11y issues in the e2e app to make the aXe audits green * Force menu y-positions because viewport might be different on Selenium browsers. * Navigiation links should be hidden by default because those can interfere with the tests.
This commit is contained in:
committed by
Jeremy Elbourn
parent
66c25be710
commit
c5fb94f2a4
+14
-2
@@ -9,7 +9,6 @@ require('ts-node').register({
|
||||
|
||||
const E2E_BASE_URL = process.env['E2E_BASE_URL'] || 'http://localhost:4200';
|
||||
const config = {
|
||||
// TODO(jelbourn): add back plugin for a11y assersions once it supports specifying AXS options.
|
||||
useAllAngular2AppRoots: true,
|
||||
specs: [ path.join(__dirname, '../e2e/**/*.e2e.ts') ],
|
||||
baseUrl: E2E_BASE_URL,
|
||||
@@ -17,7 +16,20 @@ const config = {
|
||||
getPageTimeout: 120000,
|
||||
jasmineNodeOpts: {
|
||||
defaultTimeoutInterval: 120000,
|
||||
}
|
||||
},
|
||||
|
||||
plugins: [
|
||||
{
|
||||
// Runs the axe-core accessibility checks each time the e2e page changes and
|
||||
// Angular is ready.
|
||||
path: '../tools/axe-protractor/axe-protractor.js',
|
||||
|
||||
rules: [
|
||||
// Exclude md-menu elements because those are empty if not active.
|
||||
{ id: 'aria-required-children', selector: '*:not(md-menu)' },
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
if (process.env['TRAVIS']) {
|
||||
|
||||
Reference in New Issue
Block a user