axe-core js 函式庫注入到當前頁面(使用 .executeScript() 命令)。

需與 .axeRun() 配對使用以評估 axe-core 無障礙規則。

用法

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