Skip to content

Commit 9f1f477

Browse files
Feature/bcss 22026 surveillanceregressiontests scenario 13 (#167)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Migrating scenario 13 of SurveillanceRegressionTests ## Context <!-- Why is this change required? What problem does it solve? --> Migrating scenario 13 of SurveillanceRegressionTests ## 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 - [x] I have added tests to cover my changes (where appropriate) - [x] 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. --------- Signed-off-by: adrianoaru-nhs <[email protected]>
1 parent 85d1eac commit 9f1f477

File tree

4 files changed

+735
-4
lines changed

4 files changed

+735
-4
lines changed

pages/datasets/investigation_dataset_page.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ def click_edit_dataset_button(self) -> None:
491491
This method is designed to click on the edit dataset button.
492492
It clicks on the edit dataset button.
493493
"""
494-
self.click(self.edit_dataset_button)
494+
if self.edit_dataset_button.is_visible():
495+
self.click(self.edit_dataset_button)
495496

496497
def assert_polyp_algorithm_size(
497498
self, polyp_number: int, expected_value: Optional[str]

pages/datasets/subject_datasets_page.py

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

44

@@ -22,11 +22,16 @@ def __init__(self, page: Page):
2222
.get_by_role("link")
2323
)
2424
self.add_link = self.page.get_by_role("link", name="Add")
25+
self.view_link = self.page.get_by_role("link", name="View")
2526

2627
def click_add_link(self) -> None:
2728
"""Clicks on the first 'Add' link on the Subject Datasets Page."""
2829
self.click(self.add_link.first)
2930

31+
def click_view_link(self) -> None:
32+
"""Clicks on the first 'View' link on the Subject Datasets Page."""
33+
self.click(self.view_link.first)
34+
3035
def click_colonoscopy_show_datasets(self) -> None:
3136
"""
3237
Clicks on the 'Show Dataset(s)' button for the Colonoscopy Assessment row on the Subject Datasets Page.
@@ -64,9 +69,19 @@ def click_show_datasets_button(self, header: Locator) -> None:
6469
show_link = container.locator("a:has-text('Show Dataset')")
6570
show_link.wait_for(state="visible", timeout=10000)
6671
self.click(show_link)
67-
# If plural, also click Add
72+
# If plural, also click Add or View depending on visibility
6873
if dataset_count_text and "Datasets" in dataset_count_text:
69-
self.click_add_link()
74+
try:
75+
self.add_link.first.wait_for(state="visible", timeout=2000)
76+
self.click_add_link()
77+
except TimeoutError:
78+
try:
79+
self.view_link.first.wait_for(state="visible", timeout=2000)
80+
self.click_view_link()
81+
except Exception:
82+
raise TimeoutError(
83+
"Neither 'Add' nor 'View' link was found after clicking 'Show Datasets'."
84+
)
7085

7186
def check_investigation_dataset_complete(self) -> None:
7287
"""

pages/screening_subject_search/diagnostic_test_outcome_page.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class OutcomeOfDiagnosticTest(StrEnum):
154154
REFER_SURVEILLANCE = "20365"
155155
INVESTIGATION_COMPLETE = "20360"
156156
REFER_ANOTHER_DIAGNOSTIC_TEST = "20364"
157+
REFER_MDT = "20367"
157158

158159

159160
class ReasonForSymptomaticReferral(StrEnum):

0 commit comments

Comments
 (0)