Skip to content

Commit b806eba

Browse files
committed
Changed record_diagnosis_date_with_reason to record_diagnosis_reason
1 parent 60ba472 commit b806eba

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

pages/screening_subject_search/record_diagnosis_date_page.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ class RecordDiagnosisDatePage(BasePage):
1010
def __init__(self, page: Page):
1111
super().__init__(page)
1212
self.page = page
13+
1314
# Record Diagnosis Date - page locators
1415
self.diagnosis_date_field = self.page.locator("#diagnosisDate")
16+
self.reason_dropdown = self.page.locator("#reason")
1517
self.save_button = self.page.get_by_role("button", name="Save")
1618

1719
def enter_date_in_diagnosis_date_field(self, date: datetime) -> None:
@@ -42,18 +44,22 @@ def get_alert_message(self) -> str:
4244
else:
4345
return ""
4446

45-
def record_diagnosis_date_with_reason(self, date: datetime, reason_text: str) -> None:
47+
48+
def record_diagnosis_reason(self, reason_text: str) -> None:
4649
"""
47-
Records a diagnosis date and selects a reason before saving.
50+
Selects a diagnosis reason from the dropdown and saves the form.
4851
4952
Args:
50-
date (datetime): The diagnosis date to enter.
5153
reason_text (str): The visible text of the reason to select.
54+
Valid options include:
55+
- "Patient declined all appointments"
56+
- "2 DNAs of colonoscopy assessment appt"
57+
- "Patient emigrated"
58+
- "Patient deceased"
59+
- "Patient choice"
60+
- "Patient could not be contacted"
61+
- "Reopened old episode, date unknown"
62+
- "Other"
5263
"""
53-
self.enter_date_in_diagnosis_date_field(date)
54-
55-
reason_dropdown = self.page.locator("#DIAGNOSIS_REASON") # Replace with actual ID
56-
reason_dropdown.select_option(label=reason_text)
57-
64+
self.reason_dropdown.select_option(label=reason_text)
5865
self.safe_accept_dialog(self.save_button)
59-

tests/regression/regression_tests/fobt_regression_tests/test_scenario_4.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
)
3535

3636

37-
@pytest.mark.wip
3837
@pytest.mark.usefixtures("setup_org_and_appointments")
3938
@pytest.mark.vpn_required
4039
@pytest.mark.regression
@@ -352,6 +351,8 @@ def test_scenario_4(page: Page) -> None:
352351
},
353352
)
354353

354+
355+
def test_process_j4_letter_batch(page: Page, nhs_no: str) -> None:
355356
# When I process the open "J4" letter batch for my subject
356357
# # Then my subject has been updated as follows:
357358
batch_processing(
@@ -421,7 +422,7 @@ def test_scenario_4(page: Page) -> None:
421422
ReasonForCancellationOptions.PATIENT_UNSUITABLE_RECENTLY_SCREENED
422423
)
423424

424-
# And I press OK on my confirmation prompt TODO: This step is resulting in a 403 forbidden error
425+
# And I press OK on my confirmation prompt
425426
AppointmentDetailPage(page).click_save_button(accept_dialog=True)
426427

427428
# Then my subject has been updated as follows:
@@ -459,10 +460,10 @@ def test_scenario_4(page: Page) -> None:
459460
# And I select the advance episode option for "Record Diagnosis Date"
460461
AdvanceFOBTScreeningEpisodePage(page).click_record_diagnosis_date_button()
461462

462-
# And I enter a Diagnosis Date of "today"
463-
RecordDiagnosisDatePage(page).enter_date_in_diagnosis_date_field(datetime.today())
463+
# And I select Diagnosis Date Reason "Patient choice"
464+
RecordDiagnosisDatePage(page).record_diagnosis_reason(reason_text="Patient Choice")
464465

465-
# # And I save Diagnosis Date Information
466+
# And I save Diagnosis Date Information
466467
RecordDiagnosisDatePage(page).click_save_button()
467468

468469
# Then my subject has been updated as follows:

0 commit comments

Comments
 (0)