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 366203c4..3f995d8a 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 @@ -10,10 +10,10 @@ Suite Teardown Admin Delete EHR For AQL #enable this keyword if AQL check *** Test Cases *** -Find All: SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f +Find All: SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value 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/archetype_node_id FROM FOLDER f + ${query} Set Variable SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value 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 diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_by_specific_item_id.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_by_specific_item_id.robot new file mode 100644 index 00000000..c62b0a81 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_by_specific_item_id.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation CHECK AQL RESPONSE ON FOLDER FROM +... - *Precondition:* 1. Create EHR; 2. Create Directory with folder_details.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 #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/items/id/value FROM FOLDER f WHERE f/items/id/value = '7c0a9df0-564f-4f34-8e65-92586c64ef56' + [Documentation] + ... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-specific-item-id---versioned_composition---hier_object_id + ${query} Set Variable SELECT f/uid/value, f/name/value, f/items/id/value FROM FOLDER f WHERE f/items/id/value = '7c0a9df0-564f-4f34-8e65-92586c64ef56' + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 1 + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_find_by_item_id.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_details.json \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json index c2a9acac..351076ea 100644 --- a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json @@ -1,6 +1,6 @@ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" }, @@ -34,7 +34,7 @@ "folders": [ { "_type": "FOLDER", - "uuid": { + "uid": { "_type": "HIER_OBJECT_ID", "value": "d936409e-901f-4994-8d33-ed104d460151" }, 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 ec1c2291..6dc282c1 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 @@ -2,11 +2,11 @@ "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", + "_created": "2024-09-25T12:12:48.2899056+03:00", + "_executed_aql": "SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value FROM FOLDER f", "resultsize": 3 }, - "q": "SELECT f/uid/value, f/name/value, f/archetype_node_id FROM FOLDER f", + "q": "SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value FROM FOLDER f", "columns": [ { "path": "f/uid/value", @@ -19,23 +19,30 @@ { "path": "f/archetype_node_id", "name": "#2" + }, + { + "path": "f/items/id/value", + "name": "#3" } ], "rows": [ [ "10e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1", "root1", - "openEHR-EHR-FOLDER.generic.v1" + "openEHR-EHR-FOLDER.generic.v1", + null ], [ "d936409e-901f-4994-8d33-ed104d460151", "subfolder1", - "openEHR-EHR-FOLDER.generic.v1" + "openEHR-EHR-FOLDER.generic.v1", + null ], [ "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3", "subsubfolder1", - "openEHR-EHR-FOLDER.episode_of_care.v1" + "openEHR-EHR-FOLDER.episode_of_care.v1", + null ] ] } \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_item_id.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_item_id.json new file mode 100644 index 00000000..23416dc1 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_find_by_item_id.json @@ -0,0 +1,31 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-25T12:39:47.4116434+03:00", + "_executed_aql": "SELECT f/uid/value, f/name/value, f/items/id/value FROM FOLDER f WHERE f/items/id/value = '7c0a9df0-564f-4f34-8e65-92586c64ef56'", + "resultsize": 1 + }, + "q": "SELECT f/uid/value, f/name/value, f/items/id/value FROM FOLDER f WHERE f/items/id/value = '7c0a9df0-564f-4f34-8e65-92586c64ef56'", + "columns": [ + { + "path": "f/uid/value", + "name": "#0" + }, + { + "path": "f/name/value", + "name": "#1" + }, + { + "path": "f/items/id/value", + "name": "#2" + } + ], + "rows": [ + [ + "d936409e-901f-4994-8d33-ed104d460151", + "subfolder1", + "7c0a9df0-564f-4f34-8e65-92586c64ef56" + ] + ] +} \ No newline at end of file