Marcy Sutton, Seattle, WA
Accessibility Engineer, Angular Core Team Member
* Inclusive of people with disabilities
Concept
by Addy Osmani
var a11y = require('a11y');
a11y('cnn.com', function (err, reports) {
var report = reports.report;
console.log(report);
});
describe('bottom sheet view', function() {
beforeEach(function() {
// click on share button
element(by.css('button.share')).click();
});
it('should focus on the first item', function() {
// verify focus was sent into bottom sheet
element.all(by.css('[ng-click="vm.performAction(item)"]'))
.then(function(items) {
expect(items[0].getAttribute('id'))
.toEqual(browser.driver.switchTo().activeElement().getAttribute('id'));
});
Runs your tests against
ddescribe('tabindex', function() {
beforeEach(injectScopeAndCompiler);
it('should not attach to native controls', function() {
compileElement("");
expectAriaAttrOnEachElement(element, 'tabindex', undefined);
});
it('should attach tabindex to custom inputs', function() {
compileElement('');
expect(element.attr('tabindex')).toBe('0');
compileElement('');
expect(element.attr('tabindex')).toBe('0');
});
it('should attach to ng-click', function() {
compileElement('');
expect(element.attr('tabindex')).toBe('0');
});
...