nhsuk / ui-test-core

Python package which helps with writing UI tests by providing a wrapper around Selenium and other useful functions
MIT License
12 stars 6 forks source link

Axe report improvements #38

Closed ghufrankhan closed 1 year ago

ghufrankhan commented 1 year ago

Description

Added the ability to include/exclude elements when running Axe reports on a page. This is not a breaking change as the default is still running the report on the full page. To make use of this, pass in a JSON to the _elementfilter parameter in the _run_axe_accessibilityreport function. An example of include using CSS: {"include": [["#nhsuk-cookie-banner"]]} An example of exclude using CSS: {"exclude": [["#nhsuk-cookie-banner"], [".footer"]]}

Motivation and Context

This change allows a user to include/exclude certain elements from the Axe report such as a cookie banner, a header or a footer.

Checklist