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

  1. Copy the below line to dependencies section of the project build.gradle file

    Example 1. build.gradle
    implementation(group: 'org.vividus', name: 'vividus-plugin-accessibility', version: '0.5.5')
  2. If the project was imported to the IDE before adding new plugin, re-generate the configuration files for the used IDE and then refresh the project in the used IDE.

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-separated locators of elements to verify

    • elementsToIgnore - The comma-separated 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 page with URL `https://vividus-test-site.onrender.com/`
When I change context to element located by `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(//*)                                    |               |                                                                                       |