Skip to content

Commit

Permalink
fix: adjust test case for select f from Folder f
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Oct 2, 2024
1 parent 3d1e132 commit 714039c
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Suite Teardown Run Keywords Admin Delete EHR For AQL ${ehr_id1} AND

*** Test Cases ***
SELECT e/ehr_id/value, f/uid/value, c/uid/value FROM EHR e CONTAINS FOLDER f CONTAINS COMPOSITION c WHERE e/ehr_id/value = '${ehr_id2}' AND f/uid/value = '70939d97-8add-4419-b27c-516e64b1c744' AND c/uid/value = '${c_uid4b}'
[Tags] not-ready
Log Skipped as returns emtpy rows. console=yes
${query} Set Variable
... SELECT e/ehr_id/value, f/uid/value, c/uid/value FROM EHR e CONTAINS FOLDER f CONTAINS COMPOSITION c WHERE e/ehr_id/value = '${ehr_id2}' AND f/uid/value = '70939d97-8add-4419-b27c-516e64b1c744' AND c/uid/value = '${c_uid4b}'
Set AQL And Execute Ad Hoc Query ${query}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*** Settings ***
Documentation CHECK SELECT PATHS IN FOLDER
... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#select-paths-in-folder
... - *Precondition:*
... - 1. Create EHR;
... - 2. Create Directory with folder_details.json;
... - Send AQL 'SELECT f FROM FOLDER f' query and compare response body with expected file content.
... - *Postcondition:* Delete EHR using ADMIN endpoint.
Resource ../../../_resources/keywords/aql_keywords.robot

Suite Setup Precondition
Suite Teardown Admin Delete EHR For AQL


*** Variables ***
${q} SELECT f FROM FOLDER f


*** Test Cases ***
1. SELECT f FROM FOLDER f
Set Test Variable ${query} ${q}
Set AQL And Execute Ad Hoc Query ${query}
Length Should Be ${resp_body['rows']} 2
Dictionary Should Contain Key ${resp_body['rows'][0][0]} name
Dictionary Should Contain Key ${resp_body['rows'][0][0]} archetype_node_id
Dictionary Should Contain Key ${resp_body['rows'][0][0]} details
Dictionary Should Contain Key ${resp_body['rows'][0][0]} uid
Should Be Equal As Strings ${resp_body['rows'][0][0]['_type']} FOLDER
Should Be Equal As Strings ${resp_body['rows'][1][0]['_type']} FOLDER


*** Keywords ***
Precondition
Set Library Search Order For Tests
Create EHR For AQL
Create Directory For AQL folder_details.json has_robot_vars=${FALSE}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
${query_nr},${path},${expected_file},${nr_of_results}
1.,f,expected_select_paths_in_folder_f.json,2
2.,f/items/id/value,expected_select_paths_in_folder_items_id_value.json,3
3.,f/items,expected_select_paths_in_folder_f_items.json,3
4.,f/details,expected_select_paths_in_folder_f_details.json,2
5.,f/details[at0003]/items[at0004]/value/value,expected_select_paths_in_folder_f_details_at4_val.json,2
1.,f/items/id/value,expected_select_paths_in_folder_items_id_value.json,3
2.,f/items,expected_select_paths_in_folder_f_items.json,3
3.,f/details,expected_select_paths_in_folder_f_details.json,2
4.,f/details[at0003]/items[at0004]/value/value,expected_select_paths_in_folder_f_details_at4_val.json,2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"rows": [
[
"${ehr_id1}",
"00e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1"
"60e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1"
],
[
"${ehr_id1}",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"meta": {
"_type": "RESULTSET",
"_schema_version": "1.0.3",
"_created": "2024-10-02T17:22:48.3197573+03:00",
"_executed_aql": "SELECT e/ehr_id/value, f/uid/value, c/uid/value FROM EHR e CONTAINS FOLDER f CONTAINS COMPOSITION c WHERE (e/ehr_id/value = '2fd7ff0d-78e7-487f-b31e-e9a25a83e442' AND f/uid/value = '70939d97-8add-4419-b27c-516e64b1c744' AND c/uid/value = 'c599d95d-f258-4f95-9b99-122fc049f5f0')",
"resultsize": 1
},
"q": "SELECT e/ehr_id/value, f/uid/value, c/uid/value FROM EHR e CONTAINS FOLDER f CONTAINS COMPOSITION c WHERE e/ehr_id/value = '2fd7ff0d-78e7-487f-b31e-e9a25a83e442' AND f/uid/value = '70939d97-8add-4419-b27c-516e64b1c744' AND c/uid/value = 'c599d95d-f258-4f95-9b99-122fc049f5f0'",
"columns": [
{
"path": "e/ehr_id/value",
"name": "#0"
},
{
"path": "f/uid/value",
"name": "#1"
},
{
"path": "c/uid/value",
"name": "#2"
}
],
"rows": [
[
"${ehr_id2}",
"70939d97-8add-4419-b27c-516e64b1c744",
"${c_uid4b}::local.ehrbase.org::1"
]
]
}

This file was deleted.

0 comments on commit 714039c

Please sign in to comment.