Skip to content

Commit 9678251

Browse files
Fix: [AEA-5516] - Fixed tracker details page items tests (#415)
## Summary - Routine Change ### Details Also fixed display names of medications for generated and dispensed prescriptions.
1 parent 9dc09e2 commit 9678251

File tree

5 files changed

+8
-55
lines changed

5 files changed

+8
-55
lines changed

features/cpts_ui/prescription_detail.feature

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ Feature: Prescription Detail Page in the Clinical Prescription Tracker Service
3838
And The dispenser site card is visible
3939
And The nominated dispenser site card is visible
4040

41-
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4799
42-
@skip # can't make multi item prescriptions as it stands
43-
Scenario: User sees both prescribed and dispensed item cards
44-
Given a new prescription has been dispensed
45-
When I go to the prescription details
46-
Then The prescribed items card is visible
47-
And The dispensed items card is visible
48-
4941
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4799
5042
Scenario: User sees EPS status tag on item card
5143
Given a nominated acute prescription has been created
@@ -57,24 +49,13 @@ Feature: Prescription Detail Page in the Clinical Prescription Tracker Service
5749
Given a nominated acute prescription has been created and released
5850
And the prescription has been cancelled
5951
When I go to the prescription details
60-
Then The prescribed items card is visible
61-
And The dispensed items card is not visible
62-
And A prescribed item card shows a cancellation warning
63-
64-
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4799
65-
@skip # can't dispense a different item to the original prescription as it stands
66-
Scenario: User sees only dispensed item cards, with expandable and status tag
67-
Given a new prescription has been dispensed
68-
When I go to the prescription details
69-
Then The prescribed items card is not visible
70-
And The dispensed items card is visible
71-
And A dispensed item card has expandable initial prescription
52+
Then An item card shows a cancellation warning
7253

7354
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4799
74-
Scenario: Dispensed item cards do not show pharmacy status when it is missing
55+
Scenario: Item cards do not show pharmacy status when it is missing
7556
Given a new prescription has been dispensed
7657
When I go to the prescription details
77-
Then No pharmacy status label is shown in the dispensed item card
58+
Then No pharmacy status label is shown in the item card
7859

7960
@allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4801
8061
Scenario: User sees message history with dispense notification dropdown

features/steps/cpts_ui/prescription_details_steps.py

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,20 @@ def site_card_visibility_check(context, org, visibility):
7070
raise ValueError(f"Unrecognised visibility definition: {visibility}")
7171

7272

73-
@then("The {type} items card is {visibility}")
74-
def item_card_visibility(context, type, visibility):
75-
header_text = "Dispensed items" if type == "dispensed" else "Prescribed items"
76-
section = context.page.get_by_role("heading", name=header_text)
77-
78-
if visibility == "visible":
79-
expect(section).to_be_visible()
80-
elif visibility == "not visible":
81-
expect(section).not_to_be_visible()
82-
else:
83-
raise ValueError(f"Invalid visibility: {visibility}")
84-
85-
8673
@then("An item card shows an EPS status tag")
8774
def item_card_eps_status_tag(context):
8875
page = PrescriptionDetailsPage(context.page)
8976

9077
expect(page.eps_status_tag.first).to_be_visible()
9178

9279

93-
@then("A prescribed item card shows a cancellation warning")
94-
def prescribed_item_card_cancellation_warning(context):
80+
@then("An item card shows a cancellation warning")
81+
def item_card_cancellation_warning(context):
9582
warning = context.page.get_by_text("This item is pending cancellation.").first
9683
expect(warning).to_be_visible()
9784

9885

99-
@then("A dispensed item card has expandable initial prescription")
100-
def dispensed_item_has_expandable_details(context):
101-
page = PrescriptionDetailsPage(context.page)
102-
103-
expander = page.initial_prescription_details
104-
expander.click()
105-
106-
details_summary_list = page.initial_prescription_summary
107-
expect(details_summary_list).to_be_visible()
108-
109-
110-
@then("No pharmacy status label is shown in the dispensed item card")
86+
@then("No pharmacy status label is shown in the item card")
11187
def no_pharmacy_status_labels(context):
11288
page = PrescriptionDetailsPage(context.page)
11389

messages/eps_fhir/dispense_notification.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def medication_dispense(self, practitioner_role, medication_request):
195195
{
196196
"system": self.HTTP_SNOMED_INFO_SCT,
197197
"code": "322237000",
198+
"display": "Paracetamol 500mg soluble tablet (product)",
198199
}
199200
]
200201
},

messages/eps_fhir/prescription.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def create_medication_request(self):
151151
{
152152
"system": "http://snomed.info/sct", # http only
153153
"code": "322237000",
154+
"display": "Paracetamol 500mg soluble tablet (product)",
154155
}
155156
]
156157
},

pages/prescription_details.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ def __init__(self, page: Page):
2929

3030
# Summary details
3131
self.prescription_summary = page.get_by_test_id("prescription-summary-list")
32-
self.initial_prescription_details = page.get_by_test_id(
33-
"initial-prescription-details"
34-
)
35-
self.initial_prescription_summary = page.get_by_test_id(
36-
"initial-prescription-summary-list"
37-
)
3832

3933
# EPS status tag
4034
self.eps_status_tag = page.get_by_test_id("eps-status-tag")

0 commit comments

Comments
 (0)