Skip to content

Commit bb11e9a

Browse files
New: [AEA-6037] - Introduce PFP on Proxygen tests using a unique product ID (#526)
## Summary - ✨ New Feature ### Details Add in PFP-Proxygen product & feature set for temporary base path. --------- Signed-off-by: Connor Avery <[email protected]>
1 parent 5abd78a commit bb11e9a

File tree

4 files changed

+94
-12
lines changed

4 files changed

+94
-12
lines changed

.github/workflows/regression_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- EPS-FHIR-PRESCRIBING
2323
- EPS-FHIR-DISPENSING
2424
- PFP-APIGEE
25+
- PFP-PROXYGEN
2526
- PFP-AWS
2627
- PSU
2728
- EPS-ASSIST-ME

features/environment.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
EPS_FHIR_PRESCRIBING_SUFFIX = "fhir-prescribing"
162162
EPS_FHIR_DISPENSING_SUFFIX = "fhir-dispensing"
163163
PFP_SUFFIX = "prescriptions-for-patients"
164+
PFP_PROXYGEN_SUFFIX = "pfp-proxygen"
164165
PSU_SUFFIX = "prescription-status-update"
165166

166167
EPSAM_SLACKBOT_FUNCTION_EXPORT_NAME = (
@@ -361,12 +362,19 @@ def before_all(context):
361362
context.eps_fhir_dispensing_base_url = os.path.join(
362363
select_apigee_base_url(env), EPS_FHIR_DISPENSING_SUFFIX
363364
)
364-
context.pfp_base_url = os.path.join(select_apigee_base_url(env), PFP_SUFFIX)
365365
context.psu_base_url = os.path.join(select_apigee_base_url(env), PSU_SUFFIX)
366366
context.cpts_fhir_base_url = os.path.join(
367367
select_apigee_base_url(env), CPTS_FHIR_SUFFIX
368368
)
369369

370+
if "PFP-PROXYGEN" in product:
371+
# Don't use PFP-PROXYGEN AND PFP-APIGEE TOGETHER
372+
context.pfp_base_url = os.path.join(
373+
select_apigee_base_url(env), PFP_PROXYGEN_SUFFIX
374+
)
375+
else:
376+
context.pfp_base_url = os.path.join(select_apigee_base_url(env), PFP_SUFFIX)
377+
370378
get_function_export_name(context)
371379

372380
if PULL_REQUEST_ID and env != "LOCALHOST":
@@ -435,6 +443,10 @@ def get_url_with_pr(context, env, product):
435443
context.pfp_base_url = os.path.join(
436444
INTERNAL_DEV_BASE_URL, f"{PFP_SUFFIX}-{pull_request_id}"
437445
)
446+
if product == "PFP-PROXYGEN":
447+
context.pfp_base_url = os.path.join(
448+
INTERNAL_DEV_BASE_URL, f"{PFP_PROXYGEN_SUFFIX}-{pull_request_id}"
449+
)
438450
if product == "PSU":
439451
context.psu_base_url = os.path.join(
440452
INTERNAL_DEV_BASE_URL, f"{PSU_SUFFIX}-{pull_request_id}"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
@pfp_proxygen @pfp_aws @regression
2+
Feature: I can see my prescriptions via PFP Proxygen
3+
4+
@blocker @smoke @e2e @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4222
5+
Scenario: I can see a single prescription
6+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
7+
And I successfully prepare and sign a prescription
8+
When I am authenticated with PFP-PROXYGEN app
9+
And I request my prescriptions
10+
Then I can see my prescription
11+
12+
# Spine defined limit of 25 prescriptions per request
13+
Scenario: I can see a maximum of 25 prescriptions
14+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
15+
And I successfully prepare and sign '26' nominated acute prescriptions
16+
When I am authenticated with PFP-PROXYGEN app
17+
And I request my prescriptions
18+
Then I can see '25' of my prescriptions
19+
20+
# FLAKY WARNING: We've agreed to rely on NHS random generation to return an NHS number without prescriptions
21+
# This may cause flakiness if the random NHS number happens to have prescriptions
22+
Scenario: I can see no prescriptions
23+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
24+
And I successfully prepare and sign '0' nominated acute prescriptions
25+
When I am authenticated with PFP-PROXYGEN app
26+
And I request my prescriptions
27+
Then I can see '0' of my prescriptions
28+
29+
Scenario: I cannot see unreleased prescriptions
30+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
31+
And I successfully prepare a nominated acute prescription
32+
When I am authenticated with PFP-PROXYGEN app
33+
And I request my prescriptions
34+
Then I cannot see my unreleased prescriptions
35+
36+
Scenario: I cannot see eRD prescription items
37+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
38+
And I successfully prepare and sign a nominated eRD prescription
39+
When I am authenticated with PFP-PROXYGEN app
40+
And I request my prescriptions
41+
Then I do not see an eRD prescription
42+
43+
Scenario: I can see a FHIR compliant response for my prescriptions
44+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
45+
And I successfully prepare and sign a nominated acute prescription
46+
When I am authenticated with PFP-PROXYGEN app
47+
And I request my prescriptions
48+
Then I validate the prescription matches my prepared prescription
49+
50+
@e2e
51+
Scenario: I can see prescription item status (multiple statuses, multiple items) - acute, repeat
52+
Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
53+
And I successfully prepare and sign '2' nominated acute prescriptions
54+
And I am an authorised dispenser with EPS-FHIR-DISPENSING app
55+
And I release all prescriptions
56+
When I set the statuses I will update through
57+
| Status |
58+
| With Pharmacy |
59+
Then I process the status updates for the prescription items and verify they are returned
60+
61+
# # This scenario requires changes to FHIR compliance endpoint to be able to validate PFP responses
62+
# # Scenario: I can see prescription item details in FHIR compliant response
63+
# # Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app
64+
# # And I successfully prepare and sign a prescription
65+
# # When I am authenticated with PFP-PROXYGEN app
66+
# # And I request my prescriptions
67+
# # Then I am an authorised prescriber with EPS-FHIR app
68+
# # And I validate the response for FHIR compliance
69+
# # And the response indicates a success

methods/shared/common.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ def get_psu_authenticator(env, url):
3535
jwt_kid=JWT_KID,
3636
)
3737
# 2. Pass the config to the Authenticator
38-
authenticator = ClientCredentialsAuthenticator(
39-
config=config # pyright: ignore [reportArgumentType]
40-
)
41-
38+
# fmt: off
39+
authenticator = ClientCredentialsAuthenticator(config=config) # pyright: ignore [reportArgumentType]
40+
# fmt: on
4241
return authenticator
4342

4443

@@ -62,9 +61,9 @@ def get_eps_fhir_authenticator(user, env, url, product):
6261
scope=scope,
6362
login_form=login_form,
6463
)
65-
authenticator = AuthorizationCodeAuthenticator(
66-
config=config # pyright: ignore [reportArgumentType]
67-
)
64+
# fmt: off
65+
authenticator = AuthorizationCodeAuthenticator(config=config) # pyright: ignore [reportArgumentType]
66+
# fmt: on
6867
return authenticator
6968

7069

@@ -88,9 +87,9 @@ def get_pfp_apigee_authenticator(env, url):
8887
scope=scope,
8988
login_form=login_form,
9089
)
91-
authenticator = AuthorizationCodeAuthenticator(
92-
config=config # pyright: ignore [reportArgumentType]
93-
)
90+
# fmt: off
91+
authenticator = AuthorizationCodeAuthenticator(config=config) # pyright: ignore [reportArgumentType]
92+
# fmt: on
9493
return authenticator
9594

9695

@@ -104,6 +103,7 @@ def get_auth(env, product, user="prescriber"):
104103
"EPS-FHIR-PRESCRIBING-SHA1",
105104
"EPS-FHIR-DISPENSING",
106105
"PFP-APIGEE",
106+
"PFP-PROXYGEN",
107107
"PSU",
108108
"EPS-ASSIST-ME",
109109
]:
@@ -119,7 +119,7 @@ def get_auth(env, product, user="prescriber"):
119119
"EPS-FHIR-PRESCRIBING-SHA1",
120120
]:
121121
authenticator = get_eps_fhir_authenticator(user, env, url, product)
122-
if product == "PFP-APIGEE":
122+
if product == "PFP-APIGEE" or product == "PFP-PROXYGEN":
123123
authenticator = get_pfp_apigee_authenticator(env, url)
124124
if product == "PSU":
125125
authenticator = get_psu_authenticator(env, url)

0 commit comments

Comments
 (0)