Skip to content

Commit dd51573

Browse files
Addressing PR comments
1 parent 1c01bc3 commit dd51573

File tree

3 files changed

+53
-53
lines changed

3 files changed

+53
-53
lines changed

docs/utility-guides/DynamicLocatorRetriever.md renamed to docs/utility-guides/DatasetField.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Utility Guide: Dynamic Locator Retriever
1+
# Utility Guide: Dataset Field Util
22

3-
The Dynamic Locator Retriever utility allows for selecting different locators dynamically.<br>
3+
The Dataset Field Util utility allows for selecting different locators dynamically.<br>
44
For example, on the investigation dataset, if we want to select the input locator for the `Start of intubation time` field, we can do this by providing the utility with the name of the field
55

6-
DynamicLocatorRetriever(page).populate_input_locator_for_field(
6+
DatasetFieldUtil(page).populate_input_locator_for_field(
77
"Start of intubation time", "09:00"
88
)
99

1010
## Table of Contents
1111

12-
- [Utility Guide: Dynamic Locator Retriever](#utility-guide-dynamic-locator-retriever)
12+
- [Utility Guide: Dataset Field Util](#utility-guide-dataset-field-util)
1313
- [Table of Contents](#table-of-contents)
14-
- [Using the Dynamic Locator Retriever class](#using-the-dynamic-locator-retriever-class)
14+
- [Using the Dataset Field Util class](#using-the-dataset-field-util-class)
1515
- [Required Args](#required-args)
1616
- [How to use this method](#how-to-use-this-method)
1717

18-
## Using the Dynamic Locator Retriever class
18+
## Using the Dataset Field Util class
1919

20-
You can initialise the Dynamic Locator Retriever class by using the following code in your test file:
20+
You can initialise the Dataset Field Util class by using the following code in your test file:
2121

22-
from utils.dynamic_locator_retriever import DynamicLocatorRetriever
22+
from utils.dataset_field_util import DatasetFieldUtil
2323

2424
This will allow you to use the following methods:
2525

@@ -57,24 +57,24 @@ This will allow you to use the following methods:
5757

5858
### How to use this method
5959

60-
To use this method simply import the SubjectDemographicUtil class and call one of the methods, providing the necessary arguments:
60+
To use this method simply import the DatasetFieldUtil class and call one of the methods, providing the necessary arguments:
6161

6262
# populate_input_locator_for_field
63-
DynamicLocatorRetriever(page).populate_input_locator_for_field(
63+
DatasetFieldUtil(page).populate_input_locator_for_field(
6464
"End time of procedure", "09:30"
6565
)
6666

6767
# populate_select_locator_for_field
68-
DynamicLocatorRetriever(page).populate_select_locator_for_field(
68+
DatasetFieldUtil(page).populate_select_locator_for_field(
6969
"Insufflation", InsufflationOptions.AIR
7070
)
7171

7272
# populate_input_locator_for_field_inside_div
73-
DynamicLocatorRetriever(page).populate_input_locator_for_field_inside_div(
73+
DatasetFieldUtil(page).populate_input_locator_for_field_inside_div(
7474
"Estimate of whole polyp size", "divPolypNumber1Section", "15"
7575
)
7676

7777
# populate_select_locator_for_field_inside_div
78-
DynamicLocatorRetriever(page).populate_select_locator_for_field_inside_div(
78+
DatasetFieldUtil(page).populate_select_locator_for_field_inside_div(
7979
"Classification", "divPolypNumber1Section", PolypClassificationOptions.LS
8080
)

tests/smokescreen/test_compartment_6.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
from 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

8484
def 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

129129
def 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

137137
def 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:
186186
def 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

204204
def 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)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from playwright.sync_api import Page, Locator
22

33

4-
class DynamicLocatorRetriever:
4+
class DatasetFieldUtil:
55

66
def __init__(self, page: Page):
77
self.page = page

0 commit comments

Comments
 (0)