Skip to content

Commit 1a9cfb8

Browse files
committed
fix search broken tests
1 parent 0afb45f commit 1a9cfb8

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def TriggerSearchPostRequest(context):
7878
datetime.today().strftime("%Y-%m-%d"),
7979
)
8080
)
81-
print(f"\n Search Post Request - \n {context.request}")
8281
trigger_search_request_by_httpMethod(context, httpMethod="POST")
8382

8483

@@ -88,7 +87,7 @@ def TriggerSearchPostRequest(context):
8887
def send_search_with_target_disease(context, httpMethod):
8988
patient_ident = context.create_object.contained[1].identifier[0]
9089
target = context.create_object.protocolApplied[0].targetDisease[0].coding[0]
91-
context.request = {
90+
context.params = context.request = {
9291
"patient.identifier": f"{patient_ident.system}|{patient_ident.value}",
9392
"target-disease": f"{target.system}|{target.code}",
9493
}
@@ -104,7 +103,7 @@ def send_search_post_with_comma_separated_target_disease(context, httpMethod):
104103
patient_ident = context.create_object.contained[1].identifier[0]
105104
targets = context.create_object.protocolApplied[0].targetDisease
106105
target_parts = [f"{t.coding[0].system}|{t.coding[0].code}" for t in targets[:2]]
107-
context.request = {
106+
context.params = context.request = {
108107
"patient.identifier": f"{patient_ident.system}|{patient_ident.value}",
109108
"target-disease": ",".join(target_parts),
110109
}
@@ -155,9 +154,13 @@ def send_search_get_with_target_disease_unauthorised_supplier(context):
155154
trigger_search_request_by_httpMethod(context, httpMethod="GET")
156155

157156

158-
@when("Send a search request with '{httpMethod}' method with valid NHS Number and all invalid target-disease codes")
157+
@when(
158+
parsers.parse(
159+
"Send a search request with '{httpMethod}' method with valid NHS Number and all invalid target-disease codes"
160+
)
161+
)
159162
def send_search_request_with_all_invalid_target_disease_codes(context, httpMethod):
160-
context.request = {
163+
context.params = context.request = {
161164
"patient.identifier": f"{PATIENT_IDENTIFIER_SYSTEM}|9000000009",
162165
"target-disease": "invalid-no-pipe,wrong_system|123",
163166
}
@@ -172,7 +175,7 @@ def send_search_request_with_all_invalid_target_disease_codes(context, httpMetho
172175
def send_search_post_with_mixed_valid_and_invalid_target_disease_codes(context, httpMethod):
173176
patient_ident = context.create_object.contained[1].identifier[0]
174177
target = context.create_object.protocolApplied[0].targetDisease[0].coding[0]
175-
context.request = {
178+
context.params = context.request = {
176179
"patient.identifier": f"{patient_ident.system}|{patient_ident.value}",
177180
"target-disease": f"{target.system}|{target.code},{TARGET_DISEASE_SYSTEM}|{INVALID_TARGET_DISEASE_CODE}",
178181
}

0 commit comments

Comments
 (0)