Skip to content

Commit aaa2fbc

Browse files
Merge branch 'main' of github.com:NHSDigital/bcss-playwright into feature/BCSS-21977-FOBTRegressionTests-scenario-13-updates
2 parents b6cc7a0 + 6db2c7f commit aaa2fbc

File tree

2 files changed

+759
-1
lines changed

2 files changed

+759
-1
lines changed

pages/screening_subject_search/handover_into_symptomatic_care_page.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
from playwright.sync_api import Page
22
from pages.base_page import BasePage
3-
from datetime import datetime
3+
44

55
class HandoverIntoSymptomaticCarePage(BasePage):
66
"""
77
HandoverIntoSymptomaticCarePage class for interacting with the 'Handover Into Symptomatic Care' page elements.
88
"""
9+
910
def __init__(self, page: Page):
1011
self.page = page
1112
self.referral_dropdown = self.page.get_by_label("Referral")
1213
self.calendar_button = self.page.get_by_role("button", name="Calendar")
1314
self.consultant_link = self.page.locator("#UI_NS_CONSULTANT_PIO_SELECT_LINK")
15+
self.practitioner_dropdown = self.page.locator("#UI_SCREENING_PRACTITIONER")
1416
self.notes_textbox = self.page.get_by_role("textbox", name="Notes")
1517
self.save_button = self.page.get_by_role("button", name="Save")
18+
self.cease_from_program_dropdown = self.page.locator(
19+
"#UI_CEASE_FROM_PROGRAM_ID"
20+
)
1621

1722
def select_referral_dropdown_option(self, value: str) -> None:
1823
"""
@@ -23,6 +28,14 @@ def select_referral_dropdown_option(self, value: str) -> None:
2328
"""
2429
self.referral_dropdown.select_option(value)
2530

31+
def select_practitioner_from_index(self, practitioner_index: int) -> None:
32+
"""
33+
Select the first option from the Practitioner dropdown.
34+
Args:
35+
practitioner_index (int): The index of the practitioner to select.
36+
"""
37+
self.practitioner_dropdown.select_option(index=practitioner_index)
38+
2639
def click_calendar_button(self) -> None:
2740
"""Click the calendar button to open the calendar picker."""
2841
self.click(self.calendar_button)
@@ -52,3 +65,13 @@ def fill_notes(self, notes: str) -> None:
5265
def click_save_button(self) -> None:
5366
"""Click the save button to save the changes."""
5467
self.safe_accept_dialog(self.save_button)
68+
69+
def select_cease_from_program(self, cease: bool) -> None:
70+
"""
71+
Select an option from the Cease from Program dropdown.
72+
73+
Args:
74+
cease (bool): True to cease from program, False otherwise
75+
"""
76+
value = "Yes" if cease else "No"
77+
self.cease_from_program_dropdown.select_option(value)

0 commit comments

Comments
 (0)