https://pypi.org/project/axe-playwright-python/
How Slack use axe in playright:
- Playwright test lands on a page/view
- Axe analyzes the page
- Pre-defined exclusions are filtered out
- Violations and artifacts are saved to a file
It was important to make sure the same view wasn’t being analyzed twice in one test, or potentially twice across multiple tests with the same UI flow. Duplication like this would result in unnecessary error messages and saved artifacts, and slow down our tests. We were also careful to place our Axe calls only after the page or view had fully loaded and all content had rendered.
https://playwright.dev/python/docs/aria-snapshots
at some point they deprecated an older API and said just use Axe, there are some examples in this thread on why that didn't make sense microsoft/playwright#16159
https://playwright.dev/python/docs/api/class-keyboard
https://playwright.dev/docs/api/class-page#page-emulate-media