From b5eb1947f5dc803a4560b44949b8f59ce5b80f28 Mon Sep 17 00:00:00 2001 From: Marcy Sutton Date: Fri, 9 Sep 2016 11:36:34 -0700 Subject: [PATCH] test(a11y): add axe-webdriverjs to scenario --- e2e-tests/scenarios.js | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) diff --git a/e2e-tests/scenarios.js b/e2e-tests/scenarios.js index 240d5f61ac..5e57055a85 100644 --- a/e2e-tests/scenarios.js +++ b/e2e-tests/scenarios.js @@ -2,6 +2,8 @@ /* https://github.com/angular/protractor/blob/master/docs/toc.md */ +var AxeBuilder = require('axe-webdriverjs'); + describe('my app', function() { @@ -40,3 +42,22 @@ describe('my app', function() { }); }); + +describe('accessibility', function() { + + it('should have no violations', function(done) { + browser.get('index.html').then(function(){ + AxeBuilder(browser).analyze(function(results) { + if (results.violations.length > 0) { + console.log(results.violations); + } + else { + console.log('No accessibility violations!'); + } + expect(results.violations.length).toBe(0); + done(); + }) + }); + }); + +}); diff --git a/package.json b/package.json index 95cc9d56fc..5b2ce23977 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "repository": "https://github.com/angular/angular-seed", "license": "MIT", "devDependencies": { + "axe-webdriverjs": "^0.3.0", "bower": "^1.7.7", "http-server": "^0.9.0", "jasmine-core": "^2.4.1",