Skip to content

Commit 1acee0b

Browse files
VED-1038 updated lint issue (#1207)
* updated the smoke tag and add scenarios as required in ticket * ruff format * fix the broken tests * updated lint issue * Update tests/e2e_automation/features/APITests/update.feature Co-authored-by: Daniel Yip <daniel.yip4@nhs.net> * fix broken test by adding the valid vaccination in pre-condition * fix lint issue --------- Co-authored-by: Daniel Yip <daniel.yip4@nhs.net>
1 parent 9c14c74 commit 1acee0b

14 files changed

Lines changed: 1247 additions & 598 deletions

tests/e2e_automation/features/APITests/create.feature

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,37 @@ Feature: Create the immunization event for a patient
3232
| Random | HEPB | EMIS |
3333
| Random | BCG | MEDICUS |
3434

35+
@Delete_cleanUp
36+
Scenario Outline: Verify that the POST Create API request with minimal dataset for different vaccine types
37+
Given Valid token is generated for the '<Supplier>'
38+
And Valid json payload is created with Patient '<Patient>' and vaccine_type '<vaccine_type>' with minimal dataset
39+
When Trigger the post create request
40+
Then The request will be successful with the status code '201'
41+
And The location key and Etag in header will contain the Immunization Id and version
42+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
43+
And The imms event table will be populated with the correct data for 'created' event
44+
And The delta table will be populated with the correct data for created event
45+
46+
Examples:
47+
| Patient | vaccine_type | Supplier |
48+
| Random | COVID | Postman_Auth |
49+
| Random | RSV | RAVS |
50+
| Random | FLU | MAVIS |
51+
| Random | MMR | Postman_Auth |
52+
| Random | MENACWY | TPP |
53+
| Random | 3IN1 | TPP |
54+
| Random | MMRV | EMIS |
55+
| Random | PERTUSSIS | EMIS |
56+
| Random | SHINGLES | EMIS |
57+
| Random | PNEUMOCOCCAL | EMIS |
58+
| Random | 4IN1 | TPP |
59+
| Random | 6IN1 | EMIS |
60+
| Random | HIB | TPP |
61+
| Random | MENB | TPP |
62+
| Random | ROTAVIRUS | MEDICUS |
63+
| Random | HEPB | EMIS |
64+
| Random | BCG | MEDICUS |
65+
3566
@Delete_cleanUp @vaccine_type_6IN1 @patient_id_Random @supplier_name_EMIS
3667
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to respective text fields in imms delta table
3768
Given Valid json payload is created where vaccination terms has text field populated
Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
11
@Delete_Feature @functional
22
Feature: Delete an immunization of a patient
33

4-
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
5-
Scenario: Verify that the Delete API will be successful with all the valid parameters
6-
Given I have created a valid vaccination record
7-
When Send a delete for Immunization event created
8-
Then The request will be successful with the status code '204'
9-
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
10-
And The imms event table will be populated with the correct data for 'deleted' event
11-
And The delta table will be populated with the correct data for deleted event
4+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
5+
Scenario: Verify that the Delete API will be successful with all the valid parameters
6+
Given I have created a valid vaccination record
7+
When Send a delete for Immunization event created
8+
Then The request will be successful with the status code '204'
9+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
10+
And The imms event table will be populated with the correct data for 'deleted' event
11+
And The delta table will be populated with the correct data for deleted event
1212

13-
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
14-
Scenario: Verify that the Delete event is not coming in Get Search API response
15-
Given I have created a valid vaccination record
16-
When Send a delete for Immunization event created
17-
Then The request will be successful with the status code '204'
18-
And Deleted Immunization event will not be present in Get method Search API response
13+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
14+
Scenario: Verify that the Delete event is not coming in Get Search API response
15+
Given I have created a valid vaccination record
16+
When Send a delete for Immunization event created
17+
Then The request will be successful with the status code '204'
18+
And Deleted Immunization event will not be present in Get method Search API response
1919

20-
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
21-
Scenario: Verify that the Delete event is not coming in Post Search API response
22-
Given I have created a valid vaccination record
23-
When Send a delete for Immunization event created
24-
Then The request will be successful with the status code '204'
25-
And Deleted Immunization event will not be present in Post method Search API response
20+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
21+
Scenario: Verify that the Delete event is not coming in Post Search API response
22+
Given I have created a valid vaccination record
23+
When Send a delete for Immunization event created
24+
Then The request will be successful with the status code '204'
25+
And Deleted Immunization event will not be present in Post method Search API response
2626

27-
@vaccine_type_RSV @patient_id_Random
28-
Scenario: Verify that the Delete event request will fail with unauthorized access for MAVIS supplier
29-
Given valid vaccination record is created by 'RAVS' supplier
30-
When Send a delete for Immunization event created for the above created event is send by 'MAVIS'
31-
Then The request will be successful with the status code '403'
32-
And The Response JSONs should contain correct error message for 'unauthorized_access' access
27+
@vaccine_type_RSV @patient_id_Random
28+
Scenario: Verify that the Delete event request will fail with unauthorized access for MAVIS supplier
29+
Given valid vaccination record is created by 'RAVS' supplier
30+
When Send a delete for Immunization event created for the above created event is send by 'MAVIS'
31+
Then The request will be successful with the status code '403'
32+
And The Response JSONs should contain correct error message for 'unauthorized_access' access
3333

34-
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
35-
Scenario: Verify that the Delete event request will fail with Not found error
36-
When Send a delete for Immunization event created with invalid Imms Id
37-
Then The request will be successful with the status code '404'
38-
And The Response JSONs should contain correct error message for Imms_id 'not_found'
34+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
35+
Scenario: Verify that the Delete event request will fail with Not found error
36+
When Send a delete for Immunization event created with invalid Imms Id
37+
Then The request will be successful with the status code '404'
38+
And The Response JSONs should contain correct error message for Imms_id 'not_found'
39+
40+
@smoke
41+
@vaccine_type_ROTAVIRUS @patient_id_Random @supplier_name_TPP
42+
Scenario: Verify that the Delete request will fail when record is already soft deleted
43+
Given I have created a valid vaccination record
44+
When Send a delete for Immunization event created
45+
Then The request will be successful with the status code '204'
46+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
47+
And The imms event table will be populated with the correct data for 'deleted' event
48+
And The delta table will be populated with the correct data for deleted event
49+
When same delete request is triggered again
50+
Then The request will be unsuccessful with the status code '404'
51+
And The Response JSONs should contain correct error message for Imms_id 'not_found'
Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,53 @@
11
@Read_Feature @functional
22
Feature: Read the immunization of a patient
33

4-
@Delete_cleanUp @supplier_name_MEDICUS
5-
Scenario Outline: Verify that the Read method of API will be successful and fetch valid imms event detail
6-
Given Valid vaccination record is created with Patient '<Patient>' and vaccine_type '<Vaccine_type>'
7-
When Send a read request for Immunization event created
8-
Then The request will be successful with the status code '200'
9-
And The Etag in header will containing the latest event version
10-
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
11-
And The Read Response JSONs field values should match with the input JSONs field values
12-
13-
Examples:
14-
|Patient | Vaccine_type|
15-
|Random | 4IN1 |
16-
|Random | FLU |
17-
|Random | COVID |
18-
19-
20-
@Delete_cleanUp @vaccine_type_FLU @patient_id_Random @supplier_name_Postman_Auth
21-
Scenario: Flu event is created and updated twice and read request fetch the latest version and Etag
22-
Given I have created a valid vaccination record
23-
And created event is being updated twice
24-
When Send a read request for Immunization event created
25-
Then The request will be successful with the status code '200'
26-
And The Etag in header will containing the latest event version
27-
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
28-
And The Read Response JSONs field values should match with the input JSONs field values
29-
30-
@vaccine_type_FLU @patient_id_Random @supplier_name_Postman_Auth
31-
Scenario: Deleted event returns 404 on read request
32-
Given I have created a valid vaccination record
33-
And created event is being deleted
34-
When Send a read request for Immunization event created
35-
Then The request will be unsuccessful with the status code '404'
36-
And The Response JSONs should contain correct error message for 'not_found'
37-
38-
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
39-
Scenario: Verify that the Read event request will fail with Not found error with invalid Imms Id
40-
When Send a read request for Immunization event created with invalid Imms Id
41-
Then The request will be unsuccessful with the status code '404'
42-
And The Response JSONs should contain correct error message for Imms_id 'not_found'
4+
@Delete_cleanUp @supplier_name_MEDICUS
5+
Scenario Outline: Verify that the Read method of API will be successful and fetch valid imms event detail
6+
Given Valid vaccination record is created with Patient '<Patient>' and vaccine_type '<Vaccine_type>'
7+
When Send a read request for Immunization event created
8+
Then The request will be successful with the status code '200'
9+
And The Etag in header will containing the latest event version
10+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
11+
And The Read Response JSONs field values should match with the input JSONs field values
12+
13+
Examples:
14+
| Patient | Vaccine_type |
15+
| Random | 4IN1 |
16+
| Random | FLU |
17+
| Random | COVID |
18+
19+
@smoke
20+
@Delete_cleanUp @vaccine_type_FLU @patient_id_Random @supplier_name_Postman_Auth
21+
Scenario: Flu event is created and updated twice and read request fetch the latest version and Etag
22+
Given I have created a valid vaccination record
23+
And created event is being updated twice
24+
When Send a read request for Immunization event created
25+
Then The request will be successful with the status code '200'
26+
And The Etag in header will containing the latest event version
27+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
28+
And The Read Response JSONs field values should match with the input JSONs field values
29+
30+
@smoke
31+
@vaccine_type_MMRV @patient_id_Random @supplier_name_Postman_Auth
32+
Scenario: Deleted event returns 404 on read request
33+
Given I have created a valid vaccination record
34+
And created event is being deleted
35+
When Send a read request for Immunization event created
36+
Then The request will be unsuccessful with the status code '404'
37+
And The Response JSONs should contain correct error message for 'not_found'
38+
39+
@smoke
40+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
41+
Scenario: Verify that the Read event request will fail with Not found error with invalid Imms Id
42+
When Send a read request for Immunization event created with invalid Imms Id
43+
Then The request will be unsuccessful with the status code '404'
44+
And The Response JSONs should contain correct error message for Imms_id 'not_found'
45+
46+
@smoke
47+
@vaccine_type_RSV @patient_id_Random @supplier_name_RAVS
48+
Scenario: Verify that the Read event request will fail when no Imms Id is provided
49+
When Send a read request with no Imms Id
50+
Then The request will be unsuccessful with the status code '400'
51+
And The Response JSONs should contain correct error message for Imms_id 'no_imms_id'
4352

4453

0 commit comments

Comments
 (0)