expand to all tests

This commit is contained in:
Kenneth Kehl
2024-09-11 13:08:50 -07:00
parent c3a2441ade
commit f82bcb0509
4 changed files with 30 additions and 1 deletions

View File

@@ -114,4 +114,4 @@ def check_axe_report(page):
results = axe.run(page)
for violation in results["violations"]:
assert(violation["impact"] != "minor", f"Accessibility violation: {violation}")
assert violation["impact"] != "minor", f"Accessibility violation: {violation}"

View File

@@ -4,6 +4,8 @@ import re
from playwright.sync_api import expect
from tests.end_to_end.conftest import check_axe_report
E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
@@ -85,6 +87,7 @@ def test_invite_team_member_to_service(authenticated_page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# Check to make sure team members link is on left nav.
team_members_link = page.get_by_text("Team members")
@@ -101,6 +104,7 @@ def test_invite_team_member_to_service(authenticated_page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# Fill and check email address value.
email_address_input = page.get_by_label("Email address")
@@ -154,11 +158,13 @@ def _teardown(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
page.click("text='Delete this service'")
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
page.click("text='Yes, delete'")

View File

@@ -2,6 +2,7 @@ import os
import re
from playwright.sync_api import expect
from tests.end_to_end.conftest import check_axe_report
E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
@@ -13,6 +14,7 @@ def test_landing_page(end_to_end_context):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# Check the page title exists and matches what we expect.
expect(page).to_have_title(re.compile("Notify.gov"))

View File

@@ -5,6 +5,8 @@ import uuid
from playwright.sync_api import expect
from tests.end_to_end.conftest import check_axe_report
E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
@@ -17,6 +19,7 @@ def _setup(page):
)
page.goto(f"{E2E_TEST_URI}/accounts")
check_axe_report(page)
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
@@ -48,6 +51,7 @@ def _setup(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# Check for the sign in heading.
about_heading = page.get_by_role("heading", name="About your service")
@@ -95,6 +99,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
new_template_button = page.get_by_text("New template")
expect(new_template_button).to_be_visible()
@@ -102,6 +107,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
start_with_a_blank_template_radio = page.get_by_text("Start with a blank template")
expect(start_with_a_blank_template_radio).to_be_visible()
@@ -115,6 +121,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
template_name_input = page.get_by_text("Template name")
expect(template_name_input).to_be_visible()
@@ -131,6 +138,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
use_this_template_button = page.get_by_text("Use this template")
expect(use_this_template_button).to_be_visible()
@@ -138,6 +146,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
use_my_phone_number_link = page.get_by_text("Use my phone number")
expect(use_my_phone_number_link).to_be_visible()
@@ -145,6 +154,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
preview_button = page.get_by_text("Preview")
expect(preview_button).to_be_visible()
@@ -152,6 +162,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
send_button = page.get_by_role("button", name="Send")
expect(send_button).to_be_visible()
@@ -159,6 +170,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
dashboard_button = page.get_by_text("Dashboard")
expect(dashboard_button).to_be_visible()
@@ -166,6 +178,7 @@ def handle_no_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
download_link = page.get_by_text("Download")
expect(download_link).to_be_visible()
@@ -211,6 +224,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
continue_button = page.get_by_role("button", name="Continue")
@@ -220,6 +234,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
continue_button = page.get_by_role("button", name="Continue")
@@ -229,6 +244,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# day_of_week_input = page.locator('xpath=//input[@name="day of week"]')
# day_of_week_input = page.get_by_text("day of week")
@@ -244,6 +260,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
color_input = page.get_by_role("textbox", name="color")
expect(color_input).to_be_visible()
@@ -255,6 +272,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
if "/tour" not in page.url:
# Only execute this part if the current page is not the /tour page
@@ -264,6 +282,7 @@ def handle_existing_template_case(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
send_button = page.get_by_role("button", name="Send")
expect(send_button).to_be_visible()
@@ -325,6 +344,7 @@ def _teardown(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
page.click("text='Delete this service'")
@@ -335,6 +355,7 @@ def _teardown(page):
# Check to make sure that we've arrived at the next page.
page.wait_for_load_state("domcontentloaded")
check_axe_report(page)
# Check to make sure that we've arrived at the next page.
# Check the page title exists and matches what we expect.