Skip to content

Commit f592406

Browse files
Merge branch 'main' of github.com:NHSDigital/bcss-playwright into feature/BCSS-20363-compartment-5-pom-advance-fobt-screening-episode-page
# Conflicts: # tests/smokescreen/test_compartment_5.py
2 parents 5b9c4cc + 011f408 commit f592406

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
@@ -11,6 +11,9 @@
1111
from pages.screening_subject_search.advance_fobt_screening_episode_page import (
1212
AdvanceFOBTScreeningEpisode,
1313
)
14+
from pages.screening_practitioner_appointments.screening_practitioner_day_view import (
15+
ScreeningPractitionerDayView,
16+
)
1417
from utils.user_tools import UserTools
1518
from utils.load_properties_file import PropertiesFile
1619
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
@@ -54,12 +57,12 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
5457
page.locator("#UI_SITE").select_option(label="The Royal Hospital (Wolverhampton)")
5558

5659
page.get_by_role("button", name="View appointments on this day").click()
57-
page.get_by_role("button", name="Calendar").click()
60+
ScreeningPractitionerDayView(page).click_calendar_button()
5861
date_from_util = datetime(2025, 4, 29)
5962
CalendarPicker(page).v1_calender_picker(date_from_util)
6063

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

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

0 commit comments

Comments
 (0)