Skip to content

Commit bbe44a9

Browse files
mepr1Andyg79
authored andcommitted
Feature/bcss 20537 c6 pom subject datasets page (#70)
<!-- markdownlint-disable-next-line first-line-heading --> POM for subject dataset page <!-- Describe your changes in detail. --> Added a function to the subject dataset page so that some of the lines in C6 can be refactored. ## 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 b277d91 commit bbe44a9

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

pages/datasets/subject_datasets_page.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from playwright.sync_api import Page
1+
from playwright.sync_api import Page, expect
22
from pages.base_page import BasePage
33

44

@@ -31,3 +31,15 @@ def click_colonoscopy_show_datasets(self) -> None:
3131
def click_investigation_show_datasets(self) -> None:
3232
"""Clicks on the 'Show Dataset' button for the Investigation row on the Subject Datasets Page."""
3333
self.click(self.investigation_show_dataset_button)
34+
35+
def check_investigation_dataset_complete(self) -> None:
36+
"""
37+
Verify that the investigation dataset is marked as complete.
38+
39+
"""
40+
expect(
41+
self.page.locator(
42+
"h4:has-text('Investigation') span.softHighlight",
43+
has_text="** Completed **",
44+
)
45+
).to_be_visible()

tests/smokescreen/test_compartment_6.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
DiagnosticTestOutcomePage,
2222
OutcomeOfDiagnosticTest,
2323
)
24+
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
2425
from pages.datasets.investigation_dataset_page import (
2526
InvestigationDatasetsPage,
2627
SiteLookupOptions,
@@ -212,7 +213,7 @@ def after_high_risk_result(page: Page) -> None:
212213
BasePage(page).click_back_button()
213214

214215
# The following code is on the subject datasets page
215-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
216+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
216217
BasePage(page).click_back_button()
217218

218219
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
@@ -232,7 +233,7 @@ def after_lnpcp_result(page: Page) -> None:
232233
BasePage(page).click_back_button()
233234

234235
# The following code is on the subject datasets page
235-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
236+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
236237
BasePage(page).click_back_button()
237238

238239
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
@@ -289,7 +290,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
289290

290291
# This needs to be repeated for two subjects, one old and one not - High Risk Result
291292
# Older patient
292-
nhs_no = "9772286785"
293+
nhs_no = "9707238623"
293294
go_to_investigation_datasets_page(page, nhs_no)
294295

295296
# The following code is on the investigation datasets page
@@ -304,7 +305,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
304305
handover_subject_to_symptomatic_care(page)
305306

306307
# Younger patient
307-
nhs_no = "9802397318"
308+
nhs_no = "9526262042"
308309
go_to_investigation_datasets_page(page, nhs_no)
309310

310311
# The following code is on the investigation datasets page
@@ -334,7 +335,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
334335

335336
# This needs to be repeated for two subjects, one old and one not - LNPCP Result
336337
# Older patient
337-
nhs_no = "9359523194"
338+
nhs_no = "9764755232"
338339
go_to_investigation_datasets_page(page, nhs_no)
339340

340341
# The following code is on the investigation datasets page
@@ -349,7 +350,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
349350
handover_subject_to_symptomatic_care(page)
350351

351352
# Younger patient
352-
nhs_no = "9828941813"
353+
nhs_no = "9680451623"
353354
go_to_investigation_datasets_page(page, nhs_no)
354355

355356
# The following code is on the investigation datasets page
@@ -377,7 +378,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
377378
)
378379

379380
# This needs to be repeated for 1 subject, age does not matter - Normal Result
380-
nhs_no_normal = "9852356488"
381+
nhs_no_normal = "9823638365"
381382
go_to_investigation_datasets_page(page, nhs_no_normal)
382383

383384
# The following code is on the investigation datasets page
@@ -395,7 +396,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
395396
BasePage(page).click_back_button()
396397

397398
# The following code is on the subject datasets page
398-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
399+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
399400
BasePage(page).click_back_button()
400401

401402
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()

0 commit comments

Comments
 (0)