Skip to content

Commit

Permalink
FCL-438 | add axe playwright automated accessibility testing informat…
Browse files Browse the repository at this point in the history
…ion to the readme
  • Loading branch information
jlhdxw committed Nov 29, 2024
1 parent e0c9f31 commit 55005bb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ fab e2etest

These will run by default against the running `django` container. You can supply a `baseURL` argument to test against staging or production.

#### Accessibility testing with E2E tests

We use axe playwright to automatically check for accessibility issues on our pages. When adding a new page, you should also add a test to ensure it is accessible and stays accessible.

To add an automatic accessibility check you can add the `assert_is_accessible` check to your tests, for example:

```python
def test_my_page(page: Page):
page.goto("/my_page")
assert_is_accessible(page)
```

If the page is accessible, the console won't output anything other than the usual test output. If there are accessibility issues, there will be output that explains what the issues are and also helpful links explaining how to fix them.

#### Viewing code coverage

```console
Expand Down

0 comments on commit 55005bb

Please sign in to comment.