Skip to content

Commit

Permalink
Merge pull request #1650 from nationalarchives/FCL-438/update-readme
Browse files Browse the repository at this point in the history
FCL-438 | add axe playwright automated accessibility testing informat…
  • Loading branch information
jlhdxw authored Nov 29, 2024
2 parents e0c9f31 + 55005bb commit 55ab6e9
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 55ab6e9

Please sign in to comment.