2.0.4 • Published 10 months ago

nightwatch-accessibility v2.0.4

Weekly downloads
1,296
License
MIT
Repository
github
Last release
10 months ago

Nightwatch Accessibility

Nightwatch.js utility assertion for accessibility testing with aXe.

license release semantic

Install

npm install nightwatch-accessibility

Usage

Nightwatch >= 2.x

add nightwatch-accessibility to the plugins array

{
  plugins: ['nightwatch-accessibility']
}

Nightwatch \<= 1.x

{
  custom_commands_path: ["./node_modules/nightwatch-accessibility/nightwatch/commands"],
  custom_assertions_path: ["./node_modules/nightwatch-accessibility/nightwatch/assertions"]
}

Use in your tests:

module.exports = {
  'Test': function (browser) {
    browser
      // initiate aXe
      .initAccessibility() 

      // execute accessibility check
      .assert.accessibility('#app', {
        verbose: true,
        rules: {
          'color-contrast': { enabled: false }
        }
      })
  }
}

API

browser.initAccessibility()

Injects the aXe library into the current test page.

browser.assert.accessibility(context, options)

Analyzes the defined context against applied aXe rules

NameTypeDefaultDescription
contextString'html'aXe Context Parameter
optionsObjectnullaXe Options Parameter

In addition to the standard options:


Author: Ahmad Nassri  Twitter: @AhmadNassri

2.0.4

10 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.11.3

2 years ago

1.11.2

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.9.0

3 years ago

1.10.0

3 years ago

1.8.0

5 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago