Skip to content

Commit b277d91

Browse files
committed
WIP - created an investigation dataset navigation util file
Fixed a couple of spelling mistakes.
1 parent 71d791a commit b277d91

File tree

3 files changed

+76
-12
lines changed

3 files changed

+76
-12
lines changed

pages/datasets/investigation_dataset_page.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, page: Page):
2626
"#anchorColonoscopy"
2727
)
2828
self.endoscope_inserted_yes = self.page.locator("#radScopeInsertedYes")
29-
self.theraputic_procedure_type = self.page.get_by_role(
29+
self.therapeutic_procedure_type = self.page.get_by_role(
3030
"radio", name="Therapeutic"
3131
)
3232
self.diagnostic_procedure_type = self.page.get_by_role(
@@ -206,12 +206,12 @@ def check_endoscope_inserted_yes(self) -> None:
206206
"""
207207
self.endoscope_inserted_yes.check()
208208

209-
def select_theraputic_procedure_type(self) -> None:
209+
def select_therapeutic_procedure_type(self) -> None:
210210
"""
211211
This method is designed to select the therapeutic procedure type.
212212
It selects the therapeutic procedure type.
213213
"""
214-
self.theraputic_procedure_type.check()
214+
self.therapeutic_procedure_type.check()
215215

216216
def select_diagnostic_procedure_type(self) -> None:
217217
"""

tests/smokescreen/test_compartment_6.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from pages.logout.log_out_page import LogoutPage
1111
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
1212
from pages.screening_subject_search.handover_into_symptomatic_care_page import (
13-
HandoverIntoSymptomaticCarePage
13+
HandoverIntoSymptomaticCarePage,
1414
)
1515
from utils.calendar_picker import CalendarPicker
1616
from datetime import datetime
1717
from pages.screening_subject_search.record_diagnosis_date_page import (
1818
RecordDiagnosisDatePage,
1919
)
2020
from pages.screening_subject_search.diagnostic_test_outcome_page import (
21-
DiagnosticTestOutcomePage,OutcomeOfDiagnosticTest
21+
DiagnosticTestOutcomePage,
22+
OutcomeOfDiagnosticTest,
2223
)
2324
from pages.datasets.investigation_dataset_page import (
2425
InvestigationDatasetsPage,
@@ -220,9 +221,12 @@ def after_high_risk_result(page: Page) -> None:
220221

221222
# The following code is on the diagnostic test outcome page
222223
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome("High-risk findings")
223-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.REFER_SURVEILLANCE)
224+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
225+
OutcomeOfDiagnosticTest.REFER_SURVEILLANCE
226+
)
224227
DiagnosticTestOutcomePage(page).click_save_button()
225228

229+
226230
def after_lnpcp_result(page: Page) -> None:
227231
InvestigationDatasetsPage(page).expect_text_to_be_visible("LNPCP")
228232
BasePage(page).click_back_button()
@@ -238,9 +242,12 @@ def after_lnpcp_result(page: Page) -> None:
238242

239243
# The following code is on the diagnostic test outcome page
240244
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome("LNPCP")
241-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.REFER_SURVEILLANCE)
245+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
246+
OutcomeOfDiagnosticTest.REFER_SURVEILLANCE
247+
)
242248
DiagnosticTestOutcomePage(page).click_save_button()
243249

250+
244251
def handover_subject_to_symptomatic_care(page: Page) -> None:
245252
SubjectScreeningSummaryPage(page).verify_latest_event_status_value(
246253
"A394 - Handover into Symptomatic Care for Surveillance - Patient Age"
@@ -287,7 +294,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
287294

288295
# The following code is on the investigation datasets page
289296
default_investigation_dataset_forms(page)
290-
InvestigationDatasetsPage(page).select_theraputic_procedure_type()
297+
InvestigationDatasetsPage(page).select_therapeutic_procedure_type()
291298
default_investigation_dataset_forms_continuation(page)
292299
investigation_datasets_failure_reason(page)
293300
polyps_for_high_risk_result(page)
@@ -302,7 +309,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
302309

303310
# The following code is on the investigation datasets page
304311
default_investigation_dataset_forms(page)
305-
InvestigationDatasetsPage(page).select_theraputic_procedure_type()
312+
InvestigationDatasetsPage(page).select_therapeutic_procedure_type()
306313
default_investigation_dataset_forms_continuation(page)
307314
investigation_datasets_failure_reason(page)
308315
polyps_for_high_risk_result(page)
@@ -332,7 +339,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
332339

333340
# The following code is on the investigation datasets page
334341
default_investigation_dataset_forms(page)
335-
InvestigationDatasetsPage(page).select_theraputic_procedure_type()
342+
InvestigationDatasetsPage(page).select_therapeutic_procedure_type()
336343
default_investigation_dataset_forms_continuation(page)
337344
investigation_datasets_failure_reason(page)
338345
polyps_for_lnpcp_result(page)
@@ -347,7 +354,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
347354

348355
# The following code is on the investigation datasets page
349356
default_investigation_dataset_forms(page)
350-
InvestigationDatasetsPage(page).select_theraputic_procedure_type()
357+
InvestigationDatasetsPage(page).select_therapeutic_procedure_type()
351358
default_investigation_dataset_forms_continuation(page)
352359
investigation_datasets_failure_reason(page)
353360
polyps_for_lnpcp_result(page)
@@ -400,7 +407,9 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
400407
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome(
401408
"Normal (No Abnormalities"
402409
)
403-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.INVESTIGATION_COMPLETE)
410+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
411+
OutcomeOfDiagnosticTest.INVESTIGATION_COMPLETE
412+
)
404413
DiagnosticTestOutcomePage(page).click_save_button()
405414

406415
SubjectScreeningSummaryPage(page).verify_latest_event_status_value(
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Create a new util that can populate the investigations dataset to get the following
2+
# results:
3+
4+
# High risk
5+
# LNPCP
6+
# Normal
7+
8+
# This needs to be done as there is a lot of repeat code between the three results
9+
# and we need 2 subjects with high risk and LNPCP results.
10+
# Also create any utils to reduce the amount of duplicated code
11+
# to as close to 0% as possible.
12+
13+
# Add utility guide
14+
15+
from pages.datasets.investigation_dataset_page import InvestigationDatasetsPage
16+
from playwright.sync_api import Page
17+
18+
19+
# Populate investigation dataset to get HIGH RISK results
20+
def populate_investigation_dataset_high_risk(page: Page) -> None:
21+
"""
22+
This populates the investigation dataset to get HIGH RISK results
23+
24+
Args:
25+
page (Page): This is the playwright page object
26+
"""
27+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
28+
InvestigationDatasetsPage(page).select_investigation_dataset_type("High Risk")
29+
InvestigationDatasetsPage(page).click_save_button()
30+
31+
32+
# Populate investigation dataset to get LNPCP results
33+
def populate_investigation_dataset_lnpcp(page: Page) -> None:
34+
"""
35+
This populates the investigation dataset to get LNPCP results
36+
37+
Args:
38+
page (Page): This is the playwright page object
39+
"""
40+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
41+
InvestigationDatasetsPage(page).select_investigation_dataset_type("LNPCP")
42+
InvestigationDatasetsPage(page).click_save_button()
43+
44+
45+
# Populate investigation dataset to get NORMAL results
46+
def populate_investigation_dataset_normal(page: Page) -> None:
47+
"""
48+
This populates the investigation dataset to get NORMAL results
49+
50+
Args:
51+
page (Page): This is the playwright page object
52+
"""
53+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
54+
InvestigationDatasetsPage(page).select_investigation_dataset_type("Normal")
55+
InvestigationDatasetsPage(page).click_save_button()

0 commit comments

Comments
 (0)