From 55005bb5132a39e478d254b230ab895c4fcf22cf Mon Sep 17 00:00:00 2001 From: James Harries Date: Fri, 29 Nov 2024 11:43:23 +0000 Subject: [PATCH] FCL-438 | add axe playwright automated accessibility testing information to the readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 639516bb0..0ce33e65c 100644 --- a/README.md +++ b/README.md @@ -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