Skip to content

Commit 13f2ee3

Browse files
committed
Updated ColonoscopyDatasetsPage
Added methods to AdvanceFOBTScreeningEpisodePage Updated scenario 3 and 6, and test compartment 5 to use new implementation of FitForColonoscopySspOptions Bug fix for SubjectSelectionQueryBuilder wip for scenario 6
1 parent 9d7997b commit 13f2ee3

File tree

7 files changed

+478
-215
lines changed

7 files changed

+478
-215
lines changed

pages/datasets/colonoscopy_dataset_page.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
from enum import Enum
44

55

6+
class FitForColonoscopySspOptions(Enum):
7+
YES = "17058"
8+
NO = "17059"
9+
UNABLE_TO_ASSESS = "17954"
10+
11+
612
class ColonoscopyDatasetsPage(BasePage):
713
"""Colonoscopy Datasets Page locators, and methods for interacting with the page"""
814

@@ -44,16 +50,19 @@ def select_asa_grade_option(self, option: str) -> None:
4450
"""
4551
self.select_asa_grade_dropdown.select_option(option)
4652

47-
def select_fit_for_colonoscopy_option(self, option: str) -> None:
53+
def select_fit_for_colonoscopy_option(
54+
self, option: FitForColonoscopySspOptions
55+
) -> None:
4856
"""
49-
This method is designed to select a specific option from the colonoscopy dataset page, Fit for Colonoscopy (SSP) dropdown menu.
57+
Selects a specific option from the 'Fit for Colonoscopy (SSP)' dropdown.
58+
5059
Args:
51-
option (str): The option to be selected. This should be a string that matches one of the available options in the dropdown menu.
52-
Valid options are: "YES", "NO", or "UNABLE_TO_ASSESS".
60+
option (FitForColonoscopySspOptions): Enum member representing the desired option.
61+
5362
Returns:
5463
None
5564
"""
56-
self.select_fit_for_colonoscopy_dropdown.select_option(option)
65+
self.select_fit_for_colonoscopy_dropdown.select_option(option.value)
5766

5867
def click_dataset_complete_radio_button_yes(self) -> None:
5968
"""Clicks the 'Yes' radio button for the dataset complete option."""
@@ -72,9 +81,3 @@ class AsaGradeOptions(Enum):
7281
MORIBUND = "17013"
7382
NOT_APPLICABLE = "17014"
7483
NOT_KNOWN = "17015"
75-
76-
77-
class FitForColonoscopySspOptions(Enum):
78-
YES = "17058"
79-
NO = "17059"
80-
UNABLE_TO_ASSESS = "17954"

pages/screening_subject_search/advance_fobt_screening_episode_page.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def __init__(self, page: Page):
1717
self.calendar_button = self.page.get_by_role("button", name="Calendar")
1818
self.test_type_dropdown = self.page.locator("#UI_EXT_TEST_TYPE_2233")
1919
self.test_type_dropdown_2 = self.page.locator("#UI_EXT_TEST_TYPE_4325")
20-
self.advance_checkbox = self.page.get_by_label("There are some events available which should only be used in exceptional circumstances. If you wish to see them, check this box")
20+
self.advance_checkbox = self.page.get_by_label(
21+
"There are some events available which should only be used in exceptional circumstances. If you wish to see them, check this box"
22+
)
2123
self.invite_for_diagnostic_test_button = self.page.get_by_role(
2224
"button", name="Invite for Diagnostic Test >>"
2325
)
@@ -42,6 +44,14 @@ def __init__(self, page: Page):
4244
self.record_contact_with_patient_button = self.page.get_by_role(
4345
"button", name="Record Contact with Patient"
4446
)
47+
self.suitable_for_radiological_test_button = self.page.get_by_role(
48+
"button", name="Suitable for Radiological Test"
49+
)
50+
self.decision_not_to_continue_with_diagnostic_test_button = (
51+
self.page.get_by_role(
52+
"button", name="Decision not to Continue with Diagnostic Test"
53+
)
54+
)
4555

4656
def click_suitable_for_endoscopic_test_button(self) -> None:
4757
"""Click the 'Suitable for Endoscopic Test' button."""
@@ -116,3 +126,15 @@ def click_record_contact_with_patient_button(self) -> None:
116126
def check_advance_checkbox(self) -> None:
117127
"""Selects the 'Advance FOBT' checkbox"""
118128
self.advance_checkbox.check()
129+
130+
def click_suitable_for_radiological_test_button(self) -> None:
131+
"""Click the 'Suitable for Radiological Test' button."""
132+
AdvanceFOBTScreeningEpisodePage(self.page).safe_accept_dialog(
133+
self.suitable_for_radiological_test_button
134+
)
135+
136+
def click_decision_not_to_continue_with_diagnostic_test(self) -> None:
137+
"""Click the 'Decision not to Continue with Diagnostic Test' button."""
138+
AdvanceFOBTScreeningEpisodePage(self.page).safe_accept_dialog(
139+
self.decision_not_to_continue_with_diagnostic_test_button
140+
)

tests/regression/regression_tests/fobt_regression_tests/test_scenario_3.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from utils.batch_processing import batch_processing
99
from utils.fit_kit import FitKitGeneration, FitKitLogged
1010
from utils import screening_subject_page_searcher
11-
from utils.calendar_picker import CalendarPicker
1211
from utils.sspi_change_steps import SSPIChangeSteps
1312
from utils.appointments import book_appointments
1413
from pages.base_page import BasePage
@@ -22,9 +21,6 @@
2221
from pages.screening_subject_search.advance_fobt_screening_episode_page import (
2322
AdvanceFOBTScreeningEpisodePage,
2423
)
25-
from pages.screening_practitioner_appointments.book_appointment_page import (
26-
BookAppointmentPage,
27-
)
2824
from pages.screening_subject_search.record_diagnosis_date_page import (
2925
RecordDiagnosisDatePage,
3026
)

0 commit comments

Comments
 (0)