-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/cdr 1550 aql folder robot (#36)
* feat: CDR-1550 add Robot tests for cases in FROM FOLDER * fix: change from uuid to uid in AQL statements * feat: CDR-1550 add Robot tests for AQL Folder * feat: CDR-1550 add Robot tests based on docs * renamed file * feat: CDR-1550 add expected test data for implemented cases and remove not-ready tag from passed tests * feat: add new test based on conformance tests * feat: add Robot tests based on conformance tests docs * fix: add expected test data after 500 is fixed * Fix invalid folder test UIDs * feat: add Robot tests to match latest updates from Conformance Documentation Testing for AQL on Folder * fix: adjust test case for select f from Folder f * fix: add test data for AQL on Folder case * Fix invalid assert * fix: add expected test data for AQL on Folder case --------- Co-authored-by: Alexander Lehnert <[email protected]>
- Loading branch information
1 parent
629d88a
commit e361665
Showing
58 changed files
with
2,436 additions
and
1 deletion.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_all_and_by.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
*** Settings *** | ||
Documentation CHECK AQL RESPONSE ON FOLDER FROM | ||
... - *Precondition:* 1. Create EHR; 2. Create Directory with folder_simple_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 #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/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/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 | ||
... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} | ||
... ignore_order=${TRUE} | ||
... ignore_string_case=${TRUE} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
Find By Archetype: SELECT f/uid/value FROM FOLDER f[openEHR-EHR-FOLDER.episode_of_care.v1] | ||
[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] | ||
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_archetype.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} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'root1' | ||
[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' | ||
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_name_root1.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} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subfolder1' | ||
[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' | ||
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_name_subfolder1.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} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
Find By Name: SELECT f/uid/value FROM FOLDER f WHERE f/name/value = 'subsubfolder1' | ||
[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' | ||
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_name_subsubfolder1.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} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
Find By Folder Id: SELECT f/name/value, f/uid/value FROM FOLDER f WHERE f/uid/value = '0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3' | ||
[Documentation] | ||
... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-folder-id | ||
${query} Set Variable | ||
... SELECT f/name/value, f/uid/value FROM FOLDER f WHERE f/uid/value = '0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3' | ||
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_folder_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} | ||
Should Be Empty ${diff} msg=DIFF DETECTED! | ||
|
||
|
||
*** Keywords *** | ||
Precondition | ||
Set Library Search Order For Tests | ||
Create EHR For AQL | ||
Create Directory For AQL folder_simple_hierarchy.json |
44 changes: 44 additions & 0 deletions
44
tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER/find_by_ehr_id.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
*** Settings *** | ||
Documentation CHECK AQL RESPONSE ON FOLDER FROM - FIND BY EHR ID | ||
... - *Precondition:* 1. Create EHR and store ehr_id1; 2. Create Directory with folder_simple_hierarchy.json; | ||
... - 3. Create EHR and store ehr_id2; 4. Create Directory with folder_simple.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 Run Keywords Admin Delete EHR For AQL ${ehr_id1} AND | ||
... Admin Delete EHR For AQL ${ehr_id2} | ||
|
||
|
||
*** Test Cases *** | ||
Find By EHR Id: SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f WHERE e/ehr_id/value = '${ehr_id1}' | ||
[Documentation] | ||
... Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-by-ehr-id | ||
${query} Set Variable SELECT e/ehr_id/value, f/uid/value FROM EHR e CONTAINS FOLDER f WHERE e/ehr_id/value = '${ehr_id1}' | ||
Set AQL And Execute Ad Hoc Query ${query} | ||
Length Should Be ${resp_body['rows']} 3 | ||
${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_find_by_ehr_id_tmp.json | ||
${expected_file} Set Variable expected_folder_find_by_ehr_id.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_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_simple_hierarchy.json | ||
Create EHR For AQL | ||
Set Suite Variable ${ehr_id2} ${ehr_id} | ||
Create Directory For AQL folder_simple.json |
54 changes: 54 additions & 0 deletions
54
tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/folder_in_folder.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
*** Settings *** | ||
Documentation CHECK FOLDER CONTAINS COMPOSITION - Folder in Folder | ||
... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#folder-in-folder | ||
... - *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 | ||
|
||
|
||
*** Variables *** | ||
${q} SELECT c/uid/value FROM FOLDER f1[openEHR-EHR-FOLDER.episode_of_care.v1] CONTAINS FOLDER f2[openEHR-EHR-FOLDER.episode_of_care.v1] CONTAINS COMPOSITION c | ||
|
||
|
||
*** Test Cases *** | ||
Folder In Folder: ${q} | ||
Set Test Variable ${query} ${q} | ||
Set AQL And Execute Ad Hoc Query ${query} | ||
${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_contains_compo_folder_in_folder_tmp.json | ||
Length Should Be ${resp_body['rows']} 1 | ||
${expected_file} Set Variable expected_contains_compo_folder_in_folder.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_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} |
51 changes: 51 additions & 0 deletions
51
tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/multi_comp_in_a_folder.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
*** Settings *** | ||
Documentation CHECK FOLDER CONTAINS COMPOSITION - Multiple Compositions in a Folder | ||
... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#multi-comp-in-a-folder | ||
... - *Precondition:* | ||
... - 1. Upload OPT; 2. Create EHR and store ehr_id1; | ||
... - 3. Create 2 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; | ||
... - 4. Create Directory with folder_multi_compositions.json; | ||
... - 5. Create 1 composition with conformance_ehrbase.de.v0_max.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 | ||
|
||
*** Variables *** | ||
${q} SELECT c/uid/value FROM FOLDER f CONTAINS COMPOSITION c | ||
|
||
|
||
*** Test Cases *** | ||
Multi Comp In A Folder: ${q} | ||
Set Test Variable ${query} ${q} | ||
Set AQL And Execute Ad Hoc Query ${query} | ||
${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_contains_compo_multi_compo_in_folder_tmp.json | ||
Length Should Be ${resp_body['rows']} 2 | ||
${expected_file} Set Variable expected_contains_compo_multi_compo_in_folder.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} | ||
Create Directory For AQL folder_multi_compositions.json has_robot_vars=${TRUE} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json |
71 changes: 71 additions & 0 deletions
71
...t/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/multiple_ehrs_and_compo_select_by_ids.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
*** Settings *** | ||
Documentation CHECK FOLDER CONTAINS COMPOSITION - MULTIPLE EHRS AND COMPOSITIONS SELECT BY IDS | ||
... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#multiple-ehr-and-compositions-select-by-ids | ||
... - *Precondition:* | ||
... - 1. Upload OPT; 2. Create EHR and store ehr_id1; | ||
... - 3. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; | ||
... - 4. Create Directory with folder_with_compositions.json replacing compo_ids vars; | ||
... - 5. Create 1 composition with conformance_ehrbase.de.v0_max.json; | ||
... - 6. Create EHR and store ehr_id2; | ||
... - 7. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; | ||
... - 8. Create Directory with folder_with_compositions1.json replacing compo_ids vars generated at step 7; | ||
... - 9. Create 1 composition with conformance_ehrbase.de.v0_max.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 *** | ||
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}' | ||
${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} | ||
Length Should Be ${resp_body['rows']} 1 | ||
${temporary_file} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_multiple_ehrs_and_compo_select_by_ids_tmp.json | ||
${expected_file} Set Variable expected_multiple_ehrs_and_compo_select_by_ids.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_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 | ||
Set Suite Variable ${ehr_id1} ${ehr_id} | ||
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} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json | ||
Create EHR For AQL | ||
Set Suite Variable ${ehr_id2} ${ehr_id} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json | ||
Set Suite Variable ${c_uid1b} ${composition_short_uid} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json | ||
Set Suite Variable ${c_uid2b} ${composition_short_uid} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json | ||
Set Suite Variable ${c_uid3b} ${composition_short_uid} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json | ||
Set Suite Variable ${c_uid4b} ${composition_short_uid} | ||
Create Directory For AQL folder_with_compositions1.json has_robot_vars=${TRUE} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json |
Oops, something went wrong.