Skip to content

Commit 248be0e

Browse files
Completing scenario 7
1 parent 72fc8da commit 248be0e

File tree

2 files changed

+71
-72
lines changed

2 files changed

+71
-72
lines changed

pages/screening_subject_search/advance_fobt_screening_episode_page.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def __init__(self, page: Page):
6767
"button", name="Waiting Decision to Proceed with Diagnostic Test"
6868
)
6969
)
70+
self.not_suitable_for_diagnostic_tests_button = self.page.get_by_role(
71+
"button", name="Not Suitable for Diagnostic Tests"
72+
)
7073

7174
def click_suitable_for_endoscopic_test_button(self) -> None:
7275
"""Click the 'Suitable for Endoscopic Test' button."""
@@ -166,18 +169,20 @@ def click_and_select_subsequent_assessment_appointment_required(
166169

167170
def click_suitable_for_radiological_test_button(self) -> None:
168171
"""Click the 'Suitable for Radiological Test' button."""
169-
AdvanceFOBTScreeningEpisodePage(self.page).safe_accept_dialog(
170-
self.suitable_for_radiological_test_button
171-
)
172+
self.safe_accept_dialog(self.suitable_for_radiological_test_button)
172173

173174
def click_decision_not_to_continue_with_diagnostic_test(self) -> None:
174175
"""Click the 'Decision not to Continue with Diagnostic Test' button."""
175-
AdvanceFOBTScreeningEpisodePage(self.page).safe_accept_dialog(
176+
self.safe_accept_dialog(
176177
self.decision_not_to_continue_with_diagnostic_test_button
177178
)
178179

179180
def click_waiting_decision_to_proceed_with_diagnostic_test(self) -> None:
180181
"""Click the 'Waiting Decision to Proceed with Diagnostic Test' button."""
181-
AdvanceFOBTScreeningEpisodePage(self.page).safe_accept_dialog(
182+
self.safe_accept_dialog(
182183
self.waiting_decision_to_proceed_with_diagnostic_test_button
183184
)
185+
186+
def click_not_suitable_for_diagnostic_tests_button(self) -> None:
187+
"""Click the 'Not Suitable for Diagnostic Tests' button."""
188+
self.safe_accept_dialog(self.not_suitable_for_diagnostic_tests_button)

tests/regression/regression_tests/fobt_regression_tests/test_scenario_7.py

Lines changed: 61 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
from pages.screening_subject_search.patient_advised_of_diagnosis_page import (
3232
PatientAdvisedOfDiagnosisPage,
3333
)
34+
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
35+
from pages.datasets.colonoscopy_dataset_page import (
36+
ColonoscopyDatasetsPage,
37+
FitForColonoscopySspOptions,
38+
)
3439

3540

36-
@pytest.mark.wip
3741
@pytest.mark.usefixtures("setup_org_and_appointments")
3842
@pytest.mark.vpn_required
3943
@pytest.mark.regression
@@ -458,92 +462,82 @@ def test_scenario_7(page: Page) -> None:
458462
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
459463

460464
# And I edit the Colonoscopy Assessment Dataset for this subject
465+
SubjectScreeningSummaryPage(page).click_datasets_link()
466+
SubjectDatasetsPage(page).click_colonoscopy_show_datasets()
461467

462468
# And I update the Colonoscopy Assessment Dataset with the following values:
463-
464-
logging.info(f"NHS NUMBER: {nhs_no}")
465-
LogoutPage(page).log_out()
466-
467-
468-
@pytest.mark.wip2
469-
def test_test(page: Page) -> None:
470-
nhs_no = "9625261559"
471-
UserTools.user_login(page, "Screening Centre Manager at BCS001")
469+
ColonoscopyDatasetsPage(page).select_fit_for_colonoscopy_option(
470+
FitForColonoscopySspOptions.NO
471+
)
472+
ColonoscopyDatasetsPage(page).click_dataset_complete_radio_button_yes()
473+
ColonoscopyDatasetsPage(page).save_dataset()
472474

473475
# And I view the subject
474476
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
475477

476-
# And I view the advance episode options
478+
# And I advance the subject's episode for "Not Suitable for Diagnostic Tests"
477479
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
478-
479-
# And I select Subsequent Assessment Appointment Required reason "Previous attendance, further assessment required"
480480
AdvanceFOBTScreeningEpisodePage(
481481
page
482-
).click_and_select_subsequent_assessment_appointment_required(
483-
"Previous attendance, further assessment required"
484-
)
482+
).click_not_suitable_for_diagnostic_tests_button()
485483

486484
# Then my subject has been updated as follows:
487485
subject_assertion(
488-
nhs_no, {"latest event status": "J1 Subsequent Assessment Appointment Required"}
486+
nhs_no, {"latest event status": "J15 Not Suitable for Diagnostic Tests"}
489487
)
490488

491-
# When I view the subject
492-
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
493-
494-
# And I choose to book a practitioner clinic for my subject
495-
SubjectScreeningSummaryPage(page).click_book_practitioner_clinic_button()
496-
497-
# And I select "BCS001" as the screening centre where the practitioner appointment will be held
498-
# And I set the practitioner appointment date to "today"
499-
# And I book the "earliest" available practitioner appointment on this date
500-
book_appointments(
489+
# And there is a "J15" letter batch for my subject with the exact title "Subject Discharge (Unsuitable For Further Diagnostic Tests)"
490+
# When I process the open "J15" letter batch for my subject
491+
batch_processing(
501492
page,
502-
"BCS001 - Wolverhampton Bowel Cancer Screening Centre",
503-
"The Royal Hospital (Wolverhampton)",
493+
"J15",
494+
"Subject Discharge (Unsuitable For Further Diagnostic Tests)",
495+
"J16 - Patient Discharge Sent (Unsuitable for Diagnostic Tests)",
504496
)
505497

506-
# Then my subject has been updated as follows:
507-
subject_assertion(
508-
nhs_no,
509-
{
510-
"latest event status": "J34 Subsequent Appointment Requested",
511-
},
512-
)
498+
# When I switch users to BCSS "England" as user role "Hub Manager"
499+
LogoutPage(page).log_out(close_page=False)
500+
BasePage(page).go_to_log_in_page()
501+
UserTools.user_login(page, "Hub Manager State Registered at BCS01")
502+
503+
# And there is a "J16" letter batch for my subject with the exact title "GP Discharge (Not Suitable For Diagnostic Tests)"
504+
# And I process the open "J16" letter batch for my subject
513505

514-
# And there is a "J34" letter batch for my subject with the exact title "Practitioner Clinic 1st Subsequent Appointment"
515-
# When I process the open "J34" letter batch for my subject
516506
batch_processing(
517507
page,
518-
"J34",
519-
"Practitioner Clinic 1st Subsequent Appointment",
520-
"J35 - Subsequent Appointment Booked, letter sent",
508+
"J16",
509+
"GP Discharge (Not Suitable For Diagnostic Tests)",
510+
"J17 - GP Discharge Sent (Unsuitable for Diagnostic Tests)",
521511
)
522512

523-
# When I view the event history for the subject's latest episode
524-
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
525-
SubjectScreeningSummaryPage(page).expand_episodes_list()
526-
SubjectScreeningSummaryPage(page).click_first_fobt_episode_link()
527-
528-
# And I view the latest practitioner appointment in the subject's episode
529-
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
530-
531-
# And I attend the subject's practitioner appointment "today"
532-
AppointmentDetailPage(page).mark_appointment_as_attended(datetime.today())
533-
534513
# Then my subject has been updated as follows:
535-
subject_assertion(
536-
nhs_no,
537-
{
538-
"latest event status": "J10 Attended Colonoscopy Assessment Appointment",
539-
},
540-
)
541-
542-
# When I view the subject
543-
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
544-
545-
# And I edit the Colonoscopy Assessment Dataset for this subject
546-
547-
# And I update the Colonoscopy Assessment Dataset with the following values:
548-
549-
logging.info(f"NHS NUMBER: {nhs_no}")
514+
criteria = {
515+
"calculated fobt due date": "2 years from latest J16 event",
516+
"calculated lynch due date": "Unchanged",
517+
"calculated surveillance due date": "Unchanged",
518+
"ceased confirmation date": "Null",
519+
"ceased confirmation details": "Null",
520+
"ceased confirmation user id": "Null",
521+
"clinical reason for cease": "Null",
522+
"latest episode accumulated result": "Definitive abnormal FOBT outcome",
523+
"latest episode recall calculation method": "Date of last patient letter",
524+
"latest episode recall episode type": "FOBT Screening",
525+
"latest episode recall surveillance type": "Null",
526+
"latest episode status": "Closed",
527+
"latest episode status reason": "Clinical Reason",
528+
"latest event status": "J17 GP Discharge Sent (Unsuitable for Diagnostic Tests)",
529+
"lynch due date": "Null",
530+
"lynch due date date of change": "Unchanged",
531+
"lynch due date reason": "unchanged",
532+
"screening due date": "Calculated FOBT due date",
533+
"screening due date date of change": "Today",
534+
"screening due date reason": "Recall",
535+
"screening status": "Recall",
536+
"screening status date of change": "Today",
537+
"screening status reason": "Recall",
538+
"surveillance due date date of change": "Unchanged",
539+
"surveillance due date reason": "unchanged",
540+
"surveillance due date": "Null",
541+
}
542+
subject_assertion(nhs_no, criteria)
543+
LogoutPage(page).log_out()

0 commit comments

Comments
 (0)