Skip to content

Commit

Permalink
feat: add new test based on conformance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Sep 25, 2024
1 parent e6d4a42 commit f449e34
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_type": "FOLDER",
"uuid": {
"uid": {
"_type": "HIER_OBJECT_ID",
"value": "10e952ca-a5b2-4f24-8d37-59240fd37020"
},
Expand Down Expand Up @@ -34,7 +34,7 @@
"folders": [
{
"_type": "FOLDER",
"uuid": {
"uid": {
"_type": "HIER_OBJECT_ID",
"value": "d936409e-901f-4994-8d33-ed104d460151"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
]
]
}
Original file line number Diff line number Diff line change
@@ -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"
]
]
}

0 comments on commit f449e34

Please sign in to comment.