Injects the axe-core js library into the current page (using the .executeScript() command).

Usage

browser.axeInject()

Parameters

Name Type description

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'],
      });
  });
})

W3C WebDriver spec