{"id":27299387,"url":"https://github.com/davethepunkyone/pytest-playwright-axe","last_synced_at":"2026-04-03T18:01:30.868Z","repository":{"id":285001039,"uuid":"950905392","full_name":"davethepunkyone/pytest-playwright-axe","owner":"davethepunkyone","description":"An axe-core integration for use with Playwright Python","archived":false,"fork":false,"pushed_at":"2026-03-11T19:52:19.000Z","size":706,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-12T00:51:23.902Z","etag":null,"topics":["accessibility","axe-core","playwright-python","pytest-playwright"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davethepunkyone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-18T21:32:31.000Z","updated_at":"2026-03-11T19:52:21.000Z","dependencies_parsed_at":"2025-05-03T13:20:50.231Z","dependency_job_id":"e7d09f22-db58-4228-8224-a3404b62607c","html_url":"https://github.com/davethepunkyone/pytest-playwright-axe","commit_stats":null,"previous_names":["davethepunkyone/pytest-playwright-axe"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/davethepunkyone/pytest-playwright-axe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davethepunkyone%2Fpytest-playwright-axe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davethepunkyone%2Fpytest-playwright-axe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davethepunkyone%2Fpytest-playwright-axe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davethepunkyone%2Fpytest-playwright-axe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davethepunkyone","download_url":"https://codeload.github.com/davethepunkyone/pytest-playwright-axe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davethepunkyone%2Fpytest-playwright-axe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31368156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility","axe-core","playwright-python","pytest-playwright"],"created_at":"2025-04-12T00:41:13.615Z","updated_at":"2026-04-03T18:01:30.801Z","avatar_url":"https://github.com/davethepunkyone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pytest Playwright Axe\n\n[![Build](https://github.com/davethepunkyone/pytest-playwright-axe/actions/workflows/build.yaml/badge.svg)](https://github.com/davethepunkyone/pytest-playwright-axe/actions/workflows/build.yaml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://img.shields.io/pypi/v/pytest-playwright-axe.svg)](https://pypi.org/project/pytest-playwright-axe/)\n\n`pytest-playwright-axe` is a package for Playwright Python that allows for the execution of [axe-core](https://github.com/dequelabs/axe-core), a JavaScript\nlibrary used for scanning for accessibility issues and providing guidance on how to resolve these issues.\n\n## Table of Contents\n\n- [Pytest Playwright Axe](#pytest-playwright-axe)\n  - [Table of Contents](#table-of-contents)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Instantiating the Axe class](#instantiating-the-axe-class)\n    - [Optional arguments](#optional-arguments)\n  - [.run(): Single page scan](#run-single-page-scan)\n    - [Required arguments](#required-arguments)\n    - [Optional arguments](#optional-arguments-1)\n    - [Returns](#returns)\n    - [Example usage](#example-usage)\n  - [.run\\_list(): Multiple page scan](#run_list-multiple-page-scan)\n    - [Required arguments](#required-arguments-1)\n      - [`page_list dict` Structure](#page_list-dict-structure)\n    - [Optional arguments](#optional-arguments-2)\n    - [Returns](#returns-1)\n    - [Example usage](#example-usage-1)\n  - [.get\\_rules(): Return rules](#get_rules-return-rules)\n    - [Required Arguments](#required-arguments-2)\n    - [Optional Arguments](#optional-arguments-3)\n    - [Returns](#returns-2)\n    - [Example usage](#example-usage-2)\n  - [Rulesets](#rulesets)\n  - [Working With Snapshots](#working-with-snapshots)\n    - [Example Snapshot Usage](#example-snapshot-usage)\n  - [Example Reports](#example-reports)\n  - [Versioning](#versioning)\n  - [Breaking Changes](#breaking-changes)\n    - [4.10.3 -\\\u003e Onwards](#4103---onwards)\n  - [Licence](#licence)\n  - [Acknowledgements](#acknowledgements)\n\n## Prerequisites\n\nThis package has the following requirements for use:\n\n- [Python 3.12](https://www.python.org/downloads/) or greater\n- [`pytest-playwright`](https://pypi.org/project/pytest-playwright/) 0.5.1 or greater\n\n## Installation\n\nThis package is available via PyPi (https://pypi.org/project/pytest-playwright-axe/), so can be installed by running the following\ncommand:\n\n```shell\npip install pytest-playwright-axe\n```\n\n## Instantiating the Axe class\n\nYou can initialise the Axe class by using the following code in your test file:\n\n```python\nfrom pytest_playwright_axe import Axe\n```\n\nYou can run the Axe instance either as a standalone instance or instantiate it as follows:\n\n```python\n# Standalone execution\nAxe().run(page)\n\n# Instantiated execution\naxe = Axe()\naxe.run(page)\n```\n\n### Optional arguments\n\nThe `Axe()` class has the following optional arguments that can be passed in:\n\n| Argument             | Format                  | Supported Values                                                        | Default Value | Description                                                                                                                                   |\n| -------------------- | ----------------------- | ----------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| `output_directory`   | `pathlib.Path` or `str` | A valid directory path to save results to (e.g. `C:/axe_reports`)       |               | If provided, sets the directory to save HTML and JSON results into. If not provided (default), the default path is `os.getcwd()/axe-reports`. |\n| `css_override`       | `str`                   | A string with valid CSS.                                                |               | If provided, this will override the default CSS used in the HTML report with the CSS styling provided.                                        |\n| `use_minified_file`  | `bool`                  | `True`, `False`                                                         | `False`       | If True, use the minified version of axe-core (axe.min.js). If not provided (default), use the full version of axe-core (axe.js).             |\n| `snapshot_directory` | `pathlib.Path` or `str` | A valid directory path where snapshots are stored (e.g. `C:/snapshots`) |               | If provided, sets the directory to check for JSON outputs from previous runs to compare against.                                              |\n\n\n## .run(): Single page scan\n\nTo conduct a scan, you can just use the following once the page you want to check is at the right location:\n\n```python\nAxe().run(page)\n```\n\nThis will inject the axe-core code into the page and then execute the axe.run() command, generating an accessibility report for the page being tested.\n\nBy default, the `Axe().run(page)` command will do the following:\n\n- Scan the page passed in with the default axe-core configuration\n- Generate a HTML and JSON report with the findings in the `axe-reports` directory, regardless of if any violations are found\n- Any steps after the `Axe().run()` command will continue to execute, and it will not cause the test in progress to fail (it runs a passive scan of the page)\n- Will return the full response from axe-core as a dict object if the call is set to a variable, e.g. `axe_results = Axe().run(page)` will populate `axe_results` to interact with as required\n\nThis uses the [axe-core run method outlined in the axe-core documentation](https://www.deque.com/axe/core-documentation/api-documentation/#api-name-axerun).\n\n### Required arguments\n\nThe following are required for `Axe().run()`:\n\n| Argument | Format                   | Description                                  |\n| -------- | ------------------------ | -------------------------------------------- |\n| page     | playwright.sync_api.Page | A Playwright Page on the page to be checked. |\n\n### Optional arguments\n\nThe `Axe().run(page)` has the following optional arguments that can be passed in:\n\n| Argument                   | Format | Supported Values                                                                                                  | Default Value | Description                                                                                                                                                                                                                                                             |\n| -------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `filename`                 | `str`  | A string valid for a filename (e.g. `test_report`)                                                                |               | If provided, HTML and JSON reports will save with the filename provided. If not provided (default), the URL of the page under test will be used as the filename.                                                                                                        |\n| `context`                  | `str`  | A JavaScript object, represented as a string (e.g. `{ exclude: '.ad-banner' }`)                                   |               | If provided, adds the [context that axe-core should use](https://www.deque.com/axe/core-documentation/api-documentation/?_gl=1*nt1pxm*_up*MQ..*_ga*Mjc3MzY4NDQ5LjE3NDMxMDMyMDc.*_ga_C9H6VN9QY1*MTc0MzEwMzIwNi4xLjAuMTc0MzEwMzIwNi4wLjAuODE0MjQyMzA2#context-parameter). |\n| `options`                  | `str`  | A JavaScript object, represented as a string (e.g. `{ runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa'] } }`) |               | If provided, adds the [options that axe-core should use](https://www.deque.com/axe/core-documentation/api-documentation/?_gl=1*nt1pxm*_up*MQ..*_ga*Mjc3MzY4NDQ5LjE3NDMxMDMyMDc.*_ga_C9H6VN9QY1*MTc0MzEwMzIwNi4xLjAuMTc0MzEwMzIwNi4wLjAuODE0MjQyMzA2#options-parameter). |\n| `report_on_violation_only` | `bool` | `True`, `False`                                                                                                   | `False`       | If True, HTML and JSON reports will only be generated if at least one violation is found.                                                                                                                                                                               |\n| `strict_mode`              | `bool` | `True`, `False`                                                                                                   | `False`       | If True, when a violation is found an AxeAccessibilityException is raised, causing a test failure.                                                                                                                                                                      |\n| `html_report_generated`    | `bool` | `True`, `False`                                                                                                   | `True`        | If True, a HTML report will be generated summarising the axe-core findings.                                                                                                                                                                                             |\n| `json_report_generated`    | `bool` | `True`, `False`                                                                                                   | `True`        | If True, a JSON report will be generated with the full axe-core findings.                                                                                                                                                                                               |\n\n### Returns\n\nThis function can be used independently, but when set to a variable returns a `dict` with the axe-core results.\n\n### Example usage\n\nA default execution with no arguments:\n\n```python\nfrom pytest_playwright_axe import Axe\nfrom playwright.sync_api import Page\n\ndef test_axe_example(page: Page) -\u003e None:\n    page.goto(\"https://github.com/davethepunkyone/pytest-playwright-axe\")\n    Axe().run(page)\n```\n\nA WCAG 2.2 (AA) execution, with a custom filename, strict mode enabled and only HTML output provided:\n\n```python\nfrom pytest_playwright_axe import Axe\nfrom playwright.sync_api import Page\n\ndef test_axe_example(page: Page) -\u003e None:\n    page.goto(\"https://github.com/davethepunkyone/pytest-playwright-axe\")\n    Axe().run(page, \n              filename=\"test_report\",\n              options=\"{runOnly: {type: 'tag', values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22a', 'wcag22aa', 'best-practice']}}\",\n              strict_mode=True,\n              json_report_generated=False)\n```\n\n## .run_list(): Multiple page scan\n\nTo scan multiple URLs within your application, you can use the following method:\n\n```python\nAxe().run_list(page, page_list)\n```\n\nThis runs the `Axe().run(page)` function noted above against each URL provided in the `page_list` argument, and will generate reports as required. This navigates by using the Playwright Page's `.goto()` method, so this only works for pages that can be directly accessed.\n\n### Required arguments\n\nThe following are required for `Axe().run_list()`:\n\n| Argument  | Format                       | Description                                                                                                                                                                                                 |\n| --------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| page      | `playwright.sync_api.Page`   | A Playwright Page object to drive navigation to each page to test.                                                                                                                                          |\n| page_list | `list[` `str` or  `dict` `]` | A list of URLs to execute against (e.g. `[\"home\", \"profile\", \"product/test\"]`). If a dict is provided, basic actions and assertions can be conducted as part of the list prior to the scan being conducted. |\n\n\u003e NOTE: It is heavily recommended that when using the `run_list` command, that you set a `--base-url` either via the pytest.ini file or by passing in the value when using the `pytest` command in the command line. By doing this, the list you pass in will not need to contain the base URL value and therefore make any scanning transferrable between environments.\n\n#### `page_list dict` Structure\n\nThe `page_list` supports providing a list made up of `str` format urls (that will just navigate to the page and scan) and providing\na `dict`, whereby a basic action can be provided along with a basic assertion (to prove the action completed successfully) before the\nscan is undertaken.\n\nIf a dict is provided as part of the `page_list`, the following key / value pairs can be provided:\n\n| Key              | Required                                                                    | Format                        | Allowed Values                                                                             | Description                                                                                                                   |\n| ---------------- | --------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |\n| `url`            | Yes                                                                         | `str`                         |                                                                                            | The url to initially navigate to.                                                                                             |\n| `action`         | Yes                                                                         | `str`                         | `click`, `dblclick`, `hover`, `fill`, `type`, `select_option`                              | The action to undertake to get to the desired page state.                                                                     |\n| `locator`        | Yes                                                                         | `playwright.sync_api.Locator` |                                                                                            | The locator to perform the action against.                                                                                    |\n| `value`          | No (Yes if action is one of: `fill`, `type`, `select_option`)               | `str`                         |                                                                                            | The value to use for the action, when a value is required.                                                                    |\n| `assert_type`    | No (Yes if assertion required)                                              | `str`                         | `to_be_visible`, `to_be_hidden`, `to_be_enabled`, `to_contain_text`, `to_not_contain_text` | If conducting an assertion, the type of assertion to complete.                                                                |\n| `assert_locator` | No (Yes if assertion required)                                              | `playwright.sync_api.Locator` |                                                                                            | The locator to perform the assertion against.                                                                                 |\n| `assert_value`   | No (Yes if assert_type is one of: `to_contain_text`, `to_not_contain_text`) | `str`                         |                                                                                            | The value to use for the assertion, when a value is required.                                                                 |\n| `wait_time`      | No                                                                          | `int`                         |                                                                                            | If provided, the amount of time to wait after completing the defined action and assertion in milliseconds before running Axe. |\n\n\u003e NOTE: This format has been provided to allow for basic actions to be completed whilst using the `run_list()` method if checking\n\u003e multiple pages in succession, but is not designed to replace comprehensive testing. If you need to do anything more complex than\n\u003e a single basic action, it is recommended that you write a test that does the actions first and then use the `run()` method instead.\n\n### Optional arguments\n\nThe `Axe().run_list(page, page_list)` function has the following optional arguments that can be passed in:\n\n| Argument                   | Format | Supported Values                                                                                                  | Default Value | Description                                                                                                                                                                                                                                                             |\n| -------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `use_list_for_filename`    | `bool` | `True`, `False`                                                                                                   | `True`        | If True, the filename will be derived from the value provided in the list. If False, the full URL will be used.                                                                                                                                                         |\n| `context`                  | `str`  | A JavaScript object, represented as a string (e.g. `{ exclude: '.ad-banner' }`)                                   |               | If provided, adds the [context that axe-core should use](https://www.deque.com/axe/core-documentation/api-documentation/?_gl=1*nt1pxm*_up*MQ..*_ga*Mjc3MzY4NDQ5LjE3NDMxMDMyMDc.*_ga_C9H6VN9QY1*MTc0MzEwMzIwNi4xLjAuMTc0MzEwMzIwNi4wLjAuODE0MjQyMzA2#context-parameter). |\n| `options`                  | `str`  | A JavaScript object, represented as a string (e.g. `{ runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa'] } }`) |               | If provided, adds the [options that axe-core should use](https://www.deque.com/axe/core-documentation/api-documentation/?_gl=1*nt1pxm*_up*MQ..*_ga*Mjc3MzY4NDQ5LjE3NDMxMDMyMDc.*_ga_C9H6VN9QY1*MTc0MzEwMzIwNi4xLjAuMTc0MzEwMzIwNi4wLjAuODE0MjQyMzA2#options-parameter). |\n| `report_on_violation_only` | `bool` | `True`, `False`                                                                                                   | `False`       | If True, HTML and JSON reports will only be generated if at least one violation is found.                                                                                                                                                                               |\n| `strict_mode`              | `bool` | `True`, `False`                                                                                                   | `False`       | If True, when a violation is found an AxeAccessibilityException is raised, causing a test failure.                                                                                                                                                                      |\n| `html_report_generated`    | `bool` | `True`, `False`                                                                                                   | `True`        | If True, a HTML report will be generated summarising the axe-core findings.                                                                                                                                                                                             |\n| `json_report_generated`    | `bool` | `True`, `False`                                                                                                   | `True`        | If True, a JSON report will be generated with the full axe-core findings.                                                                                                                                                                                               |\n\n### Returns\n\nThis function can be used independently, but when set to a variable returns a `dict` with the axe-core results for all pages scanned (using the URL value in the list provided as the key).\n\n### Example usage\n\nWhen using the following command: `pytest --base-url https://www.github.com`:\n\n```python\nfrom pytest_playwright_axe import Axe\nfrom playwright.sync_api import Page\n\ndef test_accessibility(page: Page) -\u003e None:\n    # A list of URLs to loop through\n    urls_to_check = [\n        \"davethepunkyone/pytest-playwright-axe\",\n        \"davethepunkyone/pytest-playwright-axe/issues\",\n        {\n            \"url\": \"https://github.com/davethepunkyone/pytest-playwright-axe\",\n            \"action\": \"click\", \n            \"locator\": page.get_by_test_id(\"anchor-button\"), \n            \"assert_type\": \"to_contain_text\", \n            \"assert_locator\": page.get_by_test_id(\"overlay-content\"),\n            \"assert_value\": \"rework-axe-to-include-init\",\n            \"wait_time\": 1000\n        }\n      ]\n\n    Axe().run_list(page, urls_to_check)\n```\n\n## .get_rules(): Return rules\n\nYou can get the rules used for specific tags by using this method, or all rules if no ruleset is provided.\n\nThis uses the [axe-core getRules method outlined in the axe-core documentation](https://www.deque.com/axe/core-documentation/api-documentation/#api-name-axegetrules).\n\n### Required Arguments\n\nThe following are required for `Axe().get_rules()`:\n\n| Argument | Format                     | Description                                              |\n| -------- | -------------------------- | -------------------------------------------------------- |\n| page     | `playwright.sync_api.Page` | A Playwright Page object.. This page can be empty/blank. |\n\n### Optional Arguments\n\nThe `Axe().get_rules(page, page_list)` function has the following optional arguments that can be passed in:\n\n| Argument | Format      | Supported Values                                                                                                                    | Default Value | Description                                                                                               |\n| -------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------- |\n| `rules`  | `list[str]` | A Python list with strings representing [valid tags](https://www.deque.com/axe/core-documentation/api-documentation/#axecore-tags). | `None`        | If provided, the list of rules to provide information on.  If not provided, return details for all rules. |\n\n### Returns\n\nA Python `list[dict]` object with all matching rules and their descriptors.\n\n### Example usage\n\n```python\nimport logging\nfrom pytest_playwright_axe import Axe\nfrom playwright.sync_api import Page\n\ndef test_get_rules(page: Page) -\u003e None:\n\n    rules = Axe().get_rules(page, ['wcag21aa'])\n    for rule in rules:\n        logging.info(rule)\n```\n\n## Rulesets\n\nThe following rulesets can also be imported via the `pytest_playwright_axe` module:\n\n| Ruleset     | Import              | Rules Applied                                                                          |\n| ----------- | ------------------- | -------------------------------------------------------------------------------------- |\n| WCAG 2.2 AA | `OPTIONS_WCAG_22AA` | `['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22a', 'wcag22aa', 'best-practice']` |\n\nExample:\n\n```python\nfrom pytest_playwright_axe import Axe, OPTIONS_WCAG_22AA\nfrom playwright.sync_api import Page\n\ndef test_axe_example(page: Page) -\u003e None:\n    page.goto(\"https://github.com/davethepunkyone/pytest-playwright-axe\")\n    Axe().run(page, options=OPTIONS_WCAG_22AA)\n```\n\n## Working With Snapshots\n\nFrom release 4.11.0.post1, this package provides the ability to compare to a\nprevious scan of the page and highlight changes between then and now.\nScans are conducted against the JSON output of a previous run, so to use this\nfunctionality you will need to ensure you save JSON files as part of your outputs.\n\nIf any changes are detected and snapshot scanning is enabled, a new section will\nbe populated at the start of the HTML report that outlines the detected changes, as\nshown in the screenshot below.\n\n![An image of the Changes Since Last Scan section, displayed as the first section of the HTML report and showing a new and a resolved violation](https://raw.githubusercontent.com/davethepunkyone/pytest-playwright-axe/main/examples/changes_since_last_scan_example.png)\n\nWhen working with snapshots, the following needs to be considered:\n\n- Snapshots are detected from the designated snapshot directory based on the expected filename, so to use this logic the URLs under test will need to be consistent.\n- The comparison output is only presented on the HTML version of the report.\n\n### Example Snapshot Usage\n\n**1 - Get Initial Snapshot**\n\nAn initial scan of the page is conducted, with JSON output enabled.\n\nFor the purposes of this example, the following test is located in the\n`tests/accessibility` directory in `tests_accessibility.py`:\n\n```python\nfrom playwright.sync_api import Page\nfrom pytest_playwright_axe import Axe\n\ndef test_axe_example(page: Page) -\u003e None:\n    page.goto(\"https://github.com/davethepunkyone/pytest-playwright-axe\")\n    Axe().run(page)\n```\n\nThis generates the following output in the `axe-reports` directory:\n\n    axe-reports/\n      |- github_com_davethepunkyone_pytest-playwright-axe.html\n      |- github_com_davethepunkyone_pytest-playwright-axe.json\n\nThe `.json` file should then be copied into an appropriate directory to be\nreferenced later (e.g. `tests/accessibility/snapshots`).\n\nThis should then result in a file structure like so:\n\n    axe-reports/\n      |- github_com_davethepunkyone_pytest-playwright-axe.html\n      |- github_com_davethepunkyone_pytest-playwright-axe.json\n    tests/\n      |- accessibility/\n      |  |- snapshots/\n      |  |  |- github_com_davethepunkyone_pytest-playwright-axe.json\n      |  |- tests_accessibility.py\n\n**2 - Compare Snapshots**\n\nTo allow for the snapshot comparison, the test needs to be amended to check\nfor available snapshots, by adding the `snapshot_directory=\u003cpath\u003e` to the\ninitialised Axe instance.\n\nUsing our example above, we would modify the existing test as follows:\n\n```python\nfrom playwright.sync_api import Page\nfrom pytest_playwright_axe import Axe\nfrom pathlib import Path\n\n# Reference the snapshot directory\nSNAPSHOT_DIRECTORY = Path(__file__).parent.joinpath(\"snapshots\")\n\ndef test_axe_example(page: Page) -\u003e None:\n    page.goto(\"https://github.com/davethepunkyone/pytest-playwright-axe\")\n    # Initialise Axe referencing the snapshot directory\n    Axe(snapshot_directory=SNAPSHOT_DIRECTORY).run(page)\n```\n\nWith this change in place, the test will now check the `snapshots` directory\nand as this will generate a JSON file matching the one we have added, it will\nload the JSON file from `snapshots/github_com_davethepunkyone_pytest-playwright-axe.json`\nand check for changes between the two files, outputting the results in a new\nsection on the HTML report.\n\n\n## Example Reports\n\nThe following are examples of the reports generated using this package:\n\n| Format                                 | Example                                                                                                                |\n| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |\n| HTML (Use download file to see report) | [Example File](https://github.com/davethepunkyone/pytest-playwright-axe/tree/main/examples/example_result_report.html) |\n| JSON                                   | [Example File](https://github.com/davethepunkyone/pytest-playwright-axe/tree/main/examples/example_result_report.json) |\n\n## Versioning\n\nThe versioning for this project is designed to be directly linked to the releases from \nthe [axe-core](https://github.com/dequelabs/axe-core) project, to accurately reflect the\nversion of axe-core that is being executed.\n\n## Breaking Changes\n\nThe following section outlines important breaking changes between version, due to the\nversioning of this project being aligned with axe-core.\n\n### 4.10.3 -\u003e Onwards\n\nThe following significant changes have been applied for releases after 4.10.3, which\nwould require amending existing logic:\n\n- The `Axe()` module logic is no longer static, so using `Axe.run()` will no longer work.\n- `output_directory` has now been moved into the `__init__` method for `Axe`, and is no longer defined in the `.run()` and `run_list()` functions.\n\n## Licence\n\nUnless stated otherwise, the codebase is released under the\n[MIT Licence](LICENCE.md) (note the UK spelling for the filename).\nThis covers both the codebase and any sample code in the documentation.\n\n## Acknowledgements\n\nThis package was created based on work initially designed for the \n[NHS England Playwright Python Blueprint](https://github.com/nhs-england-tools/playwright-python-blueprint).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavethepunkyone%2Fpytest-playwright-axe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavethepunkyone%2Fpytest-playwright-axe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavethepunkyone%2Fpytest-playwright-axe/lists"}