Skip to content

Commit ce78247

Browse files
committed
addressed sonarqube issue and pr comments
1 parent f69bb69 commit ce78247

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

pages/manual_cease/manual_cease_page.py

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from 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")

tests/regression/manual_cease/test_manually_cease_a_subject.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def base_expected_db() -> dict[str, Any]:
5252

5353
# These scenarios just check that manually ceasing a subject (either immediately or via a disclaimer letter) from different statuses correctly sets their screening status and status reason.
5454
# Screening due date reason is always set to "Ceased" during a manual cease, even if the SDD is not changing.
55-
@pytest.mark.wip
5655
@pytest.mark.vpn_required
5756
@pytest.mark.manual_cease_tests
5857
@pytest.mark.regression
@@ -147,7 +146,6 @@ def test_manual_cease_from_inactive_subject_for_informed_dissent(
147146
logging.info("[ASSERTIONS COMPLETE] Manual cease scenario validated successfully")
148147

149148

150-
@pytest.mark.wip
151149
@pytest.mark.vpn_required
152150
@pytest.mark.manual_cease_tests
153151
@pytest.mark.regression
@@ -258,7 +256,6 @@ def test_manual_cease_from_call_subject_for_informed_dissent_verbal_only(
258256
logging.info("[ASSERTIONS COMPLETE] Manual cease scenario validated successfully")
259257

260258

261-
@pytest.mark.wip
262259
@pytest.mark.vpn_required
263260
@pytest.mark.manual_cease_tests
264261
@pytest.mark.regression
@@ -367,7 +364,6 @@ def test_manual_cease_from_recall_subject_for_no_colon_subject_request(
367364
logging.info("[ASSERTIONS COMPLETE] Manual cease scenario validated successfully")
368365

369366

370-
@pytest.mark.wip
371367
@pytest.mark.vpn_required
372368
@pytest.mark.manual_cease_tests
373369
@pytest.mark.regression
@@ -471,7 +467,6 @@ def test_manual_cease_from_surveillance_subject_for_no_colon_programme_assessed(
471467
)
472468

473469

474-
@pytest.mark.wip
475470
@pytest.mark.vpn_required
476471
@pytest.mark.manual_cease_tests
477472
@pytest.mark.regression
@@ -577,7 +572,6 @@ def test_manual_cease_from_already_ceased_subject_for_informal_death(
577572
)
578573

579574

580-
@pytest.mark.wip
581575
@pytest.mark.vpn_required
582576
@pytest.mark.manual_cease_tests
583577
@pytest.mark.regression

utils/manual_cease.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def process_manual_cease_with_disclaimer(
140140

141141
# Step 7: Final confirmation (Record Informed Dissent screen)
142142
manual_cease_page.fill_notes_and_date()
143-
logging.info(f"[STEP 7] Entered note and today's date")
143+
logging.info("[STEP 7] Entered note and today's date")
144144

145145
# Step 8: Confirm cease
146146
manual_cease_page.confirm_cease()

0 commit comments

Comments
 (0)