Skip to content

Commit 7fd7ce8

Browse files
committed
wip
1 parent be8e8ff commit 7fd7ce8

File tree

3 files changed

+109
-63
lines changed

3 files changed

+109
-63
lines changed

tests/smokescreen/test_compartment_6.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,11 @@
4848
AdvanceFOBTScreeningEpisodePage,
4949
)
5050
from utils.dataset_field_util import DatasetFieldUtil
51+
from utils import investigation_dataset
5152

5253

53-
# This should go into a util. Adding it here to avoid SonarQube duplication errors:
54-
def go_to_investigation_datasets_page(page: Page, nhs_no) -> None:
55-
verify_subject_event_status_by_nhs_no(
56-
page, nhs_no, "A323 - Post-investigation Appointment NOT Required"
57-
)
58-
59-
SubjectScreeningSummaryPage(page).click_datasets_link()
60-
SubjectDatasetsPage(page).click_investigation_show_datasets()
54+
# Go to the investigation datasets page
55+
investigation_dataset.go_to_investigation_datasets_page(page, nhs_no)
6156

6257

6358
def default_investigation_dataset_forms(page: Page) -> None:

utils/investigation_dataset.py

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
# Update compartment 6
14+
15+
# Add utility guide
16+
17+
# In the code I have added these comments to show the different actions:
18+
# This needs to be repeated for 1 subject, age does not matter - Normal Result
19+
# This needs to be repeated for two subjects, one old and one not - LNPCP Result
20+
# This needs to be repeated for two subjects, one old and one not - High Risk Result
21+
22+
from pages.datasets.investigation_dataset_page import InvestigationDatasetsPage
23+
from playwright.sync_api import Page
24+
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
25+
from pages.screening_subject_search.subject_screening_summary_page import (
26+
SubjectScreeningSummaryPage,
27+
)
28+
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
29+
30+
# This is used to navigate to the investigation datasets page
31+
def go_to_investigation_datasets_page(page: Page, nhs_no) -> None:
32+
"""This is used to navigate to the investigation datasets page
33+
Args:
34+
page (Page): This is the playwright page object
35+
nhs_no (str): The NHS number of the subject
36+
"""
37+
verify_subject_event_status_by_nhs_no(
38+
page, nhs_no, "A323 - Post-investigation Appointment NOT Required"
39+
)
40+
41+
SubjectScreeningSummaryPage(page).click_datasets_link()
42+
SubjectDatasetsPage(page).click_investigation_show_datasets()
43+
44+
45+
# Populate investigation dataset to get HIGH RISK results
46+
def populate_investigation_dataset_high_risk(page: Page) -> None:
47+
"""
48+
This populates the investigation dataset to get HIGH RISK results
49+
50+
Args:
51+
page (Page): This is the playwright page object
52+
"""
53+
# default_investigation_dataset_forms(page)
54+
# InvestigationDatasetsPage(page).select_theraputic_procedure_type()
55+
# default_investigation_dataset_forms_continuation(page)
56+
# investigation_datasets_failure_reason(page)
57+
# polyps_for_high_risk_result(page)
58+
# save_investigation_dataset(page)
59+
# after_high_risk_result(page)
60+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
61+
InvestigationDatasetsPage(page).select_investigation_dataset_type("High Risk")
62+
InvestigationDatasetsPage(page).click_save_button()
63+
64+
65+
# Populate investigation dataset to get LNPCP results
66+
def populate_investigation_dataset_lnpcp(page: Page) -> None:
67+
"""
68+
This populates the investigation dataset to get LNPCP results
69+
70+
Args:
71+
page (Page): This is the playwright page object
72+
"""
73+
# default_investigation_dataset_forms(page)
74+
# InvestigationDatasetsPage(page).select_theraputic_procedure_type()
75+
# default_investigation_dataset_forms_continuation(page)
76+
# investigation_datasets_failure_reason(page)
77+
# polyps_for_lnpcp_result(page)
78+
# save_investigation_dataset(page)
79+
# after_lnpcp_result(page)
80+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
81+
InvestigationDatasetsPage(page).select_investigation_dataset_type("LNPCP")
82+
InvestigationDatasetsPage(page).click_save_button()
83+
84+
85+
# Populate investigation dataset to get NORMAL results
86+
def populate_investigation_dataset_normal(page: Page) -> None:
87+
"""
88+
This populates the investigation dataset to get NORMAL results
89+
90+
Args:
91+
page (Page): This is the playwright page object
92+
"""
93+
# default_investigation_dataset_forms(page)
94+
# InvestigationDatasetsPage(page).select_diagnostic_procedure_type()
95+
# default_investigation_dataset_forms_continuation(page)
96+
# InvestigationDatasetsPage(page).click_show_failure_information()
97+
# InvestigationDatasetsPage(page).select_failure_reasons_option(
98+
# FailureReasonsOptions.NO_FAILURE_REASONS
99+
# )
100+
# save_investigation_dataset(page)
101+
# InvestigationDatasetsPage(page).expect_text_to_be_visible(
102+
# "Normal (No Abnormalities"
103+
# )
104+
InvestigationDatasetsPage(page).click_add_new_investigation_dataset_button()
105+
InvestigationDatasetsPage(page).select_investigation_dataset_type("Normal")
106+
InvestigationDatasetsPage(page).click_save_button()

utils/investigation_dataset_navigation.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)