Skip to content

Commit 8bb5ef3

Browse files
committed
Added reopen_fobt_screening_episode method
1 parent 0ecd971 commit 8bb5ef3

File tree

2 files changed

+51
-36
lines changed

2 files changed

+51
-36
lines changed

pages/screening_subject_search/subject_screening_summary_page.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def __init__(self, page: Page):
8686
self.reopen_fobt_screening_episode_button = self.page.get_by_role(
8787
"button", name="Reopen FOBT Screening Episode"
8888
)
89+
self.reopen_for_correction_button = self.page.get_by_role(
90+
"button", name="Reopen episode for correction"
91+
)
8992

9093
def wait_for_page_title(self) -> None:
9194
"""Waits for the page to be the Subject Screening Summary"""
@@ -407,6 +410,18 @@ def click_reopen_fobt_screening_episode_button(self) -> None:
407410
"""Click on the 'Reopen FOBT Screening Episode' button"""
408411
self.click(self.reopen_fobt_screening_episode_button)
409412

413+
def reopen_fobt_screening_episode(self) -> None:
414+
"""
415+
Reopen a previously closed FOBT screening episode, including confirmation modal.
416+
- Clicks the 'Reopen FOBT Screening Episode' button
417+
- Then safely accepts the dialog triggered by 'Reopen episode for correction'
418+
"""
419+
# Step 1: Click the initial 'Reopen FOBT Screening Episode' button
420+
self.click_reopen_fobt_screening_episode_button()
421+
422+
# Step 2: Safely accept the confirmation dialog triggered by the correction button
423+
self.safe_accept_dialog(self.reopen_for_correction_button)
424+
410425

411426
class ChangeScreeningStatusOptions(Enum):
412427
"""Enum for Change Screening Status options."""

tests/regression/regression_tests/fobt_regression_tests/test_scenario_4.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -226,46 +226,46 @@ def test_scenario_4(page: Page) -> None:
226226
},
227227
)
228228

229+
# When I view the subject
230+
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
229231

230-
# # When I view the subject
231-
# screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
232+
# And I reopen the subject's episode for "Reopen episode for correction"
233+
SubjectScreeningSummaryPage(page).reopen_fobt_screening_episode()
232234

233-
# # And I reopen the subject's episode for "Reopen episode for correction"
234-
# CallAndRecallUtils().reopen_episode(nhs_no, reason="Reopen episode for correction")
235+
# Then my subject has been updated as follows:
236+
subject_assertion(
237+
nhs_no,
238+
{
239+
"calculated FOBT due date": "As at episode start",
240+
"calculated lynch due date": "Null",
241+
"calculated surveillance due date": "Null",
242+
"ceased confirmation date": "Null",
243+
"ceased confirmation details": "Null",
244+
"ceased confirmation user ID": "Null",
245+
"clinical reason for cease": "Null",
246+
"latest episode accumulated result": "Null",
247+
"latest episode includes event code": "E63 Reopen episode for correction",
248+
"latest episode recall calculation method": "S92 Interrupt Close Date",
249+
"latest episode recall episode type": "Null",
250+
"latest episode recall surveillance type": "Null",
251+
"latest episode status": "Open",
252+
"latest episode status reason": "Null",
253+
"latest event status": "A8 Abnormal",
254+
"lynch due date": "Null",
255+
"lynch due date date of change": "Unchanged",
256+
"lynch due date reason": "Unchanged",
257+
"screening due date": "Calculated FOBT due date",
258+
"screening due date date of change": "Today",
259+
"screening due date reason": "Reopened episode",
260+
"surveillance due date": "Null",
261+
"surveillance due date date of change": "Unchanged",
262+
"surveillance due date reason": "Unchanged",
263+
},
264+
)
235265

236-
# # Then my subject has been updated as follows:
237-
# subject_assertion(
238-
# nhs_no,
239-
# {
240-
# "calculated FOBT due date": "As at episode start",
241-
# "calculated lynch due date": None,
242-
# "calculated surveillance due date": None,
243-
# "ceased confirmation date": None,
244-
# "ceased confirmation details": None,
245-
# "ceased confirmation user ID": None,
246-
# "clinical reason for cease": None,
247-
# "latest episode accumulated result": None,
248-
# "latest episode includes event code": "E63 Reopen episode for correction",
249-
# "latest episode recall calculation method": "S92 Interrupt Close Date",
250-
# "latest episode recall episode type": None,
251-
# "latest episode recall surveillance type": None,
252-
# "latest episode status": "Open",
253-
# "latest episode status reason": None,
254-
# "latest event status": "A8 Abnormal",
255-
# "lynch due date": None,
256-
# "lynch due date date of change": "Unchanged",
257-
# "lynch due date reason": "Unchanged",
258-
# "screening due date": "Calculated FOBT due date",
259-
# "screening due date date of change": "Today",
260-
# "screening due date reason": "Reopened episode",
261-
# "surveillance due date": None,
262-
# "surveillance due date date of change": "Unchanged",
263-
# "surveillance due date reason": "Unchanged",
264-
# },
265-
# )
266+
# When I view the subject
267+
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
266268

267-
# # When I view the subject
268-
# screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
269269

270270
# # And I choose to book a practitioner clinic for my subject
271271
# # And I select "BCS001" as the screening centre where the practitioner appointment will be held

0 commit comments

Comments
 (0)