Skip to content

Commit e3ab573

Browse files
Adding POMs for Subject Screening Summary page (#32)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Adding new POMs for the subject screening summary page ## Context <!-- Why is this change required? What problem does it solve? --> New POMs for the subject screening summary page that can be reused across tests ## Type of changes <!-- 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 ff94477 commit e3ab573

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

pages/screening_subject_search/subject_screening_summary.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def __init__(self, page: Page):
4848
self.first_fobt_episode_link = page.get_by_role(
4949
"link", name="FOBT Screening"
5050
).first
51+
self.datasets_link = self.page.get_by_role("link", name="Datasets")
52+
self.advance_fobt_screening_episode_button = self.page.get_by_role(
53+
"button", name="Advance FOBT Screening Episode"
54+
)
5155

5256
def verify_result_contains_text(self, text) -> None:
5357
expect(self.display_rs).to_contain_text(text)
@@ -122,6 +126,12 @@ def expand_episodes_list(self) -> None:
122126
def click_first_fobt_episode_link(self) -> None:
123127
self.click(self.first_fobt_episode_link)
124128

129+
def click_datasets_link(self) -> None:
130+
self.click(self.datasets_link)
131+
132+
def click_advance_fobt_screening_episode_button(self) -> None:
133+
self.click(self.advance_fobt_screening_episode_button)
134+
125135

126136
class ChangeScreeningStatusOptions(Enum):
127137
SEEKING_FURTHER_DATA = "4007"

tests/smokescreen/test_compartment_5.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
5252

5353
page.get_by_role("button", name="View appointments on this day").click()
5454
page.get_by_role("button", name="Calendar").click()
55-
date_from_util = datetime(2025, 4, 28)
55+
date_from_util = datetime(2025, 4, 29)
5656
CalendarPicker(page).v1_calender_picker(date_from_util)
5757

5858
# Select subject from inital test data util
59-
page.get_by_role("link", name="HAT-PIN UNTRUTH").click()
59+
page.get_by_role("link", name="DELIRIOUS DELUXE").click()
6060

6161
# Select Attendance radio button, tick Attended checkbox, set Attended Date to yesterday's (system) date and then press Save
6262
page.get_by_role("radio", name="Attendance").check()
@@ -69,13 +69,13 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
6969
# Repeat for x Abnormal patients
7070

7171
# Navigate to the 'Subject Screening Summary' screen for the 1st Abnormal patient
72-
nhs_no = "9543076472" # Test NHS NO for Scaliding Cod
72+
nhs_no = "9937265193" # Test NHS NO for Scaliding Cod
7373
verify_subject_event_status_by_nhs_no(
7474
page, nhs_no, "J10 - Attended Colonoscopy Assessment Appointment"
7575
)
7676

7777
# Click on 'Datasets' link
78-
page.get_by_role("link", name="Datasets").click()
78+
SubjectScreeningSummary(page).click_datasets_link()
7979

8080
# Click on 'Show Dataset' next to the Colonoscopy Assessment
8181

@@ -100,7 +100,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
100100

101101
# On the Subject Screening Summary click on the 'Advance FOBT Screening Episode' button and then click on the 'Suitable for Endoscopic Test' button
102102
# Click OK after message
103-
page.get_by_role("button", name="Advance FOBT Screening Episode").click()
103+
SubjectScreeningSummary(page).click_advance_fobt_screening_episode_button()
104104
page.once("dialog", lambda dialog: dialog.accept())
105105
page.get_by_role("button", name="Suitable for Endoscopic Test").click()
106106

@@ -136,7 +136,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
136136
verify_subject_event_status_by_nhs_no(
137137
page, nhs_no, "A259 - Attended Diagnostic Test"
138138
)
139-
page.get_by_role("button", name="Advance FOBT Screening Episode").click()
139+
SubjectScreeningSummary(page).click_advance_fobt_screening_episode_button()
140140

141141
# Click 'Other Post-investigation Contact Required' button
142142
# Click 'OK'

0 commit comments

Comments
 (0)