Analyzes the current page against applied axe rules.

Usage

                    browser.axeRun('body')
                

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

Parameters

Name Type description
context
Optional
[object Object]

Defines the scope of the analysis, will cascade to child elements. See axe-core docs for more details.

options
Optional
object

Object containing rules configuration to use when performing the analysis. See axe-core docs for more details.

callback
Optional
function

Optional callback function which is called with the results.

See also