Skip to content

Commit 0dccfdf

Browse files
Completing scenario 14
1 parent fe4a86e commit 0dccfdf

File tree

5 files changed

+938
-2
lines changed

5 files changed

+938
-2
lines changed

pages/screening_subject_search/contact_with_patient_page.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,18 @@ def verify_outcome_select_options(self, options: list) -> None:
186186
f"Missing expected dropdown values in the outcome options: {missing}."
187187
f"Actual options: {actual_options}"
188188
)
189+
190+
def patient_outcome_dropdown_contains_options(self, options: List[str]) -> None:
191+
"""
192+
Asserts that all provided options are present in the Patient Outcome dropdown.
193+
194+
Args:
195+
options (List[str]): List of option strings to check.
196+
"""
197+
dropdown_options = [
198+
opt.inner_text() for opt in self.outcome_dropdown.locator("option").all()
199+
]
200+
for item in options:
201+
assert (
202+
item in dropdown_options
203+
), f"Dropdown is missing expected option: '{item}'"

pages/screening_subject_search/diagnostic_test_outcome_page.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, page: Page):
3838
self.test_outcome_dropdown = self.page.get_by_label(
3939
"Outcome of Diagnostic Test"
4040
)
41-
self.reason_for_sympptomatic_referral_dropdown = self.page.get_by_label(
41+
self.reason_for_symptomatic_referral_dropdown = self.page.get_by_label(
4242
"Reason for Symptomatic Referral"
4343
)
4444
self.save_button = self.page.get_by_role("button", name="Save")
@@ -102,6 +102,26 @@ def reason_for_onward_referral_dropdown_contains_options(
102102
item in dropdown_options
103103
), f"Dropdown is missing expected option: '{item}'"
104104

105+
def reason_for_symptomatic_referral_dropdown_contains_options(
106+
self, options: List[str]
107+
) -> None:
108+
"""
109+
Asserts that all provided options are present in the Reason for Symptomatic Referral dropdown.
110+
111+
Args:
112+
options (List[str]): List of option strings to check.
113+
"""
114+
dropdown_options = [
115+
opt.inner_text()
116+
for opt in self.reason_for_symptomatic_referral_dropdown.locator(
117+
"option"
118+
).all()
119+
]
120+
for item in options:
121+
assert (
122+
item in dropdown_options
123+
), f"Dropdown is missing expected option: '{item}'"
124+
105125
def verify_reason_for_symptomatic_referral(self, symptomatic_reason: str) -> None:
106126
"""
107127
Verify reason for symptomatic referral is visible.
@@ -119,7 +139,7 @@ def select_reason_for_symptomatic_referral_option(self, option: str) -> None:
119139
Args:
120140
option (str): option (str): The option to select from the Reason For Symptomatic Referral options.
121141
"""
122-
self.reason_for_sympptomatic_referral_dropdown.select_option(option)
142+
self.reason_for_symptomatic_referral_dropdown.select_option(option)
123143

124144
def click_save_button(self) -> None:
125145
"""Click the 'Save' button."""

pages/screening_subject_search/subject_screening_summary_page.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def __init__(self, page: Page):
8787
self.postpone_surveillance_episode_button = self.page.get_by_role(
8888
"button", name="Postpone Surveillance Episode"
8989
)
90+
self.uncease_subject_button = self.page.get_by_role(
91+
"button", name="Uncease Subject"
92+
)
9093

9194
# List of Subject Episodes - page filters
9295
self.view_events_link = self.page.get_by_role("link", name="events")
@@ -510,6 +513,10 @@ def can_postpone_surveillance_episode(self, able_to_click: bool = True) -> None:
510513
else:
511514
expect(self.postpone_surveillance_episode_button).not_to_be_visible()
512515

516+
def click_uncease_subject_button(self) -> None:
517+
"""Click the 'Uncease Subject' button."""
518+
self.click(self.uncease_subject_button)
519+
513520

514521
class ChangeScreeningStatusOptions(StrEnum):
515522
"""Enum for Change Screening Status options."""
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from playwright.sync_api import Page
2+
from pages.base_page import BasePage
3+
4+
5+
class UnceaseAndInitiateOptinEpisodePage(BasePage):
6+
"""Uncease and Initiate Opt-in Episode Page locators, and methods for interacting with the page."""
7+
8+
def __init__(self, page: Page):
9+
super().__init__(page)
10+
self.page = page
11+
self.notes_field = self.page.locator("#UI_NOTES_TEXT")
12+
self.send_a_kit_button = self.page.get_by_role("button", name="Send a kit")
13+
14+
def enter_notes(self, notes: str) -> None:
15+
"""
16+
Enter notes into the 'Notes' field.
17+
Args:
18+
notes (str): The notes to enter into the field.
19+
"""
20+
self.notes_field.fill(notes)
21+
22+
def click_send_a_kit_button(self) -> None:
23+
"""
24+
Clicks the 'Send a kit' button.
25+
"""
26+
self.safe_accept_dialog(self.send_a_kit_button)
27+
28+
def manually_uncease_the_subject(self, action: str) -> None:
29+
"""
30+
Uncease the subject and take the specified action.
31+
Args:
32+
action (str): The action to take after unceasing the subject.
33+
"""
34+
self.enter_notes(
35+
f"Auto test scenario: manual unceasing test for age extension to {action}"
36+
)
37+
match action:
38+
case "send a new kit":
39+
self.click_send_a_kit_button()

0 commit comments

Comments
 (0)