Skip to content

Commit 5feccaf

Browse files
authored
added scenario where mix DiseaseType has unauthorized diseasetype (#1254)
1 parent 2c43d40 commit 5feccaf

4 files changed

Lines changed: 209 additions & 265 deletions

File tree

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
aws_token_refresh=True
2-
USE_STATIC_APPS=True
3-
4-
########## INT env variables
5-
# baseUrl=https://int.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4
6-
# auth_url=https://int.api.service.nhs.uk/oauth2-mock/authorize
7-
# token_url=https://int.api.service.nhs.uk/oauth2-mock/token
8-
# callback_url=https://oauth.pstmn.io/v1/callback
9-
# S3_env=int
10-
# aws_profile_name={your-aws-profile}
11-
# PROXY_NAME=immunisation-fhir-api-int
12-
## Id/Secret values - please contact Dev or Test team to get these values
13-
# username=
14-
# scope=
15-
# STATUS_API_KEY=
16-
# AWS_DOMAIN_NAME=
17-
# Postman_Auth_client_Id=
18-
# Postman_Auth_client_Secret=
19-
# RAVS_client_Id=
20-
# RAVS_client_Secret=
21-
# MAVIS_client_Id=
22-
# MAVIS_client_Secret=
23-
# EMIS_client_Id=
24-
# EMIS_client_Secret=
25-
# SONAR_client_Id=
26-
# SONAR_client_Secret=
27-
# TPP_client_Id=
28-
# TPP_client_Secret=
29-
# MEDICUS_client_Id=
30-
# MEDICUS_client_Secret=
31-
32-
########## Internal-QA env variables
33-
baseUrl=https://internal-qa.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4
34-
auth_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/authorize
35-
token_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/token
36-
callback_url=https://oauth.pstmn.io/v1/callback
37-
S3_env=internal-qa
38-
aws_profile_name={your-aws-profile}
39-
PROXY_NAME=immunisation-fhir-api-internal-qa
40-
# This will only not match S3_env in preprod, where we have a blue/green environment
41-
SUB_ENVIRONMENT=internal-qa
42-
## Id/Secret values - please contact Dev or Test team to get these values
43-
username=
44-
scope=
45-
STATUS_API_KEY=
46-
AWS_DOMAIN_NAME=
47-
Postman_Auth_client_Id=
48-
Postman_Auth_client_Secret=
49-
RAVS_client_Id=
50-
RAVS_client_Secret=
51-
MAVIS_client_Id=
52-
MAVIS_client_Secret=
53-
EMIS_client_Id=
54-
EMIS_client_Secret=
55-
SONAR_client_Id=
56-
SONAR_client_Secret=
57-
TPP_client_Id=
58-
TPP_client_Secret=
59-
MEDICUS_client_Id=
60-
MEDICUS_client_Secret=
1+
aws_token_refresh=True
2+
USE_STATIC_APPS=True
3+
4+
########## INT env variables
5+
# baseUrl=https://int.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4
6+
# auth_url=https://int.api.service.nhs.uk/oauth2-mock/authorize
7+
# token_url=https://int.api.service.nhs.uk/oauth2-mock/token
8+
# callback_url=https://oauth.pstmn.io/v1/callback
9+
# S3_env=int
10+
# aws_profile_name={your-aws-profile}
11+
# PROXY_NAME=immunisation-fhir-api-int
12+
## Id/Secret values - please contact Dev or Test team to get these values
13+
# username=
14+
# scope=
15+
# STATUS_API_KEY=
16+
# AWS_DOMAIN_NAME=
17+
# Postman_Auth_client_Id=
18+
# Postman_Auth_client_Secret=
19+
# RAVS_client_Id=
20+
# RAVS_client_Secret=
21+
# MAVIS_client_Id=
22+
# MAVIS_client_Secret=
23+
# EMIS_client_Id=
24+
# EMIS_client_Secret=
25+
# SONAR_client_Id=
26+
# SONAR_client_Secret=
27+
# TPP_client_Id=
28+
# TPP_client_Secret=
29+
# MEDICUS_client_Id=
30+
# MEDICUS_client_Secret=
31+
32+
########## Internal-QA env variables
33+
baseUrl=https://internal-qa.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4
34+
auth_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/authorize
35+
token_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/token
36+
callback_url=https://oauth.pstmn.io/v1/callback
37+
S3_env=internal-qa
38+
aws_profile_name={your-aws-profile}
39+
PROXY_NAME=immunisation-fhir-api-internal-qa
40+
# This will only not match S3_env in preprod, where we have a blue/green environment
41+
SUB_ENVIRONMENT=internal-qa
42+
## Id/Secret values - please contact Dev or Test team to get these values
43+
username=
44+
scope=
45+
STATUS_API_KEY=
46+
AWS_DOMAIN_NAME=
47+
Postman_Auth_client_Id=
48+
Postman_Auth_client_Secret=
49+
RAVS_client_Id=
50+
RAVS_client_Secret=
51+
MAVIS_client_Id=
52+
MAVIS_client_Secret=
53+
EMIS_client_Id=
54+
EMIS_client_Secret=
55+
SONAR_client_Id=
56+
SONAR_client_Secret=
57+
TPP_client_Id=
58+
TPP_client_Secret=
59+
MEDICUS_client_Id=
60+
MEDICUS_client_Secret=

tests/e2e_automation/features/APITests/search.feature

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Search the immunization of a patient
44
@Delete_cleanUp @supplier_name_TPP
55
Scenario Outline: Verify that the GET method of Search API will be successful with all the valid parameters
66
Given Valid vaccination record is created with Patient '<Patient>' and vaccine_type '<Vaccine_type>'
7-
When Send a search request with GET method for Immunization event created
7+
When Send a search request with 'GET' method for Immunization event created
88
Then The request will be successful with the status code '200'
99
And The Search Response JSONs should contain the detail of the immunization events created above
1010
And The Search Response JSONs field values should match with the input JSONs field values for resourceType Immunization
@@ -28,7 +28,7 @@ Feature: Search the immunization of a patient
2828
@Delete_cleanUp @supplier_name_EMIS
2929
Scenario Outline: Verify that the POST method of Search API will be successful with all the valid parameters
3030
Given Valid vaccination record is created with Patient '<Patient>' and vaccine_type '<Vaccine_type>'
31-
When Send a search request with POST method for Immunization event created
31+
When Send a search request with 'POST' method for Immunization event created
3232
Then The request will be successful with the status code '200'
3333
And The Search Response JSONs should contain the detail of the immunization events created above
3434
And The Search Response JSONs field values should match with the input JSONs field values for resourceType Immunization
@@ -49,10 +49,10 @@ Feature: Search the immunization of a patient
4949
@Delete_cleanUp @supplier_name_Postman_Auth
5050
Scenario Outline: Verify that the immunization events retrieved in the response of Search API should be within Date From and Date To range
5151
Given Valid vaccination record is created for '<NHSNumber>' and Disease Type '<vaccine_type>' with recorded date as '<DateFrom>'
52-
When Send a search request with GET method with valid NHS Number '<NHSNumber>' and Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>'
52+
When Send a search request with 'GET' method with valid NHS Number '<NHSNumber>' and Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>'
5353
Then The request will be successful with the status code '200'
5454
And The occurrenceDateTime of the immunization events should be within the Date From and Date To range
55-
When Send a search request with POST method with valid NHS Number '<NHSNumber>' and Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>'
55+
When Send a search request with 'POST' method with valid NHS Number '<NHSNumber>' and Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>'
5656
Then The request will be successful with the status code '200'
5757
And The occurrenceDateTime of the immunization events should be within the Date From and Date To range
5858
Examples:
@@ -62,10 +62,10 @@ Feature: Search the immunization of a patient
6262
# Negative Scenarios
6363
@supplier_name_Postman_Auth
6464
Scenario Outline: Verify that Search API will throw error if NHS Number is invalid
65-
When Send a search request with GET method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
65+
When Send a search request with 'GET' method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
6666
Then The request will be unsuccessful with the status code '400'
6767
And The Search Response JSONs should contain correct error message for invalid NHS Number
68-
When Send a search request with POST method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
68+
When Send a search request with 'POST' method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
6969
Then The request will be unsuccessful with the status code '400'
7070
And The Search Response JSONs should contain correct error message for invalid NHS Number
7171
Examples:
@@ -78,10 +78,10 @@ Feature: Search the immunization of a patient
7878
@smoke
7979
@supplier_name_Postman_Auth
8080
Scenario Outline: Verify that Search API will throw error if include is invalid
81-
When Send a search request with GET method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and invalid include '<include>'
81+
When Send a search request with 'GET' method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and invalid include '<include>'
8282
Then The request will be unsuccessful with the status code '400'
8383
And The Search Response JSONs should contain correct error message for invalid include
84-
When Send a search request with POST method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and invalid include '<include>'
84+
When Send a search request with 'POST' method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and invalid include '<include>'
8585
Then The request will be unsuccessful with the status code '400'
8686
And The Search Response JSONs should contain correct error message for invalid include
8787
Examples:
@@ -91,10 +91,10 @@ Feature: Search the immunization of a patient
9191
@smoke
9292
@supplier_name_Postman_Auth
9393
Scenario Outline: Verify that Search API will throw error if both different combination of dates and include is invalid
94-
When Send a search request with GET method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>' and include '<include>'
94+
When Send a search request with 'GET' method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>' and include '<include>'
9595
Then The request will be unsuccessful with the status code '400'
9696
And The Search Response JSONs should contain correct error message for invalid Date From, Date To and include
97-
When Send a search request with POST method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>' and include '<include>'
97+
When Send a search request with 'POST' method with valid NHS Number '<NHSNumber>' and valid Disease Type '<vaccine_type>' and Date From '<DateFrom>' and Date To '<DateTo>' and include '<include>'
9898
Then The request will be unsuccessful with the status code '400'
9999
And The Search Response JSONs should contain correct error message for invalid Date From, Date To and include
100100
Examples:
@@ -107,10 +107,10 @@ Feature: Search the immunization of a patient
107107
@smoke
108108
@supplier_name_Postman_Auth
109109
Scenario Outline: Verify that Search API will throw error if Disease Type is invalid
110-
When Send a search request with GET method with valid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
110+
When Send a search request with 'GET' method with valid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
111111
Then The request will be unsuccessful with the status code '400'
112112
And The Search Response JSONs should contain correct error message for invalid Disease Type
113-
When Send a search request with POST method with valid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
113+
When Send a search request with 'POST' method with valid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
114114
Then The request will be unsuccessful with the status code '400'
115115
And The Search Response JSONs should contain correct error message for invalid Disease Type
116116
Examples:
@@ -121,10 +121,10 @@ Feature: Search the immunization of a patient
121121

122122
@supplier_name_Postman_Auth
123123
Scenario Outline: Verify that Search API will throw error if both NHS Number and Disease Type are invalid
124-
When Send a search request with GET method with invalid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
124+
When Send a search request with 'GET' method with invalid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
125125
Then The request will be unsuccessful with the status code '400'
126126
And The Search Response JSONs should contain correct error message for invalid NHS Number as higher priority
127-
When Send a search request with POST method with invalid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
127+
When Send a search request with 'POST' method with invalid NHS Number '<NHSNumber>' and invalid Disease Type '<DiseaseType>'
128128
Then The request will be unsuccessful with the status code '400'
129129
And The Search Response JSONs should contain correct error message for invalid NHS Number as higher priority
130130
Examples:
@@ -136,19 +136,31 @@ Feature: Search the immunization of a patient
136136
@Delete_cleanUp @supplier_name_Postman_Auth
137137
Scenario: Verify that Search API returns 200 with results and OperationOutcome when both valid and invalid Disease Type are provided
138138
Given Valid vaccination record is created with Patient 'Random' and vaccine_type 'COVID'
139-
When Send a search request with GET method with valid NHS Number and mixed valid and invalid Disease Type
139+
When Send a search request with 'GET' method with valid NHS Number and mixed valid and invalid Disease Type
140140
Then The request will be successful with the status code '200'
141141
And The Search Response should contain search results and OperationOutcome for invalid immunization targets
142-
When Send a search request with POST method with valid NHS Number and mixed valid and invalid Disease Type
142+
When Send a search request with 'POST' method with valid NHS Number and mixed valid and invalid Disease Type
143143
Then The request will be successful with the status code '200'
144144
And The Search Response should contain search results and OperationOutcome for invalid immunization targets
145145

146+
@smoke
147+
@Delete_cleanUp @supplier_name_MAVIS
148+
Scenario: Verify that Search API returns 200 with results and OperationOutcome with authorized and unauthorized Disease Type for the supplier
149+
Given Valid vaccination record is created with Patient 'Random' and vaccine_type 'FLU'
150+
When Send a search request with 'GET' method with valid NHS Number and multiple Disease Type
151+
Then The request will be successful with the status code '200'
152+
And The Search Response should contain search results and OperationOutcome for unauthorized immunization targets
153+
When Send a search request with 'POST' method with valid NHS Number and multiple Disease Type
154+
Then The request will be successful with the status code '200'
155+
And The Search Response should contain search results and OperationOutcome for unauthorized immunization targets
156+
157+
146158
@supplier_name_MAVIS @vaccine_type_RSV
147159
Scenario Outline: Verify that Search API will throw error if date from is invalid
148-
When Send a search request with GET method with invalid Date From '<DateFrom>' and valid Date To '<DateTo>'
160+
When Send a search request with 'GET' method with invalid Date From '<DateFrom>' and valid Date To '<DateTo>'
149161
Then The request will be unsuccessful with the status code '400'
150162
And The Search Response JSONs should contain correct error message for invalid Date From
151-
When Send a search request with POST method with invalid Date From '<DateFrom>' and valid Date To '<DateTo>'
163+
When Send a search request with 'POST' method with invalid Date From '<DateFrom>' and valid Date To '<DateTo>'
152164
Then The request will be unsuccessful with the status code '400'
153165
And The Search Response JSONs should contain correct error message for invalid Date From
154166
Examples:
@@ -159,10 +171,10 @@ Feature: Search the immunization of a patient
159171

160172
@supplier_name_RAVS @vaccine_type_RSV
161173
Scenario Outline: Verify that Search API will throw error if date to is invalid
162-
When Send a search request with GET method with valid Date From '<DateFrom>' and invalid Date To '<DateTo>'
174+
When Send a search request with 'GET' method with valid Date From '<DateFrom>' and invalid Date To '<DateTo>'
163175
Then The request will be unsuccessful with the status code '400'
164176
And The Search Response JSONs should contain correct error message for invalid Date To
165-
When Send a search request with POST method with valid Date From '<DateFrom>' and invalid Date To '<DateTo>'
177+
When Send a search request with 'POST' method with valid Date From '<DateFrom>' and invalid Date To '<DateTo>'
166178
Then The request will be unsuccessful with the status code '400'
167179
And The Search Response JSONs should contain correct error message for invalid Date To
168180
Examples:
@@ -173,10 +185,10 @@ Feature: Search the immunization of a patient
173185

174186
@supplier_name_MAVIS @vaccine_type_RSV
175187
Scenario Outline: Verify that Search API will throw error if both date from and date to are invalid
176-
When Send a search request with GET method with invalid Date From '<DateFrom>' and invalid Date To '<DateTo>'
188+
When Send a search request with 'GET' method with invalid Date From '<DateFrom>' and invalid Date To '<DateTo>'
177189
Then The request will be unsuccessful with the status code '400'
178190
And The Search Response JSONs should contain correct error message for invalid Date From
179-
When Send a search request with POST method with invalid Date From '<DateFrom>' and invalid Date To '<DateTo>'
191+
When Send a search request with 'POST' method with invalid Date From '<DateFrom>' and invalid Date To '<DateTo>'
180192
Then The request will be unsuccessful with the status code '400'
181193
And The Search Response JSONs should contain correct error message for invalid Date From
182194
Examples:
@@ -188,10 +200,10 @@ Feature: Search the immunization of a patient
188200
@smoke
189201
@supplier_name_SONAR
190202
Scenario Outline: Verify that Search API will throw error supplier is not authorized to make Search
191-
When Send a search request with GET method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
203+
When Send a search request with 'GET' method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
192204
Then The request will be unsuccessful with the status code '403'
193205
And The Response JSONs should contain correct error message for 'unauthorized_access' access
194-
When Send a search request with POST method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
206+
When Send a search request with 'POST' method with invalid NHS Number '<NHSNumber>' and valid Disease Type '<DiseaseType>'
195207
Then The request will be unsuccessful with the status code '403'
196208
And The Response JSONs should contain correct error message for 'unauthorized_access' access
197209
Examples:
@@ -203,7 +215,7 @@ Feature: Search the immunization of a patient
203215
Scenario: Flu event is created and updated twice and search request fetch the latest meta version and Etag
204216
Given I have created a valid vaccination record
205217
And created event is being updated twice
206-
When Send a search request with GET method for Immunization event created
218+
When Send a search request with 'GET' method for Immunization event created
207219
Then The request will be successful with the status code '200'
208220
And The Search Response JSONs should contain the detail of the immunization events created above
209221
And The Search Response JSONs field values should match with the input JSONs field values for resourceType Immunization

0 commit comments

Comments
 (0)