44from pages .base_page import BasePage
55
66
7- class ManualCeasePage :
7+ class ManualCeasePage ( BasePage ) :
88 """This class contains locators to interact with the manual cease page."""
99
1010 def __init__ (self , page : Page ):
@@ -27,46 +27,69 @@ def __init__(self, page: Page):
2727 )
2828 self .notes_field = page .get_by_label ("Notes" )
2929
30- def click_request_cease (self ):
31- self .request_cease_button .click ()
30+ def click_request_cease (self ) -> None :
31+ """Clicks the 'Request Cease' button."""
32+ self .click (self .request_cease_button )
3233
33- def select_cease_reason (self , reason : str ):
34+ def select_cease_reason (self , reason : str ) -> None :
35+ """Selects a given cease reason from the dropdown.
36+ Args:
37+ reason (str): The reason to select from the dropdown.
38+ """
3439 self .cease_reason_dropdown .select_option (label = reason )
3540
36- def click_save_request_cease (self ):
37- self .save_request_cease_button .click ()
41+ def click_save_request_cease (self ) -> None :
42+ """Clicks the 'Save Request Cease' button."""
43+ self .click (self .save_request_cease_button )
3844
39- def record_disclaimer_sent (self ):
40- self .record_disclaimer_sent_button .click ()
45+ def record_disclaimer_sent (self ) -> None :
46+ """Clicks the 'Record the disclaimer letter has been sent' button."""
47+ self .click (self .record_disclaimer_sent_button )
4148
42- def confirm_disclaimer_sent (self ):
43- self .confirm_disclaimer_sent_button .click ()
49+ def confirm_disclaimer_sent (self ) -> None :
50+ """Clicks the 'Confirm disclaimer letter has been sent' button."""
51+ self .click (self .confirm_disclaimer_sent_button )
4452
45- def record_return_of_disclaimer (self ):
46- self .record_return_disclaimer_button .click ()
53+ def record_return_of_disclaimer (self ) -> None :
54+ """Clicks the 'Record the return of the disclaimer letter' button."""
55+ self .click (self .record_return_disclaimer_button )
4756
48- def fill_notes_and_date (self , notes : str = "AUTO TEST: notes" ):
57+ def fill_notes_and_date (self , notes : str = "AUTO TEST: notes" ) -> None :
58+ """Fills in notes and today's date in the form.
59+ Args:
60+ notes (str): Notes to fill in the text box.
61+ """
4962 self .notes_field .fill (notes )
5063 today_str = datetime .today ().strftime ("%d/%m/%Y" )
5164 self .date_confirmed_field .fill (today_str )
5265
53- def confirm_cease (self ):
66+ def confirm_cease (self ) -> None :
67+ """Clicks the 'Confirm cease' button and accepts dialog."""
5468 BasePage (self .page ).safe_accept_dialog (self .confirm_cease_button )
5569
56- def fill_notes_if_visible (self , notes : str = "AUTO TEST: notes" ):
70+ def fill_notes_if_visible (self , notes : str = "AUTO TEST: notes" ) -> None :
71+ """Fills in notes if the notes textbox is visible.
72+ Args:
73+ notes (str): Notes to fill in the text box.
74+ """
5775 if self .notes_textbox .is_visible ():
5876 self .notes_textbox .fill (notes )
5977
60- def fill_date_if_visible (self , date_str : str ):
78+ def fill_date_if_visible (self , date_str : str ) -> None :
79+ """Fills in today's date if the date confirmed field is visible.
80+ Args:
81+ date_str (str): Date to fill in the date confirmed field.
82+ """
6183 if self .date_confirmed_field .is_visible ():
6284 self .date_confirmed_field .fill (date_str )
6385
64- def confirm_or_save_cease (self ):
86+ def confirm_or_save_cease (self ) -> None :
87+ """Confirms the cease action via either 'Confirm Cease' or 'Save Request Cease' button."""
6588 if self .confirm_cease_button .is_visible ():
6689 BasePage (self .page ).safe_accept_dialog (self .confirm_cease_button )
6790
6891 elif self .save_request_cease_button .is_visible ():
69- self .save_request_cease_button . click ()
92+ self .click (self . save_request_cease_button )
7093 else :
7194 logging .error ("No cease confirmation button found!" )
7295 raise RuntimeError ("Cease button not found on the page" )
0 commit comments