Skip to content

Commit f50b2c4

Browse files
Merge branch 'main' of github.com:NHSDigital/bcss-playwright into feature/BCSS-20517-dynamic-css-locators
2 parents d50f57a + 276d1bf commit f50b2c4

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
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: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010
from pages.logout.log_out_page import LogoutPage
1111
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
1212
from pages.screening_subject_search.handover_into_symptomatic_care_page import (
13-
HandoverIntoSymptomaticCarePage
13+
HandoverIntoSymptomaticCarePage,
1414
)
1515
from utils.calendar_picker import CalendarPicker
1616
from datetime import datetime
1717
from pages.screening_subject_search.record_diagnosis_date_page import (
1818
RecordDiagnosisDatePage,
1919
)
2020
from pages.screening_subject_search.diagnostic_test_outcome_page import (
21-
DiagnosticTestOutcomePage,OutcomeOfDiagnosticTest
21+
DiagnosticTestOutcomePage,
22+
OutcomeOfDiagnosticTest,
2223
)
24+
from pages.datasets.subject_datasets_page import SubjectDatasetsPage
2325
from pages.datasets.investigation_dataset_page import (
2426
InvestigationDatasetsPage,
2527
SiteLookupOptions,
@@ -232,7 +234,7 @@ def after_high_risk_result(page: Page) -> None:
232234
BasePage(page).click_back_button()
233235

234236
# The following code is on the subject datasets page
235-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
237+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
236238
BasePage(page).click_back_button()
237239

238240
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
@@ -241,15 +243,18 @@ def after_high_risk_result(page: Page) -> None:
241243

242244
# The following code is on the diagnostic test outcome page
243245
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome("High-risk findings")
244-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.REFER_SURVEILLANCE)
246+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
247+
OutcomeOfDiagnosticTest.REFER_SURVEILLANCE
248+
)
245249
DiagnosticTestOutcomePage(page).click_save_button()
246250

251+
247252
def after_lnpcp_result(page: Page) -> None:
248253
InvestigationDatasetsPage(page).expect_text_to_be_visible("LNPCP")
249254
BasePage(page).click_back_button()
250255

251256
# The following code is on the subject datasets page
252-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
257+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
253258
BasePage(page).click_back_button()
254259

255260
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
@@ -259,9 +264,12 @@ def after_lnpcp_result(page: Page) -> None:
259264

260265
# The following code is on the diagnostic test outcome page
261266
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome("LNPCP")
262-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.REFER_SURVEILLANCE)
267+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
268+
OutcomeOfDiagnosticTest.REFER_SURVEILLANCE
269+
)
263270
DiagnosticTestOutcomePage(page).click_save_button()
264271

272+
265273
def handover_subject_to_symptomatic_care(page: Page) -> None:
266274
SubjectScreeningSummaryPage(page).verify_latest_event_status_value(
267275
"A394 - Handover into Symptomatic Care for Surveillance - Patient Age"
@@ -303,7 +311,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
303311

304312
# This needs to be repeated for two subjects, one old and one not - High Risk Result
305313
# Older patient
306-
nhs_no = "9772286785"
314+
nhs_no = "9707238623"
307315
go_to_investigation_datasets_page(page, nhs_no)
308316

309317
# The following code is on the investigation datasets page
@@ -318,7 +326,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
318326
handover_subject_to_symptomatic_care(page)
319327

320328
# Younger patient
321-
nhs_no = "9802397318"
329+
nhs_no = "9526262042"
322330
go_to_investigation_datasets_page(page, nhs_no)
323331

324332
# The following code is on the investigation datasets page
@@ -348,7 +356,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
348356

349357
# This needs to be repeated for two subjects, one old and one not - LNPCP Result
350358
# Older patient
351-
nhs_no = "9359523194"
359+
nhs_no = "9764755232"
352360
go_to_investigation_datasets_page(page, nhs_no)
353361

354362
# The following code is on the investigation datasets page
@@ -363,7 +371,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
363371
handover_subject_to_symptomatic_care(page)
364372

365373
# Younger patient
366-
nhs_no = "9828941813"
374+
nhs_no = "9680451623"
367375
go_to_investigation_datasets_page(page, nhs_no)
368376

369377
# The following code is on the investigation datasets page
@@ -391,7 +399,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
391399
)
392400

393401
# This needs to be repeated for 1 subject, age does not matter - Normal Result
394-
nhs_no_normal = "9852356488"
402+
nhs_no_normal = "9823638365"
395403
go_to_investigation_datasets_page(page, nhs_no_normal)
396404

397405
# The following code is on the investigation datasets page
@@ -409,7 +417,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
409417
BasePage(page).click_back_button()
410418

411419
# The following code is on the subject datasets page
412-
expect(page.get_by_text("** Completed **").nth(1)).to_be_visible()
420+
SubjectDatasetsPage(page).check_investigation_dataset_complete()
413421
BasePage(page).click_back_button()
414422

415423
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
@@ -421,7 +429,9 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
421429
DiagnosticTestOutcomePage(page).verify_diagnostic_test_outcome(
422430
"Normal (No Abnormalities"
423431
)
424-
DiagnosticTestOutcomePage(page).select_test_outcome_option(OutcomeOfDiagnosticTest.INVESTIGATION_COMPLETE)
432+
DiagnosticTestOutcomePage(page).select_test_outcome_option(
433+
OutcomeOfDiagnosticTest.INVESTIGATION_COMPLETE
434+
)
425435
DiagnosticTestOutcomePage(page).click_save_button()
426436

427437
SubjectScreeningSummaryPage(page).verify_latest_event_status_value(

0 commit comments

Comments
 (0)