Skip to content

Commit 62ddfc5

Browse files
authored
Feature/bcss 20476 c6 pom advance fobt screening episode (#59)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description c6 pom for advance fobt screening episode ## Context <!-- Why is this change required? What problem does it solve? --> We had some hard coded locators/values in our compartment 6 tests that have been refactored to use a POM <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [x ] Refactoring (non-breaking change) - [x ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x ] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [ x] I have followed the code style of the project - [ ] I have added tests to cover my changes (where appropriate) - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent 6742386 commit 62ddfc5

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

pages/screening_subject_search/advance_fobt_screening_episode_page.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def __init__(self, page: Page):
2828
self.record_other_post_investigation_contact_button = self.page.get_by_role(
2929
"button", name="Record other post-"
3030
)
31+
self.enter_diagnostic_test_outcome_button = self.page.get_by_role(
32+
"button", name="Enter Diagnostic Test Outcome"
33+
)
34+
self.handover_into_symptomatic_care_button = self.page.get_by_role(
35+
"button", name="Handover into Symptomatic Care"
36+
)
37+
self.record_diagnosis_date_button = self.page.get_by_role(
38+
"button", name="Record Diagnosis Date"
39+
)
3140

3241
def click_suitable_for_endoscopic_test_button(self) -> None:
3342
"""Click the 'Suitable for Endoscopic Test' button."""
@@ -78,3 +87,15 @@ def verify_latest_event_status_value(self, latest_event_status: str) -> None:
7887
def click_record_other_post_investigation_contact_button(self) -> None:
7988
"""Click the 'Record other post-investigation contact' button."""
8089
self.click(self.record_other_post_investigation_contact_button)
90+
91+
def click_enter_diagnostic_test_outcome_button(self) -> None:
92+
"""Click the 'Enter Diagnostic Test Outcome' button."""
93+
self.click(self.enter_diagnostic_test_outcome_button)
94+
95+
def click_handover_into_symptomatic_care_button(self) -> None:
96+
"""Click the 'Handover Into Symptomatic Care' button."""
97+
self.click(self.handover_into_symptomatic_care_button)
98+
99+
def click_record_diagnosis_date_button(self) -> None:
100+
"""Click the 'Record Diagnosis Date' button."""
101+
self.click(self.record_diagnosis_date_button)

tests/smokescreen/test_compartment_6.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
PolypInterventionDeviceOptions,
3737
PolypInterventionExcisionTechniqueOptions,
3838
)
39+
from pages.screening_subject_search.advance_fobt_screening_episode_page import (
40+
AdvanceFOBTScreeningEpisodePage,
41+
)
3942

4043

4144
# This should go into a util. Adding it here to avoid SonarQube duplication errors:
@@ -207,7 +210,8 @@ def after_high_risk_result(page: Page) -> None:
207210

208211
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
209212
# The following code is on the advance fobt screening episode page
210-
page.get_by_role("button", name="Enter Diagnostic Test Outcome").click()
213+
AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button()
214+
211215
# The following code is on the diagnostic test outcome page
212216
expect(page.get_by_role("cell", name="High-risk findings").nth(1)).to_be_visible()
213217
page.get_by_label("Outcome of Diagnostic Test").select_option("20365")
@@ -225,7 +229,7 @@ def after_lnpcp_result(page: Page) -> None:
225229
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
226230

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

230234
# The following code is on the diagnostic test outcome page
231235
expect(page.get_by_role("cell", name="LNPCP").nth(1)).to_be_visible()
@@ -314,7 +318,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
314318
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
315319

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

319323
# The following code is on the record diagnosis date page
320324
RecordDiagnosisDatePage(page).enter_date_in_diagnosis_date_field(datetime.today())
@@ -393,7 +397,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
393397
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
394398

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

398402
# The following code is on the diagnostic test outcome page
399403
expect(
@@ -408,7 +412,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
408412
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
409413

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

413417
# The following code is on the record diagnosis date page
414418
RecordDiagnosisDatePage(page).enter_date_in_diagnosis_date_field(datetime.today())

0 commit comments

Comments
 (0)