Accessibility Plugin

The plugin provides functionality to perform accessibility validations. For more info please see HTML Code Sniffer Supported checks against following standards: WCAG2 and Section 508

Installation

Example 1. build.gradle
implementation(group: 'org.vividus', name: 'vividus-plugin-accessibility', version: '0.4.16')

Steps

Validate accessibility

Then I test accessibility:$options
  • $options - The accessibility validation options. Where:

    • standard - The accessibility stanadard to verify against. One of WCAG2A, WCAG2AA, WCAG2AAA, Section 508

    • level - The violation level used to check. One of ERROR - only errors will be validated, WARNING - error and warning will be validated, NOTICE - all the levels will be valiadted

    • locators - The comma-separeted locators of elements to verify

    • elementsToIgnore - The comma-separeted locators of elements to ignore

    • violationsToIgnore - The violations codes which should be ignored

    • violationsToCheck - The violations codes which should be checked

If violation code will be set as checked and ignored then it will be checked and not ignored
The step based on the contextual approach and when it’s necessary it could be used to validate the accessibility of the context element only.
Example 2. Check accessibility
Given I am on a page with the URL 'https://vividus-test-site.herokuapp.com/'
When I change context to element located `xpath(//body)`
Then I test accessibility:
|standard|level |elementsToIgnore                                 |elementsToCheck|violationsToIgnore                                                                     |
|WCAG2AAA|NOTICE|By.id(ignore), By.cssSelector(#errors > h1 > img)|               |WCAG2AAA.Principle1.Guideline1_3.1_3_1.H42.2,WCAG2AAA.Principle2.Guideline2_4.2_4_9.H30|
|WCAG2AAA|NOTICE|By.xpath(//*)                                    |               |                                                                                       |