initial test axe-core

This commit is contained in:
Kenneth Kehl
2024-09-11 10:39:28 -07:00
parent 88c47d15f6
commit a91d6d25c8
3 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
import os
from axe_core_playwright import AxeBuilder
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")
axe = AxeBuilder(page)
results = axe.analyze()
assert (
len(results["violations"]) == 0
), f"Accessibility violations: {results['violations']}"