mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
initial test axe-core
This commit is contained in:
27
tests/end_to_end/test_a11y.py
Normal file
27
tests/end_to_end/test_a11y.py
Normal 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']}"
|
||||
Reference in New Issue
Block a user