Skip to content

Commit 9a86026

Browse files
committed
Add e2e test
1 parent 2ff24a7 commit 9a86026

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

tests/e2e_automation/features/APITests/search.feature

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,22 @@ Feature: Search the immunization of a patient
201201
@Delete_cleanUp @vaccine_type_FLU @patient_id_Random @supplier_name_Postman_Auth
202202
Scenario: Flu event is created and search post request fetch the only one record matched with identifier
203203
Given I have created a valid vaccination record
204-
When Send a search request with Post method using identifier header for Immunization event created
204+
When Send a search request with Post method using identifier parameter for Immunization event created
205+
Then The request will be successful with the status code '200'
206+
And correct immunization event is returned in the response
207+
208+
@smoke
209+
@Delete_cleanUp @vaccine_type_FLU @patient_id_NullNHS @supplier_name_Postman_Auth
210+
Scenario: Search by Identifier (POST) is successful when patient does not have an NHS Number recorded
211+
Given I have created a valid vaccination record
212+
When Send a search request with Post method using identifier parameter for Immunization event created
205213
Then The request will be successful with the status code '200'
206214
And correct immunization event is returned in the response
207215

208216
@Delete_cleanUp @vaccine_type_FLU @patient_id_Random @supplier_name_Postman_Auth
209217
Scenario: Flu event is created and search post request fetch the only one record matched with identifier and _elements
210218
Given I have created a valid vaccination record
211-
When Send a search request with Post method using identifier and _elements header for Immunization event created
219+
When Send a search request with Post method using identifier and _elements parameters for Immunization event created
212220
Then The request will be successful with the status code '200'
213221
And correct immunization event is returned in the response with only specified elements
214222

@@ -217,7 +225,7 @@ Feature: Search the immunization of a patient
217225
Scenario: Flu event is created and search post request fetch the only one record matched with identifier with correct version id
218226
Given I have created a valid vaccination record
219227
And created event is being updated twice
220-
When Send a search request with Post method using identifier header for Immunization event created
228+
When Send a search request with Post method using identifier parameter for Immunization event created
221229
Then The request will be successful with the status code '200'
222230
And correct immunization event is returned in the response
223231

@@ -226,7 +234,7 @@ Feature: Search the immunization of a patient
226234
Scenario: Flu event is created and search post request fetch the only one record matched with identifier and _elements with correct version id
227235
Given I have created a valid vaccination record
228236
And created event is being updated twice
229-
When Send a search request with Post method using identifier and _elements header for Immunization event created
237+
When Send a search request with Post method using identifier and _elements parameters for Immunization event created
230238
Then The request will be successful with the status code '200'
231239
And correct immunization event is returned in the response with only specified elements
232240

tests/e2e_automation/features/APITests/steps/test_search_steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
scenarios("APITests/search.feature")
2121

2222

23-
@when("Send a search request with Post method using identifier header for Immunization event created")
23+
@when("Send a search request with Post method using identifier parameter for Immunization event created")
2424
def send_search_post_request_with_identifier_header(context):
2525
get_search_post_url_header(context)
2626
context.request = {
@@ -30,7 +30,7 @@ def send_search_post_request_with_identifier_header(context):
3030
context.response = http_requests_session.post(context.url, headers=context.headers, data=context.request)
3131

3232

33-
@when("Send a search request with Post method using identifier and _elements header for Immunization event created")
33+
@when("Send a search request with Post method using identifier and _elements parameters for Immunization event created")
3434
def send_search_post_request_with_identifier_and_elements_header(context):
3535
get_search_post_url_header(context)
3636
context.request = {

tests/e2e_automation/input/testData.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id,nhs_number,family_name,given_name,gender,birth_date,address_text,address_line,city,district,state,postal_code,country,start_date,end_date
22
ValidNHS,9449309981,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
3-
NUllNHS,,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
3+
NullNHS,,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
44
SFlag,9449310475,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
55
InvalidInPDS,9449310599,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
66
InvalidMOD11Check,1234567890,test1,test2,unknown,1980-11-01,Validate Obf,"1, obf_2",obf_3,obf_4,obf_5,LS01 1AB,obf_7,2000-01-01,2025-01-01
@@ -1006,4 +1006,4 @@ Valid_NHS,9000046696,GLENN,ROWE,male,2005-03-14,Moore 01 Bishop,Essex,City,distr
10061006
Valid_NHS,9734891650,HETTY,DAWKIN,female,2005-03-14,1 GARDEN COURT,EPWORTH,City,district,State,DN9 1GA,UK,2016-06-12,2033-01-01
10071007
Valid_NHS,9734281674,LANDON,EWART,male,2005-03-14,1186 THE MOORS,KIDLINGTON,City,district,State,OX5 2AD,UK,2021-09-29,2033-01-01
10081008
Valid_NHS,9734353055,BETSY,HOPSON,female,2005-03-14,1186 THE MOORS,KIDLINGTON,City,district,State,OX4 4LX,UK,2013-01-28,2033-01-01
1009-
Valid_NHS,9734107720,SARAH,PEILL,female,2005-03-14,1 DELAMERE,WYNYARD,City,district,State,TS22 5GH,UK,2016-11-10,2033-01-01
1009+
Valid_NHS,9734107720,SARAH,PEILL,female,2005-03-14,1 DELAMERE,WYNYARD,City,district,State,TS22 5GH,UK,2016-11-10,2033-01-01

0 commit comments

Comments
 (0)