11from playwright .sync_api import Page
22from pages .base_page import BasePage
3- from datetime import datetime
3+
44
55class 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,10 @@ def select_referral_dropdown_option(self, value: str) -> None:
2328 """
2429 self .referral_dropdown .select_option (value )
2530
31+ def select_first_practitioner (self ) -> None :
32+ """Select the first option from the Practitioner dropdown."""
33+ self .practitioner_dropdown .select_option (index = 1 )
34+
2635 def click_calendar_button (self ) -> None :
2736 """Click the calendar button to open the calendar picker."""
2837 self .click (self .calendar_button )
@@ -52,3 +61,13 @@ def fill_notes(self, notes: str) -> None:
5261 def click_save_button (self ) -> None :
5362 """Click the save button to save the changes."""
5463 self .safe_accept_dialog (self .save_button )
64+
65+ def select_cease_from_program (self , cease : bool ) -> None :
66+ """
67+ Select an option from the Cease from Program dropdown.
68+
69+ Args:
70+ cease (bool): True to cease from program, False otherwise
71+ """
72+ value = "Yes" if cease else "No"
73+ self .cease_from_program_dropdown .select_option (value )
0 commit comments