Skip to content

Commit cd518a5

Browse files
authored
Feature/bcss 21307 fobt regression tests scenario 5 (#135)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Covers the selenium to playwright migration of the fobt regression scenario 5 tests, plus the creation of any relevant POMs and utils. ## Context <!-- Why is this change required? What problem does it solve? --> This is part of the selenium to playwright migration work. ## 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 - [x] 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: AndyG <[email protected]>
1 parent c333f93 commit cd518a5

File tree

8 files changed

+442
-11
lines changed

8 files changed

+442
-11
lines changed

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,5 @@ cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:
224224
cae84544e2852202f5d0abb9ad18f9d83a0c6d80:subject_criteria_builder/criteria.json:generic-api-key:4210
225225
203cd8811be75d33859eb7c7cc8a48beb5a2b8b2:subject_criteria_builder/criteria.json:generic-api-key:4210
226226
60468a7d6f3ff3259616757be85d6f07e62d00b6:subject_criteria_builder/criteria.json:generic-api-key:4210
227+
145171b9e9d169acb136fc527708c997c9ad9f61:subject_criteria_builder/criteria.json:generic-api-key:4210
227228
2ccb5e91033934d4818c1efa2eb1696b5511ebc9:subject_criteria_builder/criteria.json:generic-api-key:4210

pages/screening_subject_search/episode_events_and_notes_page.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ def __init__(self, page: Page):
99
super().__init__(page)
1010
self.page = page
1111
# List of episode events and notes - page locators
12-
self.view_appointment_link = self.page.get_by_role(
13-
"link", name="View Appointment"
14-
)
12+
self.most_recent_view_appointment_link = self.page.get_by_role(
13+
"link", name="View Appointment"
14+
).nth(0)
1515

1616
def expected_episode_event_is_displayed(self, event_description: str) -> None:
1717
"""Check if the expected episode event is displayed on the page."""
1818
expect(
1919
self.page.get_by_role("cell", name=event_description, exact=True)
2020
).to_be_visible()
2121

22-
def click_view_appointment_link(self) -> None:
22+
def click_most_recent_view_appointment_link(self) -> None:
2323
"""Click the 'View Appointment' link"""
24-
self.click(self.view_appointment_link)
24+
self.click(self.most_recent_view_appointment_link)

tests/regression/regression_tests/fobt_regression_tests/test_scenario_3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_scenario_3(page: Page) -> None:
254254
SubjectScreeningSummaryPage(page).click_first_fobt_episode_link()
255255

256256
# And I view the latest practitioner appointment in the subject's episode
257-
EpisodeEventsAndNotesPage(page).click_view_appointment_link()
257+
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
258258

259259
# And The Screening Centre cancels the practitioner appointment with reason "Screening Centre Cancelled - Other Reason"
260260
AppointmentDetailPage(page).check_cancel_radio()
@@ -482,7 +482,7 @@ def cancel_appointment_and_processes_batches(page: Page, nhs_no: str) -> None:
482482
SubjectScreeningSummaryPage(page).click_first_fobt_episode_link()
483483

484484
# And I view the latest practitioner appointment in the subject's episode
485-
EpisodeEventsAndNotesPage(page).click_view_appointment_link()
485+
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
486486

487487
# And The subject cancels the practitioner appointment with reason "Patient Cancelled to Consider"
488488
AppointmentDetailPage(page).check_cancel_radio()

tests/regression/regression_tests/fobt_regression_tests/test_scenario_4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def test_scenario_4(page: Page) -> None:
332332
SubjectScreeningSummaryPage(page).click_first_fobt_episode_link()
333333

334334
# And I view the latest practitioner appointment in the subject's episode
335-
EpisodeEventsAndNotesPage(page).click_view_appointment_link()
335+
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
336336

337337
# And the subject cancels the practitioner appointment with reason "Patient Cancelled to Consider"
338338
AppointmentDetailPage(page).check_cancel_radio()
@@ -412,7 +412,7 @@ def test_scenario_4(page: Page) -> None:
412412
SubjectScreeningSummaryPage(page).click_first_fobt_episode_link()
413413

414414
# And I view the latest practitioner appointment in the subject's episode
415-
EpisodeEventsAndNotesPage(page).click_view_appointment_link()
415+
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
416416

417417
# And the subject cancels the practitioner appointment with reason "Patient Unsuitable - Recently Screened"
418418
AppointmentDetailPage(page).check_cancel_radio()

0 commit comments

Comments
 (0)