From 86de794193f8f2aaf63c5abe5ddbaed1f6316d93 Mon Sep 17 00:00:00 2001 From: vladislavploaia Date: Thu, 19 Sep 2024 13:59:42 +0300 Subject: [PATCH] feat: CDR-1550 add Robot tests for AQL Folder --- .../FOLDER/FROM_FOLDER/find_all_and_by.robot | 12 ++--- .../select_all.robot | 52 +++++++++++++++++++ .../find_all.robot | 33 +++++++++++- .../FROM_FOLDER_CONTAINS_FOLDER/find_by.robot | 41 +++++++++++++++ .../MULTIPLE_EHRS/folder_multiple_ehrs.robot | 47 +++++++++++++++++ .../_resources/keywords/aql_keywords.robot | 11 +++- .../folder/folder_complex_hierarchy.json | 14 ++--- .../folder/folder_complex_hierarchy2.json | 14 ++--- .../folder/folder_simple_hierarchy.json | 6 +-- .../folder/folder_with_compositions.json | 8 +-- .../folder_contains_folder_find_by.csv | 5 ++ .../folder/expected_find_all.json | 41 +++++++++++++++ .../folder/expected_find_by_archetype.json | 21 ++++++++ .../folder/expected_find_by_name_root1.json | 21 ++++++++ .../expected_find_by_name_subfolder1.json | 21 ++++++++ .../expected_find_by_name_subsubfolder1.json | 21 ++++++++ ...cted_folder_contains_compo_select_all.json | 0 ...cted_folder_contains_folder_find_by_1.json | 0 ...cted_folder_contains_folder_find_by_2.json | 0 ...cted_folder_contains_folder_find_by_3.json | 0 ...cted_folder_contains_folder_find_by_4.json | 0 .../folder/expected_folder_multiple_ehrs.json | 38 ++++++++++++++ 22 files changed, 373 insertions(+), 33 deletions(-) create mode 100644 tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_all.robot create mode 100644 tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_by.robot create mode 100644 tests/robot/AQL_TESTS/FOLDER/MULTIPLE_EHRS/folder_multiple_ehrs.robot create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_folder_find_by.csv create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_all.json create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_1.json create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_2.json create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_3.json create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_4.json create mode 100644 tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_multiple_ehrs.json diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_all_and_by.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_all_and_by.robot index 1a5fe0e2..366203c4 100644 --- a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_all_and_by.robot +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_all_and_by.robot @@ -5,19 +5,17 @@ Documentation CHECK AQL RESPONSE ON FOLDER FROM ... - *Postcondition:* Delete EHR using ADMIN endpoint. Resource ../../../_resources/keywords/aql_keywords.robot -#Suite Setup Skip enable Setup 'Precondition' if AQL checks are passing !!! -#Suite Teardown Skip enable Teardown 'Admin Delete EHR For AQL' if AQL checks are passing !!! Suite Setup Precondition #enable this keyword if AQL checks are passing !!! Suite Teardown Admin Delete EHR For AQL #enable this keyword if AQL checks are passing !!! *** Test Cases *** -Find All: SELECT f/uid/value, f/name/value, f/name/value, f/archetype_node_id FROM FOLDER f - [Tags] not-ready +Find All: SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f [Documentation] ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-all - ${query} Set Variable SELECT f/uid/value, f/name/value, f/name/value, f/archetype_node_id FROM FOLDER f + ${query} Set Variable SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 3 ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_find_all.json ${exclude_paths} Create List root['meta'] root['q'] ${diff} compare json-string with json-file @@ -27,7 +25,6 @@ Find All: SELECT f/uid/value, f/name/value, f/name/value, f/archetype_node_id FR Should Be Empty ${diff} msg=DIFF DETECTED! Find By Archetype: SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1] - [Tags] not-ready [Documentation] ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-archetype ${query} Set Variable SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1] @@ -40,7 +37,6 @@ Find By Archetype: SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_o Should Be Empty ${diff} msg=DIFF DETECTED! Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1' - [Tags] not-ready [Documentation] ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-name ${query} Set Variable SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1' @@ -53,7 +49,6 @@ Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1' Should Be Empty ${diff} msg=DIFF DETECTED! Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1' - [Tags] not-ready [Documentation] ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-name ${query} Set Variable SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1' @@ -66,7 +61,6 @@ Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1' Should Be Empty ${diff} msg=DIFF DETECTED! Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subsubfolder1' - [Tags] not-ready [Documentation] ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-name ${query} Set Variable SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subsubfolder1' diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_all.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_all.robot new file mode 100644 index 00000000..625d5a94 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_all.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS COMPOSITION - Select All +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#select-all +... - *Precondition:* +... - 1. Upload OPT; 2. Create EHR; +... 3. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 4. Create Directory with folder_with_compositions.json; +... - Send AQL 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 + + +*** Test Cases *** +Folder Contains Composition: SELECT c/uid/value, f/name/value FROM FOLDER f CONTAINS COMPOSITION c + [Tags] not-ready + ${query} Set Variable + ... SELECT c/uid/value, f/name/value FROM FOLDER f CONTAINS COMPOSITION c + ${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_contains_compo_select_all_tmp.json + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 12 + ${expected_file} Set Variable expected_folder_contains_compo_select_all.json + ${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + ${file_without_replaced_vars} Get File ${expected_res_tmp} + ${data_replaced_vars} Replace Variables ${file_without_replaced_vars} + Create File ${temporary_file} + ... ${data_replaced_vars} + ${exclude_paths} Create List root['meta'] root['q'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${temporary_file} exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Remove File ${temporary_file} + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid3} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid4} ${composition_short_uid} + Create Directory For AQL folder_with_compositions.json has_robot_vars=${TRUE} diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_all.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_all.robot index 04cdc7f3..e466494a 100644 --- a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_all.robot +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_all.robot @@ -1 +1,32 @@ -##TODO: Implementation to be continued from https://github.com/ehrbase/conformance-testing-documentation/blob/cc2de61cd54975d1cf40be066afd88616e294aa1/FOLDER.md#folder-contains-folder \ No newline at end of file +*** Settings *** +Documentation CHECK FOLDER CONTAINS FOLDER - Find All +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-all-1 +... - *Precondition:* 1. Create EHR; 2. Create Directory with folder_complex_hierarchy.json; +... - Send AQL 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 + + +*** Test Cases *** +Find All: SELECT f1/uid/value, f1/name/value, f2/uid/value, f2/name/value FROM FOLDER f1 CONTAINS FOLDER f2 + [Tags] not-ready + ${query} Set Variable SELECT f1/uid/value, f1/name/value, f2/uid/value, f2/name/value FROM FOLDER f1 CONTAINS FOLDER f2 + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 10 + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_contains_folder_find_all.json + ${exclude_paths} Create List root['meta'] root['q'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Create EHR For AQL + Create Directory For AQL folder_complex_hierarchy.json \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_by.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_by.robot new file mode 100644 index 00000000..20f68e45 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_FOLDER/find_by.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS FOLDER - Find By +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by +... - *Precondition:* 1. Create EHR; 2. Create Directory with folder_complex_hierarchy.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_folder_find_by.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL ${ehr_id} + + +*** Test Cases *** +${query_nr} SELECT f2/uid/value, f2/name/value FROM FOLDER f1[${predicate1}] CONTAINS FOLDER f2[${predicate2}] + [Tags] not-ready + [Template] Execute Query + ${predicate1} ${predicate2} ${expected_file} ${nr_of_results} + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Create EHR For AQL + Create Directory For AQL folder_complex_hierarchy.json + +Execute Query + [Arguments] ${predicate1} ${predicate2} ${expected_file} ${nr_of_results} + ${query} Set Variable SELECT f2/uid/value, f2/name/value FROM FOLDER f1[${predicate1}] CONTAINS FOLDER f2[${predicate2}] + Set AQL And Execute Ad Hoc Query ${query} + Log ${expected_file} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + Length Should Be ${resp_body['rows']} ${nr_of_results} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/FOLDER/MULTIPLE_EHRS/folder_multiple_ehrs.robot b/tests/robot/AQL_TESTS/FOLDER/MULTIPLE_EHRS/folder_multiple_ehrs.robot new file mode 100644 index 00000000..ad7c0f7d --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/MULTIPLE_EHRS/folder_multiple_ehrs.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation CHECK FOLDER MULTIPLE EHRS +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#multiple-ehrs +... - *Precondition:* +... - 1. Create EHR; 2. Create Directory with folder_complex_hierarchy.json; +... - 3. Create Directory with folder_complex_hierarchy2.json; +... - Send AQL 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 Run Keywords Admin Delete EHR For AQL ${ehr_id1} AND +... Admin Delete EHR For AQL ${ehr_id2} + + +*** Test Cases *** +Multiple EHRs: SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1,'subsubfolder1'] + ${query} Set Variable + ... SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1,'subsubfolder1'] + ${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_multiple_ehrs_tmp.json + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 4 + ${expected_file} Set Variable expected_folder_multiple_ehrs.json + ${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_multiple_ehrs_tmp.json + ${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + ${file_without_replaced_vars} Get File ${expected_res_tmp} + ${data_replaced_vars} Replace Variables ${file_without_replaced_vars} + Create File ${temporary_file} + ... ${data_replaced_vars} + ${exclude_paths} Create List root['meta'] root['q'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${temporary_file} exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Remove File ${temporary_file} + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Create EHR For AQL + Set Suite Variable ${ehr_id1} ${ehr_id} + Create Directory For AQL folder_complex_hierarchy.json + Create EHR For AQL + Set Suite Variable ${ehr_id2} ${ehr_id} + Create Directory For AQL folder_complex_hierarchy2.json \ No newline at end of file diff --git a/tests/robot/_resources/keywords/aql_keywords.robot b/tests/robot/_resources/keywords/aql_keywords.robot index 09a53996..cddb3dfa 100644 --- a/tests/robot/_resources/keywords/aql_keywords.robot +++ b/tests/robot/_resources/keywords/aql_keywords.robot @@ -338,8 +338,15 @@ Delete Composition For AQL Set Suite Variable ${del_version_uid} ${del_version_uid} Create Directory For AQL - [Arguments] ${valid_test_data_set} - ${json} Load JSON From File ${FOLDERS_DATA_SETS}/${valid_test_data_set} + [Arguments] ${valid_test_data_set} ${has_robot_vars}=${FALSE} + IF '${has_robot_vars}' == '${TRUE}' + ${json_str} Get File ${FOLDERS_DATA_SETS}/${valid_test_data_set} + ${json_str_replaced} Replace Variables ${json_str} + ${json_converted} Evaluate json.loads('''${json_str_replaced}''') json + ${json} Set Variable ${json_converted} + ELSE + ${json} Load JSON From File ${FOLDERS_DATA_SETS}/${valid_test_data_set} + END Set Suite Variable ${test_data} ${json} prepare new request session JSON ... Prefer=return=representation diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy.json index 5ce795a1..23b6f74f 100644 --- a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy.json +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy.json @@ -1,6 +1,6 @@ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" }, @@ -12,7 +12,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "d936409e-901f-4994-8d33-ed104d460151" }, @@ -24,7 +24,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" }, @@ -36,7 +36,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "3cb9efa5-fe71-49e9-a02f-d38835c27d1b" }, @@ -50,7 +50,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "ac1e12cb-b9db-4f15-a8aa-4e62a9d97231" }, @@ -62,7 +62,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "13661fe2-1e16-4c75-a10d-9b8040487a72" }, @@ -74,7 +74,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "e9ae5700-d969-430a-b4f2-445e3091a901" }, diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy2.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy2.json index 714ff8c5..14029613 100644 --- a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy2.json +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_complex_hierarchy2.json @@ -1,6 +1,6 @@ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" }, @@ -12,7 +12,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "d936409e-901f-4994-8d33-ed104d460151" }, @@ -24,7 +24,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "04689137-90bf-456b-8afc-7c5774843919" }, @@ -36,7 +36,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "8984f35c-8c68-41c4-af70-f4a9c2d676a0" }, @@ -50,7 +50,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "ac1e12cb-b9db-4f15-a8aa-4e62a9d97231" }, @@ -62,7 +62,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "59bbd141-c51b-435a-9cbb-85d953ebfcd3" }, @@ -74,7 +74,7 @@ }, { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "0760c7d6-8ab9-4c6a-bd8e-f4fe3cc0e79b" }, diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_simple_hierarchy.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_simple_hierarchy.json index 5273c4a3..2657c706 100644 --- a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_simple_hierarchy.json +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_simple_hierarchy.json @@ -1,6 +1,6 @@ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" }, @@ -12,7 +12,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "d936409e-901f-4994-8d33-ed104d460151" }, @@ -24,7 +24,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" }, diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions.json index 6804958e..c117ead3 100644 --- a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions.json +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions.json @@ -47,7 +47,7 @@ { "id": { "_type": "HIER_OBJECT_ID", - "value": "{comp_id4}" + "value": "${c_uid4}" }, "namespace": "my.system.id", "type": "VERSIONED_COMPOSITION" @@ -60,7 +60,7 @@ { "id": { "_type": "HIER_OBJECT_ID", - "value": "{comp_id2}" + "value": "${c_uid2}" }, "namespace": "my.system.id", "type": "VERSIONED_COMPOSITION" @@ -82,7 +82,7 @@ { "id": { "_type": "HIER_OBJECT_ID", - "value": "{comp_id3}" + "value": "${c_uid3}" }, "namespace": "my.system.id", "type": "VERSIONED_COMPOSITION" @@ -96,7 +96,7 @@ { "id": { "_type": "HIER_OBJECT_ID", - "value": "{comp_id1}" + "value": "${c_uid1}" }, "namespace": "my.system.id", "type": "VERSIONED_COMPOSITION" diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_folder_find_by.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_folder_find_by.csv new file mode 100644 index 00000000..e4247da9 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_folder_find_by.csv @@ -0,0 +1,5 @@ +${query_nr},${predicate1},${predicate2},${expected_file},${nr_of_results} +1.,"openEHR-EHR-FOLDER.generic.v1,'root1'",openEHR-EHR-FOLDER.episode_of_care.v1,expected_folder_contains_folder_find_by_1.json,4 +2.,"openEHR-EHR-FOLDER.generic.v1,'subfolder1'",openEHR-EHR-FOLDER.episode_of_care.v1,expected_folder_contains_folder_find_by_2.json,2 +3.,"openEHR-EHR-FOLDER.generic.v1,'subfolder2'",openEHR-EHR-FOLDER.episode_of_care.v1,expected_folder_contains_folder_find_by_3.json,2 +4.,"openEHR-EHR-FOLDER.generic.v1,'root1'","openEHR-EHR-FOLDER.episode_of_care.v1,'subsubfolder1'",expected_folder_contains_folder_find_by_4.json,2 \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_all.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_all.json index e69de29b..ec1c2291 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_all.json +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_all.json @@ -0,0 +1,41 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T11:26:39.6622737+03:00", + "_executed_aql": "SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f", + "resultsize": 3 + }, + "q": "SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + }, + { + "path": "f/name/value", + "name": "#1" + }, + { + "path": "f/archetype_node_id", + "name": "#2" + } + ], + "rows": [ + [ + "10e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1", + "root1", + "openEHR-EHR-FOLDER.generic.v1" + ], + [ + "d936409e-901f-4994-8d33-ed104d460151", + "subfolder1", + "openEHR-EHR-FOLDER.generic.v1" + ], + [ + "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3", + "subsubfolder1", + "openEHR-EHR-FOLDER.episode_of_care.v1" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_archetype.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_archetype.json index e69de29b..e7c9e6f0 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_archetype.json +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_archetype.json @@ -0,0 +1,21 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T11:40:22.078064+03:00", + "_executed_aql": "SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1]", + "resultsize": 1 + }, + "q": "SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1]", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + } + ], + "rows": [ + [ + "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_root1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_root1.json index e69de29b..0e6b9c64 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_root1.json +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_root1.json @@ -0,0 +1,21 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T11:42:20.774785+03:00", + "_executed_aql": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1'", + "resultsize": 1 + }, + "q": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1'", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + } + ], + "rows": [ + [ + "10e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subfolder1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subfolder1.json index e69de29b..4cc29590 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subfolder1.json +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subfolder1.json @@ -0,0 +1,21 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T11:43:08.0279372+03:00", + "_executed_aql": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1'", + "resultsize": 1 + }, + "q": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1'", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + } + ], + "rows": [ + [ + "d936409e-901f-4994-8d33-ed104d460151" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subsubfolder1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subsubfolder1.json index e69de29b..61fceff8 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subsubfolder1.json +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_name_subsubfolder1.json @@ -0,0 +1,21 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T11:43:08.066892+03:00", + "_executed_aql": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subsubfolder1'", + "resultsize": 1 + }, + "q": "SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subsubfolder1'", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + } + ], + "rows": [ + [ + "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_all.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_all.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_1.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_2.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_2.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_3.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_3.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_4.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_folder_find_by_4.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_multiple_ehrs.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_multiple_ehrs.json new file mode 100644 index 00000000..68eee7d4 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_multiple_ehrs.json @@ -0,0 +1,38 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T12:51:27.3390078+03:00", + "_executed_aql": "SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1, 'subsubfolder1']", + "resultsize": 4 + }, + "q": "SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1,'subsubfolder1']", + "columns": [ + { + "path": "e/ehr_id/value", + "name": "#0" + }, + { + "path": "f/uid/value", + "name": "#1" + } + ], + "rows": [ + [ + "${ehr_id1}", + "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" + ], + [ + "${ehr_id1}", + "13661fe2-1e16-4c75-a10d-9b8040487a72" + ], + [ + "${ehr_id2}", + "04689137-90bf-456b-8afc-7c5774843919" + ], + [ + "${ehr_id2}", + "59bbd141-c51b-435a-9cbb-85d953ebfcd3" + ] + ] +} \ No newline at end of file