Skip to content

Commit 011f408

Browse files
authored
Feature/bcss 20326 compartment5 pom for screening practitioner day view (#35)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description Adding new POMs for the Screening Practitioner Day view page ## Context New POMs for the advance Screening Practitioner Day view 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 e3ab573 commit 011f408

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from playwright.sync_api import Page
2+
from pages.base_page import BasePage
3+
4+
class ScreeningPractitionerDayView(BasePage):
5+
def __init__(self, page: Page):
6+
super().__init__(page)
7+
self.page = page
8+
# Screening Practitioner Day View - page locators
9+
self.calendar_button = page.get_by_role("button", name="Calendar")
10+
11+
def click_calendar_button(self) -> None:
12+
self.click(self.calendar_button)
13+
14+
def click_patient_link(self, patient_name: str) -> None:
15+
self.click(self.page.get_by_role("link", name=patient_name))

tests/smokescreen/test_compartment_5.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from pages.screening_subject_search.subject_screening_summary import (
99
SubjectScreeningSummary,
1010
)
11+
from pages.screening_practitioner_appointments.screening_practitioner_day_view import (
12+
ScreeningPractitionerDayView,
13+
)
1114
from utils.user_tools import UserTools
1215
from utils.load_properties_file import PropertiesFile
1316
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
@@ -51,12 +54,12 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
5154
page.locator("#UI_SITE").select_option(label="The Royal Hospital (Wolverhampton)")
5255

5356
page.get_by_role("button", name="View appointments on this day").click()
54-
page.get_by_role("button", name="Calendar").click()
57+
ScreeningPractitionerDayView(page).click_calendar_button()
5558
date_from_util = datetime(2025, 4, 29)
5659
CalendarPicker(page).v1_calender_picker(date_from_util)
5760

5861
# Select subject from inital test data util
59-
page.get_by_role("link", name="DELIRIOUS DELUXE").click()
62+
ScreeningPractitionerDayView(page).click_patient_link("STARLESS BLUSH")
6063

6164
# Select Attendance radio button, tick Attended checkbox, set Attended Date to yesterday's (system) date and then press Save
6265
page.get_by_role("radio", name="Attendance").check()

0 commit comments

Comments
 (0)