diff --git a/docs/utility-guides/Axe.md b/docs/utility-guides/Axe.md index 1417307..0c46a54 100644 --- a/docs/utility-guides/Axe.md +++ b/docs/utility-guides/Axe.md @@ -39,7 +39,7 @@ The `Axe.run(page)` has the following optional arguments that can be passed in: |Argument|Format|Supported Values|Default Value|Description| |--------|------|----------------|-------------|-----------| -|`ruleset` |`list[str]`|Any provided by [axe-core](https://www.deque.com/axe/core-documentation/api-documentation/)|`['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'best-practice']`|The tags that axe-core uses to filter specific checks. Defaulted to rules used for the WCAG 2.2 AA standard.| +|`ruleset` |`list[str]`|Any provided by [axe-core](https://www.deque.com/axe/core-documentation/api-documentation/)|`['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22a', 'wcag22aa', 'best-practice']`|The tags that axe-core uses to filter specific checks. Defaulted to rules used for the WCAG 2.2 AA standard.| |`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.| |`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.| |`strict_mode`|`bool`|`True`, `False`|`False`|If True, when a violation is found an AxeAccessibilityException is raised, causing a test failure.| diff --git a/tests/test_example.py b/tests/test_example.py index f4e1a79..faa5167 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -35,7 +35,7 @@ def test_basic_example(page: Page) -> None: # Assert repo text is present expect(page.get_by_role("article")).to_contain_text("Playwright Python Blueprint") - # Assert the page loaded is the playwright-python topic page + # Assert the page loaded contains a reference to the playwright-python topic page expect(page.get_by_role("main")).to_contain_text("playwright-python") diff --git a/utils/axe.py b/utils/axe.py index 4489ed1..e3c9de4 100644 --- a/utils/axe.py +++ b/utils/axe.py @@ -19,7 +19,7 @@ class Axe: @staticmethod def run(page: Page, filename: str = "", - ruleset: list = ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'best-practice'], + ruleset: list = ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22a', 'wcag22aa', 'best-practice'], report_on_violation_only: bool = False, strict_mode: bool = False, html_report_generated: bool = True, @@ -30,7 +30,7 @@ def run(page: Page, Args: page (playwright.sync_api.Page): The page object to execute axe-core against. filename (str): The filename to use for the outputted reports. If not provided, defaults to the URL under test. - ruleset (list[str]): [Optional] If provided, a list of strings to denote the ruleset tags axe-core should use. If not provided, defaults to the WCAG 2.2 AA standard (uses tags: 'wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'best-practice'). + ruleset (list[str]): [Optional] If provided, a list of strings to denote the ruleset tags axe-core should use. If not provided, defaults to the WCAG 2.2 AA standard (uses tags: 'wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22a', 'wcag22aa', 'best-practice'). report_on_violation_only (bool): [Optional] If true, only generates an Axe report if a violation is detected. If false (default), always generate a report. strict_mode (bool): [Optional] If true, raise an exception if a violation is detected. If false (default), proceed with test execution. html_report_generated (bool): [Optional] If true (default), generates a html report for the page scanned. If false, no html report is generated.