4747from pages .screening_subject_search .advance_fobt_screening_episode_page import (
4848 AdvanceFOBTScreeningEpisodePage ,
4949)
50- from utils .dynamic_locator_retriever import DynamicLocatorRetriever
50+ from utils .dataset_field_util import DatasetFieldUtil
5151
5252
5353# This should go into a util. Adding it here to avoid SonarQube duplication errors:
@@ -82,101 +82,101 @@ def default_investigation_dataset_forms(page: Page) -> None:
8282
8383
8484def default_investigation_dataset_forms_continuation (page : Page ) -> None :
85- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
85+ DatasetFieldUtil (page ).populate_select_locator_for_field (
8686 "Bowel preparation quality" , BowelPreparationQualityOptions .GOOD
8787 )
88- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
88+ DatasetFieldUtil (page ).populate_select_locator_for_field (
8989 "Comfort during examination" , ComfortOptions .NO_DISCOMFORT
9090 )
91- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
91+ DatasetFieldUtil (page ).populate_select_locator_for_field (
9292 "Comfort during recovery" , ComfortOptions .NO_DISCOMFORT
9393 )
94- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
94+ DatasetFieldUtil (page ).populate_select_locator_for_field (
9595 "Endoscopist defined extent" , EndoscopyLocationOptions .ILEUM
9696 )
97- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
97+ DatasetFieldUtil (page ).populate_select_locator_for_field (
9898 "Scope imager used" , YesNoOptions .YES
9999 )
100- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
100+ DatasetFieldUtil (page ).populate_select_locator_for_field (
101101 "Retroverted view" , YesNoOptions .NO
102102 )
103- DynamicLocatorRetriever (page ).populate_input_locator_for_field (
103+ DatasetFieldUtil (page ).populate_input_locator_for_field (
104104 "Start of intubation time" , "09:00"
105105 )
106- DynamicLocatorRetriever (page ).populate_input_locator_for_field (
106+ DatasetFieldUtil (page ).populate_input_locator_for_field (
107107 "Start of extubation time" , "09:15"
108108 )
109- DynamicLocatorRetriever (page ).populate_input_locator_for_field (
109+ DatasetFieldUtil (page ).populate_input_locator_for_field (
110110 "End time of procedure" , "09:30"
111111 )
112- DynamicLocatorRetriever (page ).populate_input_locator_for_field ("Scope ID" , "A1" )
113- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
112+ DatasetFieldUtil (page ).populate_input_locator_for_field ("Scope ID" , "A1" )
113+ DatasetFieldUtil (page ).populate_select_locator_for_field (
114114 "Insufflation" , InsufflationOptions .AIR
115115 )
116- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
116+ DatasetFieldUtil (page ).populate_select_locator_for_field (
117117 "Outcome at time of procedure" , OutcomeAtTimeOfProcedureOptions .LEAVE_DEPARTMENT
118118 )
119- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
119+ DatasetFieldUtil (page ).populate_select_locator_for_field (
120120 "Late outcome" , LateOutcomeOptions .NO_COMPLICATIONS
121121 )
122122 InvestigationDatasetsPage (page ).click_show_completion_proof_information ()
123123 # Completion Proof Information
124- DynamicLocatorRetriever (page ).populate_select_locator_for_field (
124+ DatasetFieldUtil (page ).populate_select_locator_for_field (
125125 "Proof Parameters" , CompletionProofOptions .PHOTO_ILEO
126126 )
127127
128128
129129def investigation_datasets_failure_reason (page : Page ) -> None :
130130 # Failure Information
131131 InvestigationDatasetsPage (page ).click_show_failure_information ()
132- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
132+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
133133 "Failure Reasons" , "divFailureSection" , FailureReasonsOptions .BLEEDING_INCIDENT
134134 )
135135
136136
137137def polyps_for_high_risk_result (page : Page ) -> None :
138138 # Polyp Information
139139 InvestigationDatasetsPage (page ).click_add_polyp_button ()
140- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
140+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
141141 "Location" , "divPolypNumber1Section" , EndoscopyLocationOptions .ILEUM
142142 )
143- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
143+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
144144 "Classification" , "divPolypNumber1Section" , PolypClassificationOptions .LS
145145 )
146- DynamicLocatorRetriever (page ).populate_input_locator_for_field_inside_div (
146+ DatasetFieldUtil (page ).populate_input_locator_for_field_inside_div (
147147 "Estimate of whole polyp size" , "divPolypNumber1Section" , "15"
148148 )
149- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
149+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
150150 "Polyp Access" , "divPolypNumber1Section" , PolypAccessOptions .NOT_KNOWN
151151 )
152152 polyp1_intervention (page )
153153 InvestigationDatasetsPage (page ).click_add_polyp_button ()
154- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
154+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
155155 "Location" , "divPolypNumber2Section" , EndoscopyLocationOptions .CAECUM
156156 )
157- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
157+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
158158 "Classification" , "divPolypNumber2Section" , PolypClassificationOptions .LS
159159 )
160- DynamicLocatorRetriever (page ).populate_input_locator_for_field_inside_div (
160+ DatasetFieldUtil (page ).populate_input_locator_for_field_inside_div (
161161 "Estimate of whole polyp size" , "divPolypNumber2Section" , "15"
162162 )
163- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
163+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
164164 "Polyp Access" , "divPolypNumber2Section" , PolypAccessOptions .NOT_KNOWN
165165 )
166166 InvestigationDatasetsPage (page ).click_polyp2_add_intervention_button ()
167- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
167+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
168168 "Modality" , "divPolypTherapy2_1Section" , PolypInterventionModalityOptions .EMR
169169 )
170- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
170+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
171171 "Device" , "divPolypTherapy2_1Section" , PolypInterventionDeviceOptions .HOT_SNARE
172172 )
173- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
173+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
174174 "Excised" , "divPolypResected2_1" , YesNoOptions .YES
175175 )
176- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
176+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
177177 "Retrieved" , "divPolypTherapy2_1Section" , YesNoOptions .NO
178178 )
179- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
179+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
180180 "Excision Technique" ,
181181 "divPolypTherapy2_1Section" ,
182182 PolypInterventionExcisionTechniqueOptions .EN_BLOC ,
@@ -186,38 +186,38 @@ def polyps_for_high_risk_result(page: Page) -> None:
186186def polyps_for_lnpcp_result (page : Page ) -> None :
187187 # Polyp Information
188188 InvestigationDatasetsPage (page ).click_add_polyp_button ()
189- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
189+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
190190 "Location" , "divPolypNumber1Section" , EndoscopyLocationOptions .ILEUM
191191 )
192- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
192+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
193193 "Classification" , "divPolypNumber1Section" , PolypClassificationOptions .LS
194194 )
195- DynamicLocatorRetriever (page ).populate_input_locator_for_field_inside_div (
195+ DatasetFieldUtil (page ).populate_input_locator_for_field_inside_div (
196196 "Estimate of whole polyp size" , "divPolypNumber1Section" , "30"
197197 )
198- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
198+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
199199 "Polyp Access" , "divPolypNumber1Section" , PolypAccessOptions .NOT_KNOWN
200200 )
201201 polyp1_intervention (page )
202202
203203
204204def polyp1_intervention (page : Page ) -> None :
205205 InvestigationDatasetsPage (page ).click_polyp1_add_intervention_button ()
206- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
206+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
207207 "Modality" ,
208208 "divPolypTherapy1_1Section" ,
209209 PolypInterventionModalityOptions .POLYPECTOMY ,
210210 )
211- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
211+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
212212 "Device" , "divPolypTherapy1_1Section" , PolypInterventionDeviceOptions .HOT_SNARE
213213 )
214- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
214+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
215215 "Excised" , "divPolypResected1_1" , YesNoOptions .YES
216216 )
217- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
217+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
218218 "Retrieved" , "divPolypTherapy1_1Section" , YesNoOptions .NO
219219 )
220- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
220+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
221221 "Excision Technique" ,
222222 "divPolypTherapy1_1Section" ,
223223 PolypInterventionExcisionTechniqueOptions .EN_BLOC ,
@@ -407,7 +407,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
407407 InvestigationDatasetsPage (page ).select_diagnostic_procedure_type ()
408408 default_investigation_dataset_forms_continuation (page )
409409 InvestigationDatasetsPage (page ).click_show_failure_information ()
410- DynamicLocatorRetriever (page ).populate_select_locator_for_field_inside_div (
410+ DatasetFieldUtil (page ).populate_select_locator_for_field_inside_div (
411411 "Failure Reasons" , "divFailureSection" , FailureReasonsOptions .NO_FAILURE_REASONS
412412 )
413413 save_investigation_dataset (page )
0 commit comments