From c3a2441ade200907a31c05768c3fc7cf23d7a69d Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 11 Sep 2024 12:57:10 -0700 Subject: [PATCH] try expanding use of axe --- tests/end_to_end/conftest.py | 5 ++--- tests/end_to_end/test_a11y.py | 22 ---------------------- 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 tests/end_to_end/test_a11y.py diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index cf52a88f0..f566b028c 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -113,6 +113,5 @@ def check_axe_report(page): results = axe.run(page) - assert ( - len(results["violations"]) == 0 - ), f"Accessibility violations: {results['violations']}" + for violation in results["violations"]: + assert(violation["impact"] != "minor", f"Accessibility violation: {violation}") diff --git a/tests/end_to_end/test_a11y.py b/tests/end_to_end/test_a11y.py deleted file mode 100644 index 2de01feab..000000000 --- a/tests/end_to_end/test_a11y.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -from tests.end_to_end.conftest import check_axe_report - -E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI") - - -def test_a11y(authenticated_page, end_to_end_context): - page = authenticated_page - - # Prepare for adding a new service later in the test. - # current_date_time = datetime.datetime.now() - # new_service_name = "E2E Federal Test Service {now} - {browser_type}".format( - # now=current_date_time.strftime("%m/%d/%Y %H:%M:%S"), - # browser_type=end_to_end_context.browser.browser_type.name, - # ) - - page.goto(f"{E2E_TEST_URI}/accounts") - - # Check to make sure that we've arrived at the next page. - page.wait_for_load_state("domcontentloaded") - check_axe_report(page)