Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pages/screening_subject_search/contact_with_patient_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,18 @@ def verify_outcome_select_options(self, options: list) -> None:
f"Missing expected dropdown values in the outcome options: {missing}."
f"Actual options: {actual_options}"
)

def patient_outcome_dropdown_contains_options(self, options: List[str]) -> None:
"""
Asserts that all provided options are present in the Patient Outcome dropdown.

Args:
options (List[str]): List of option strings to check.
"""
dropdown_options = [
opt.inner_text() for opt in self.outcome_dropdown.locator("option").all()
]
for item in options:
assert (
item in dropdown_options
), f"Dropdown is missing expected option: '{item}'"
24 changes: 22 additions & 2 deletions pages/screening_subject_search/diagnostic_test_outcome_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, page: Page):
self.test_outcome_dropdown = self.page.get_by_label(
"Outcome of Diagnostic Test"
)
self.reason_for_sympptomatic_referral_dropdown = self.page.get_by_label(
self.reason_for_symptomatic_referral_dropdown = self.page.get_by_label(
"Reason for Symptomatic Referral"
)
self.save_button = self.page.get_by_role("button", name="Save")
Expand Down Expand Up @@ -102,6 +102,26 @@ def reason_for_onward_referral_dropdown_contains_options(
item in dropdown_options
), f"Dropdown is missing expected option: '{item}'"

def reason_for_symptomatic_referral_dropdown_contains_options(
self, options: List[str]
) -> None:
"""
Asserts that all provided options are present in the Reason for Symptomatic Referral dropdown.

Args:
options (List[str]): List of option strings to check.
"""
dropdown_options = [
opt.inner_text()
for opt in self.reason_for_symptomatic_referral_dropdown.locator(
"option"
).all()
]
for item in options:
assert (
item in dropdown_options
), f"Dropdown is missing expected option: '{item}'"

def verify_reason_for_symptomatic_referral(self, symptomatic_reason: str) -> None:
"""
Verify reason for symptomatic referral is visible.
Expand All @@ -119,7 +139,7 @@ def select_reason_for_symptomatic_referral_option(self, option: str) -> None:
Args:
option (str): option (str): The option to select from the Reason For Symptomatic Referral options.
"""
self.reason_for_sympptomatic_referral_dropdown.select_option(option)
self.reason_for_symptomatic_referral_dropdown.select_option(option)

def click_save_button(self) -> None:
"""Click the 'Save' button."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def __init__(self, page: Page):
self.postpone_surveillance_episode_button = self.page.get_by_role(
"button", name="Postpone Surveillance Episode"
)
self.uncease_subject_button = self.page.get_by_role(
"button", name="Uncease Subject"
)

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

def click_uncease_subject_button(self) -> None:
"""Click the 'Uncease Subject' button."""
self.click(self.uncease_subject_button)


class ChangeScreeningStatusOptions(StrEnum):
"""Enum for Change Screening Status options."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from playwright.sync_api import Page
from pages.base_page import BasePage


class UnceaseAndInitiateOptinEpisodePage(BasePage):
"""Uncease and Initiate Opt-in Episode Page locators, and methods for interacting with the page."""

def __init__(self, page: Page):
super().__init__(page)
self.page = page
self.notes_field = self.page.locator("#UI_NOTES_TEXT")
self.send_a_kit_button = self.page.get_by_role("button", name="Send a kit")

def enter_notes(self, notes: str) -> None:
"""
Enter notes into the 'Notes' field.
Args:
notes (str): The notes to enter into the field.
"""
self.notes_field.fill(notes)

def click_send_a_kit_button(self) -> None:
"""
Clicks the 'Send a kit' button.
"""
self.safe_accept_dialog(self.send_a_kit_button)

def manually_uncease_the_subject(self, action: str) -> None:
"""
Uncease the subject and take the specified action.
Args:
action (str): The action to take after unceasing the subject.
"""
self.enter_notes(
f"Auto test scenario: manual unceasing test for age extension to {action}"
)
match action:
case "send a new kit":
self.click_send_a_kit_button()
Loading