Skip to content

Commit

Permalink
Merge branch 'main' into feature/CDR-1550_aql_folder_robot
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Oct 1, 2024
2 parents e35b116 + a8ab87b commit 586ea19
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Execute Query
Set AQL And Execute Ad Hoc Query ${query}
Log ${expected_file}
${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/from/${expected_file}
${exclude_paths} Create List root['rows'][0][0]['uid'] root['meta']
${exclude_paths} Create List root['rows'][0][0]['uid']
... root['rows'][1][0]['uid'] root['rows'][2][0]['uid'] root['meta']
Length Should Be ${resp_body['rows']} ${nr_of_results}
${diff} compare json-string with json-file
... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Execute Query
Set AQL And Execute Ad Hoc Query ${query}
Log ${expected_file}
${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/from/${expected_file}
${exclude_paths} Create List root['rows'][0][0]['uid'] root['meta']
${exclude_paths} Create List root['rows'][0][0]['uid'] root['rows'][1][0]['uid']
... root['rows'][2][0]['uid'] root['meta']
Length Should Be ${resp_body['rows']} ${nr_of_results}
${diff} compare json-string with json-file
... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,40 @@ Suite Setup Set Library Search Order For Tests
Should Be Equal As Strings ${resp_body['meta']['_executed_aql']}
... SELECT e/ehr_id/value, c/uid/value, o/uid/value, p/time/value FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION o CONTAINS POINT_EVENT p WHERE c/uid/value = '${compo_id}::${system_id_with_tenant}::1' LIMIT 2 OFFSET 1

1.c Query - Ad-Hoc Query POST - Query Params - MATCHES Multiple Values
Set Test Variable ${query_matches1}
... SELECT pe/time/value, s/name/value FROM EHR e CONTAINS COMPOSITION c CONTAINS SECTION s CONTAINS POINT_EVENT pe WHERE s/name/value MATCHES {'Section 1', 'Section 2'}
Set Test Variable ${test_data} {"q":"${query_matches1}"}
Send Ad Hoc Request aql_body=${test_data}
Length Should Be ${resp_body['rows']} ${2}
Should Be Equal ${resp_body['meta']['resultsize']} ${2}
Should Be Equal As Strings ${resp_body_query} ${query_matches1}
Should Be Equal As Strings ${resp_body['meta']['_executed_aql']} ${query_matches1}
Log ${resp_body['rows'][0]}, ${resp_body['rows'][1]}

1.d Query - Ad-Hoc Query POST - MATCHES Multiple Values
Set Test Variable ${query_matches2}
... SELECT pe/time/value, s/name/value FROM EHR e CONTAINS COMPOSITION c CONTAINS SECTION s CONTAINS POINT_EVENT pe WHERE s/name/value MATCHES {$sections}
Set Test Variable ${test_data} {"q":"${query_matches2}","query_parameters": {"sections": ["Section 1","Section 2"]}}
Send Ad Hoc Request aql_body=${test_data}
Length Should Be ${resp_body['rows']} ${2}
Should Be Equal ${resp_body['meta']['resultsize']} ${2}
Should Be Equal As Strings ${resp_body_query} ${query_matches2}
Log ${resp_body['rows'][0]}, ${resp_body['rows'][1]}
### Check with one item in list
Set Test Variable ${query_matches3}
... SELECT pe/time/value, s/name/value FROM EHR e CONTAINS COMPOSITION c CONTAINS SECTION s CONTAINS POINT_EVENT pe WHERE s/name/value MATCHES {$sections}
Set Test Variable ${test_data} {"q":"${query_matches3}","query_parameters": {"sections": ["Section 1"]}}
Send Ad Hoc Request aql_body=${test_data}
Length Should Be ${resp_body['rows']} ${1}
Should Be Equal ${resp_body['meta']['resultsize']} ${1}
### Check with non-existing Section name value
Set Test Variable ${query_matches4}
... SELECT pe/time/value, s/name/value FROM EHR e CONTAINS COMPOSITION c CONTAINS SECTION s CONTAINS POINT_EVENT pe WHERE s/name/value MATCHES {$sections}
Set Test Variable ${test_data} {"q":"${query_matches4}","query_parameters": {"sections": ["Non existing section"]}}
Send Ad Hoc Request aql_body=${test_data}
Length Should Be ${resp_body['rows']} ${0}

2. Query - Ad-Hoc Query GET
Set Test Variable ${query3}
... SELECT c/uid/value FROM EHR e CONTAINS COMPOSITION c WHERE e/ehr_id/value = '${ehr_id}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Update Directory - If-Match With Non-Existing UUID Version Number
[Teardown] (admin) delete ehr

Update Directory - If-Match With Non-Existing UID Value
[Tags] not-ready CDR-1580
[Documentation] Update Directory with If-Match value (non-existing uid value).
... Example: If-Match=2c7d2873-fcba-4fb6-c55r-13ce977b0547::local.ehrbase.org::1
... Expect 412.
Expand All @@ -44,7 +43,6 @@ Update Directory - If-Match With Non-Existing UID Value
Set Suite Variable ${preceding_version_uid} ${directory_uuid_non_existing_value}
Log ${preceding_version_uid}
update DIRECTORY (JSON) update/2_add_subfolders.json isModifiable=${FALSE}
Log https://vitagroup-ag.atlassian.net/browse/CDR-1580
Should Be Equal ${response.status_code} ${412}
[Teardown] (admin) delete ehr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Update EHR Status - If-Match With Non-Existing UUID Version Number
[Teardown] (admin) delete ehr

Update EHR Status - If-Match With Non-Existing UID Value
[Tags] not-ready CDR-1580
[Documentation] Update EHR_STATUS with If-Match value (non-existing uid value).
... Example: If-Match=2c7d2873-fcba-4fb6-c55r-13ce977b0547::local.ehrbase.org::1
... Expect 412.
Expand All @@ -49,7 +48,30 @@ Update EHR Status - If-Match With Non-Existing UID Value
Set Suite Variable ${ehrstatus_uid} ${ehr_status_uuid_non_existing_value}
${err_msg} Run Keyword And Expect Error *
... set ehr_status of EHR multitenancy_token=${None}
Log https://vitagroup-ag.atlassian.net/browse/CDR-1580
Should Contain ${err_msg} 412 != 200
[Teardown] (admin) delete ehr

Update EHR Status - If-Match With Non-Existing UID Value - System Id - Version
[Documentation] Update EHR_STATUS with If-Match value (non-existing uid, system_id and version number).
... Example: If-Match=049addcd-9094-4d3c-8b79-9bb62b38cac2::non-existing-system-id::6
... Expect 412.
Create EHR - Extract EHR Data - Prepare For Update EHR_STATUS
#set {ehrstatus_uid} with replaced uid value (non-existing uid value)
${ehr_status_uuid_non_existing_value} Replace String
... ${ehrstatus_uid} ${versioned_status_uid} ${{str(uuid.uuid4())}}
${ehrstatus_uid} Set Variable ${ehr_status_uuid_non_existing_value}
#set {ehrstatus_uid} with replaced original system_id with non-existing-system-id
@{ehr_status_uid_list} Split String ${ehrstatus_uid} ::
Set Test Variable ${initial_system_id} ${ehr_status_uid_list}[1]
${ehr_status_system_id_non_existing_value} Replace String
... ${ehrstatus_uid} ${initial_system_id} non-existing-system-id
#Set Suite Variable ${ehrstatus_uid} ${ehr_status_system_id_non_existing_value}
${ehrstatus_uid} Set Variable ${ehr_status_system_id_non_existing_value}
${ehr_status_non_existing_version} Replace String
... ${ehrstatus_uid} ::1 ::5
Set Suite Variable ${ehrstatus_uid} ${ehr_status_non_existing_version}
${err_msg} Run Keyword And Expect Error *
... set ehr_status of EHR multitenancy_token=${None}
Should Contain ${err_msg} 412 != 200
[Teardown] (admin) delete ehr

Expand Down
2 changes: 1 addition & 1 deletion tests/robot/_resources/keywords/ehr_keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ update ehr_status of fake EHR (with body)

generate fake ehr_status
Set To Dictionary ${headers} Content-Type=application/json Prefer=return=representation
... If-Match=${ehr_id}
... If-Match=${ehr_id}::${NODENAME}::1
${resp} PUT On Session ${SUT} /ehr/${ehr_id}/ehr_status json=${ehr_status}
... headers=${headers} expected_status=anything
# NOTE: spec --> "If-Match: {preceding_version_uid}"
Expand Down

0 comments on commit 586ea19

Please sign in to comment.