Skip to content

Commit 1fc3f41

Browse files
authored
Chore: [AEA-4786] - Patient details banner (#276)
## Summary - Routine Change ### Details Adds placeholder regression tests for the patient details banner. Waiting on a flow that gets patient data before these will pass
1 parent bbb6fcf commit 1fc3f41

File tree

6 files changed

+81
-3
lines changed

6 files changed

+81
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@cpts_ui @patient_detail_banner @regression @blocker @smoke @ui
2+
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-5061
3+
Feature: The site has a patient detail banner
4+
5+
Background:
6+
Given I am logged in as a user with multiple access roles
7+
And I have confirmed a role
8+
9+
Scenario: Before I search for a prescription, the patient details banner is not visible
10+
When I go to the search for a prescription page
11+
Then I am on the search for a prescription page
12+
And the patient details banner is not visible
13+
14+
Scenario: When I search for a prescription, and go back, the patient details banner is not visible
15+
When I go to the search for a prescription page
16+
And I click on tab Prescription ID search
17+
And I search for a prescription using a valid prescription ID "C0C757-A83008-A1234O"
18+
And I click the Go Back link on the prescription not found page
19+
Then The patient details banner is not visible
20+
21+
# FIXME: This will need to be updated when the search pages are updated
22+
Scenario: When I search for a prescription, the patient details appear
23+
When I go to the search for a prescription page
24+
And I click on tab Prescription ID search
25+
And I search for a prescription using a valid prescription ID "C0C757-A83008-C2D93O"
26+
Then The patient details banner reports complete data
27+
28+
# TODO: Can we set a prescription with incomplete patient data?
29+
Scenario: When I search for a prescription with incomplete data, the patient detail banner is formatted correctly
30+
When I go to the search for a prescription page
31+
And I click on tab Prescription ID search
32+
And I search for a prescription using a valid prescription ID "209E3D-A83008-327F9F"
33+
Then The patient details banner reports incomplete data

features/cpts_ui/prescription_list.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Feature: Prescription List Page in the Clinical Prescription Tracker Service
1212
And I can see the results count message
1313

1414
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4778
15-
@testme
1615
Scenario: Back link navigates to appropriate search tab when accessed from prescription ID search
1716
Given I am logged in as a user with a single access role
1817
And I am on the search for a prescription page

features/cpts_ui/search_for_a_prescription.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Feature: I can visit the Clinical Prescription Tracker Service Website
3939
When I am on the search for a prescription page
4040
And I click on tab Prescription ID search
4141
# Search for a prescription ID that DOES NOT return anything
42-
And I search for a prescription using a valid prescription ID "209E3D-A83008-327F9F"
42+
And I search for a prescription using a valid prescription ID "209E3D-A83008-328F9F"
4343
Then I am on the prescription not found page with redirect to PrescriptionIdSearch
4444

4545
# TODO: Update this test when the NHS number search is implemented
@@ -58,7 +58,7 @@ Feature: I can visit the Clinical Prescription Tracker Service Website
5858
When I am on the search for a prescription page
5959
And I click on tab Prescription ID search
6060
# Search for a prescription ID that DOES NOT return anything
61-
And I search for a prescription using a valid prescription ID "209E3D-A83008-327F9F"
61+
And I search for a prescription using a valid prescription ID "209E3D-A83008-328F9F"
6262
And I click the Go Back link on the prescription not found page
6363
Then I am on tab Prescription ID search
6464

features/steps/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
from cpts_ui.select_your_role_steps import * # noqa: F403,F401
99
from cpts_ui.your_selected_role_steps import * # noqa: F403,F401
1010
from cpts_ui.page_not_found_steps import * # noqa: F403,F401
11+
from cpts_ui.patient_details_banner import * # noqa: F403,F401
1112
from cpts_ui.prescription_list_steps import * # noqa: F403,F401
1213
from cpts_ui.prescription_not_found_page_steps import * # noqa: F403,F401
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# pylint: disable=no-name-in-module
2+
from behave import then # pyright: ignore [reportAttributeAccessIssue]
3+
from playwright.sync_api import expect
4+
5+
from pages.patient_details_banner import PatientDetailsBanner
6+
7+
8+
############################################################################
9+
# THEN STEPS
10+
############################################################################
11+
12+
13+
@then("The patient details banner is not visible")
14+
def patient_details_not_visible(context):
15+
banner = PatientDetailsBanner(context.page)
16+
17+
expect(banner.patient_details_banner).not_to_be_visible()
18+
19+
20+
@then("The patient details banner reports complete data")
21+
def i_can_not_see_the_rbac_banner(context):
22+
banner = PatientDetailsBanner(context.page)
23+
24+
expect(banner.patient_details_banner).to_be_visible()
25+
expect(banner.patient_details_banner).not_to_have_class(banner.incomplete_class)
26+
27+
28+
@then("The patient details banner reports incomplete data")
29+
def the_patient_details_banner_reports_incomplete_data(context):
30+
banner = PatientDetailsBanner(context.page)
31+
32+
expect(banner.patient_details_banner).to_be_visible()
33+
expect(banner.patient_details_banner).to_have_class(banner.incomplete_class)

pages/patient_details_banner.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from playwright.sync_api import Page
2+
import re
3+
4+
5+
class PatientDetailsBanner:
6+
def __init__(self, page: Page):
7+
self.page = page
8+
9+
self.patient_details_banner = page.get_by_test_id("patient-details-banner")
10+
11+
# This has to match the class with regex
12+
self.incomplete_class = re.compile(".*patient-details-partial-data.*")

0 commit comments

Comments
 (0)