-
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.
feat: add Robot tests based on conformance tests docs
- Loading branch information
1 parent
f449e34
commit 7508d3f
Showing
8 changed files
with
111 additions
and
24 deletions.
There are no files selected for viewing
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
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
13 changes: 6 additions & 7 deletions
13
...ROM_FOLDER/find_by_specific_item_id.robot → ..._IN_FOLDER/find_by_specific_item_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
52 changes: 52 additions & 0 deletions
52
tests/robot/AQL_TESTS/FOLDER/SELECT_PATHS_IN_FOLDER/find_items.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,52 @@ | ||
*** Settings *** | ||
Documentation CHECK SELECT PATHS IN FOLDER - Find Items | ||
... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#find-items | ||
... - *Precondition:* | ||
... - 1. Upload OPT; 2. Create EHR; | ||
... - 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 f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value FROM FOLDER f | ||
|
||
|
||
*** Test Cases *** | ||
Find Items: ${q} | ||
Set Test Variable ${query} ${q} | ||
${temporary_file} Set Variable | ||
... ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_find_items_tmp.json | ||
Set AQL And Execute Ad Hoc Query ${query} | ||
Length Should Be ${resp_body['rows']} 2 | ||
${expected_file} Set Variable expected_folder_find_items.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} | ||
Create Directory For AQL folder_multi_compositions.json has_robot_vars=${TRUE} | ||
Commit Composition For AQL conformance_ehrbase.de.v0_max.json |
2 changes: 1 addition & 1 deletion
2
tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_multi_compositions.json
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
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
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
42 changes: 42 additions & 0 deletions
42
...t/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_find_items.json
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,42 @@ | ||
{ | ||
"meta": { | ||
"_type": "RESULTSET", | ||
"_schema_version": "1.0.3", | ||
"_created": "2024-09-25T13:34:03.4040685+03:00", | ||
"_executed_aql": "SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value FROM FOLDER f", | ||
"resultsize": 2 | ||
}, | ||
"q": "SELECT f/uid/value, f/name/value, f/archetype_node_id, f/items/id/value FROM FOLDER f", | ||
"columns": [ | ||
{ | ||
"path": "f/uid/value", | ||
"name": "#0" | ||
}, | ||
{ | ||
"path": "f/name/value", | ||
"name": "#1" | ||
}, | ||
{ | ||
"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", | ||
"${c_uid1}" | ||
], | ||
[ | ||
"10e952ca-a5b2-4f24-8d37-59240fd37020::local.ehrbase.org::1", | ||
"root1", | ||
"openEHR-EHR-FOLDER.generic.v1", | ||
"${c_uid2}" | ||
] | ||
] | ||
} |