.axeInject() Suggest edits
Since: 2.3.6Injects the axe-core js library into the current page (using the .executeScript()
command).
To be paired with .axeRun()
to evaluate the axe-core accessibility rules.
Usage
browser.axeInject()
Example
describe('accessibility testing', function () {
it('accessibility rule subset', function (browser) {
browser
.url('https://www.w3.org/WAI/demos/bad/after/home.html')
.assert.titleEquals('Welcome to CityLights! [Accessible Home Page]')
.axeInject()
.axeRun('body', {
runOnly: ['color-contrast', 'image-alt'],
});
});
});