(.executeScript()コマンドを使用して)現在のページにaxe-core jsライブラリを挿入します。

axe-coreアクセシビリティルールを評価するために、.axeRun()と組み合わせて使用します。

使用方法

                    browser.axeInject()
                

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