diff --git a/.ds.baseline b/.ds.baseline index 485ff9443..9e0baeb8e 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -629,10 +629,10 @@ "filename": "tests/conftest.py", "hashed_secret": "f8377c90fcfd699f0ddbdcb30c2c9183d2d933ea", "is_verified": false, - "line_number": 3279, + "line_number": 3287, "is_secret": false } ] }, - "generated_at": "2025-08-07T18:05:06Z" + "generated_at": "2025-08-21T16:06:57Z" } diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index a97eec4f6..930e4afa3 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -20,13 +20,14 @@ def test_non_logged_in_user_can_see_homepage( assert heading in [ "Reach people where they are with government-powered text messages", "There's currently a technical issue.", + "Sunsetting Notify.gov", ] button = page.select_one( "a.usa-button.login-button.login-button--primary.margin-right-2" ) - if heading == "There's currently a technical issue.": + if heading in ["There's currently a technical issue.", "Sunsetting Notify.gov"]: assert button is None else: assert button is not None diff --git a/tests/conftest.py b/tests/conftest.py index 2174cc4b7..7aac7220b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,6 +12,7 @@ from bs4 import BeautifulSoup from dotenv import load_dotenv from flask import Flask, url_for +import app.utils.api_health from app import create_app from app.enums import AuthType, ServicePermission from notifications_python_client.errors import HTTPError @@ -35,6 +36,13 @@ from . import ( user_json, ) +# Mock is_api_down to prevent network calls during unit tests +# Set API_HOST_NAME to localhost to avoid network timeouts (sometimes they slow down in cicd) +os.environ["API_HOST_NAME"] = "http://localhost:6011" + +# Also mock the function itself as a backup +app.utils.api_health.is_api_down = lambda: False + load_dotenv() diff --git a/tests/end_to_end/test_create_new_template.py b/tests/end_to_end/test_create_new_template.py index 07c9ba2be..cb2feec81 100644 --- a/tests/end_to_end/test_create_new_template.py +++ b/tests/end_to_end/test_create_new_template.py @@ -52,7 +52,7 @@ def create_new_template(page): page.wait_for_load_state("domcontentloaded") check_axe_report(page) - template_name_input = page.get_by_text("Template name") + template_name_input = page.get_by_label("Template name") expect(template_name_input).to_be_visible() template_name = str(uuid.uuid4()) template_name_input.fill(template_name) diff --git a/tests/end_to_end/test_send_message_from_existing_template.py b/tests/end_to_end/test_send_message_from_existing_template.py index 906e41906..37cf9e208 100644 --- a/tests/end_to_end/test_send_message_from_existing_template.py +++ b/tests/end_to_end/test_send_message_from_existing_template.py @@ -126,7 +126,7 @@ def handle_no_existing_template_case(page): page.wait_for_load_state("domcontentloaded") check_axe_report(page) - template_name_input = page.get_by_text("Template name") + template_name_input = page.get_by_label("Template name") expect(template_name_input).to_be_visible() template_name = str(uuid.uuid4()) template_name_input.fill(template_name)