Skip to content

Commit 6a54a91

Browse files
committed
Updated locators for the subject datasets and added docstrings
1 parent 50ef4a7 commit 6a54a91

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

pages/datasets/subject_datasets_page.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,29 @@ def __init__(self, page: Page):
1111
super().__init__(page)
1212
self.page = page
1313
# Subject datasets page locators
14-
self.colonoscopy_show_dataset_button = self.page.get_by_role(role="link", name="Show Dataset")
14+
self.colonoscopy_show_dataset_button = (
15+
self.page.locator("div")
16+
# Note: The "(1 Dataset)" part of the line below may be dynamic and may change based on the actual dataset count.
17+
.filter(
18+
has_text="Colonoscopy Assessment (1 Dataset) Show Dataset"
19+
).get_by_role("link")
20+
)
21+
self.investigation_show_dataset_button = (
22+
self.page.locator("div")
23+
# Note: The "(1 Dataset)" part of the line below may be dynamic and may change based on the actual dataset count.
24+
.filter(has_text="Investigation (1 Dataset) Show Dataset").get_by_role(
25+
"link"
26+
)
27+
)
1528

1629
def click_colonoscopy_show_datasets(self) -> None:
30+
"""
31+
This method clicks on the 'Show Dataset' button for the Colonoscopy Assessment row on the Subject Datasets Page.
32+
"""
1733
self.click(self.colonoscopy_show_dataset_button)
34+
35+
def click_investigation_show_datasets(self) -> None:
36+
"""
37+
This method clicks on the 'Show Dataset' button for the Investigation row on the Subject Datasets Page.
38+
"""
39+
self.click(self.investigation_show_dataset_button)

tests/smokescreen/test_compartment_5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
8080
CalendarPicker(page).v1_calender_picker(date_from_util)
8181

8282
# Select subject from inital test data util
83-
ScreeningPractitionerDayView(page).click_patient_link("HELPER BACKBONED")
83+
ScreeningPractitionerDayView(page).click_patient_link("DIVIDEND MUZZLE")
8484

8585
# Select Attendance radio button, tick Attended checkbox, set Attended Date to yesterday's (system) date and then press Save
8686
AppointmentDetail(page).check_attendance_radio()
@@ -93,7 +93,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
9393
# Repeat for x Abnormal patients
9494

9595
# Navigate to the 'Subject Screening Summary' screen for the 1st Abnormal patient
96-
nhs_no = "9840589105" # Test NHS NO for CRUMBLE REFUSE
96+
nhs_no = "9852356488" # Test NHS NO for DIVIDEND MUZZLE
9797
verify_subject_event_status_by_nhs_no(
9898
page, nhs_no, "J10 - Attended Colonoscopy Assessment Appointment"
9999
)

0 commit comments

Comments
 (0)