Skip to content

Commit a7a1b95

Browse files
Completing scenario 11 of surveillance regression tests
1 parent 358f676 commit a7a1b95

File tree

3 files changed

+727
-0
lines changed

3 files changed

+727
-0
lines changed

pages/screening_subject_search/contact_with_patient_page.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pages.base_page import BasePage
33
from utils.calendar_picker import CalendarPicker
44
from datetime import datetime
5+
from typing import List
56

67

78
class ContactWithPatientPage(BasePage):
@@ -149,6 +150,21 @@ def record_contact(self, outcome: str, patient_contacted: str = "Yes") -> None:
149150
self.select_outcome_dropdown_option(outcome)
150151
self.click_save_button()
151152

153+
def outcome_dropdown_contains_options(self, options: List[str]) -> None:
154+
"""
155+
Asserts that all provided options are present in the Outcome of Diagnostic Test dropdown.
156+
157+
Args:
158+
options (List[str]): List of option strings to check.
159+
"""
160+
dropdown_options = [
161+
opt.inner_text() for opt in self.outcome_dropdown.locator("option").all()
162+
]
163+
for item in options:
164+
assert (
165+
item in dropdown_options
166+
), f"Dropdown is missing expected option: '{item}'"
167+
152168
def verify_contact_with_patient_page_is_displayed(self) -> None:
153169
"""Verify that the 'Contact With Patient' page is displayed."""
154170
expect(self.bowel_cancer_screening_ntsh_page_title).to_have_text(

pages/screening_subject_search/diagnostic_test_outcome_page.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ def test_outcome_dropdown_contains_options(self, options: List[str]) -> None:
8484
item in dropdown_options
8585
), f"Dropdown is missing expected option: '{item}'"
8686

87+
def reason_for_onward_referral_dropdown_contains_options(
88+
self, options: List[str]
89+
) -> None:
90+
"""
91+
Asserts that all provided options are present in the Outcome of Diagnostic Test dropdown.
92+
93+
Args:
94+
options (List[str]): List of option strings to check.
95+
"""
96+
dropdown_options = [
97+
opt.inner_text()
98+
for opt in self.reason_for_onward_referral_dropdown.locator("option").all()
99+
]
100+
for item in options:
101+
assert (
102+
item in dropdown_options
103+
), f"Dropdown is missing expected option: '{item}'"
104+
87105
def verify_reason_for_symptomatic_referral(self, symptomatic_reason: str) -> None:
88106
"""
89107
Verify reason for symptomatic referral is visible.

0 commit comments

Comments
 (0)