Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ def __init__(self, page: Page):
self.record_other_post_investigation_contact_button = self.page.get_by_role(
"button", name="Record other post-"
)
self.enter_diagnostic_test_outcome_button = self.page.get_by_role(
"button", name="Enter Diagnostic Test Outcome"
)
self.handover_into_symptomatic_care_button = page.get_by_role(
"button", name="Handover into Symptomatic Care"
)
self.record_diagnosis_date_button = page.get_by_role(
"button", name="Record Diagnosis Date"
)

def click_suitable_for_endoscopic_test_button(self) -> None:
"""Click the 'Suitable for Endoscopic Test' button."""
Expand Down Expand Up @@ -78,3 +87,15 @@ def verify_latest_event_status_value(self, latest_event_status: str) -> None:
def click_record_other_post_investigation_contact_button(self) -> None:
"""Click the 'Record other post-investigation contact' button."""
self.click(self.record_other_post_investigation_contact_button)

def click_enter_diagnostic_test_outcome_button(self) -> None:
"""Click the 'Enter Diagnostic Test Outcome' button."""
self.click(self.enter_diagnostic_test_outcome_button)

def click_handover_into_symptomatic_care_button(self) -> None:
"""Click the 'Handover Into Symptomatic Care' button."""
self.click(self.handover_into_symptomatic_care_button)

def click_record_diagnosis_date_button(self) -> None:
"""Click the 'Record Diagnosis Date' button."""
self.click(self.record_diagnosis_date_button)
18 changes: 10 additions & 8 deletions tests/smokescreen/test_compartment_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from utils.batch_processing import batch_processing
from pages.logout.log_out_page import LogoutPage
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
from pages.screening_subject_search.advance_fobt_screening_episode_page import AdvanceFOBTScreeningEpisodePage


# This should go into a util. Adding it here to avoid SonarQube duplication errors:
Expand Down Expand Up @@ -132,7 +133,8 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:

SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Enter Diagnostic Test Outcome").click()
AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button()

# The following code is on the diagnostic test outcome page
expect(page.get_by_role("cell", name="High-risk findings").nth(1)).to_be_visible()
page.get_by_label("Outcome of Diagnostic Test").select_option("20365")
Expand All @@ -145,7 +147,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Handover into Symptomatic Care").click()
AdvanceFOBTScreeningEpisodePage(page).click_handover_into_symptomatic_care_button()

# The following code is on the handover into symptomatic care page
page.get_by_label("Referral").select_option("20445")
Expand All @@ -172,7 +174,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Record Diagnosis Date").click()
AdvanceFOBTScreeningEpisodePage(page).click_record_diagnosis_date_button()

# The following code is on the record diagnosis date page
page.locator("#diagnosisDate").click()
Expand Down Expand Up @@ -214,7 +216,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Enter Diagnostic Test Outcome").click()
AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button()

# The following code is on the diagnostic test outcome page
expect(page.get_by_role("cell", name="LNPCP").nth(1)).to_be_visible()
Expand All @@ -228,7 +230,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Handover into Symptomatic Care").click()
AdvanceFOBTScreeningEpisodePage(page).click_handover_into_symptomatic_care_button()

# The following code is on the handover into symptomatic care page
page.get_by_label("Referral").select_option("20445")
Expand All @@ -255,7 +257,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Record Diagnosis Date").click()
AdvanceFOBTScreeningEpisodePage(page).click_record_diagnosis_date_button()

# The following code is on the record diagnosis date page
page.locator("#diagnosisDate").click()
Expand Down Expand Up @@ -289,7 +291,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Enter Diagnostic Test Outcome").click()
AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button()

# The following code is on the diagnostic test outcome page
expect(
Expand All @@ -305,7 +307,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

# The following code is on the advance fobt screening episode page
page.get_by_role("button", name="Record Diagnosis Date").click()
AdvanceFOBTScreeningEpisodePage(page).click_record_diagnosis_date_button()

# The following code is on the record diagnosis date page
page.locator("#diagnosisDate").click()
Expand Down