Skip to content

Commit

Permalink
feat: add test to cover code not in template case and tests optimizat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
vladislavploaia committed Nov 7, 2024
1 parent 12fd676 commit 6b9ebcc
Show file tree
Hide file tree
Showing 4 changed files with 35,897 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,43 @@ Resource ../../_resources/keywords/composition_keywords.robot
Resource ../../_resources/keywords/admin_keywords.robot
Resource ../../_resources/keywords/template_opt1.4_keywords.robot

Suite Setup Set Library Search Order For Tests


*** Variables ***
${opt_file} nodes_in_template_invalid.opt
${composition_file} nodes_in_template_invalid__compo.json
${template_id} nodes_in_template_invalid
Suite Setup Run Keywords
... Set Library Search Order For Tests AND
... Precondition


*** Test Cases ***
Create Composition Fails If Nodes Are Not Present In Template
1. Create Composition Fails If Nodes Are Not Present In Template 1
[Tags] Negative
Upload OPT all_types/nodes_in_template_invalid.opt
create EHR
#[Setup] Precondition
Set Test Variable ${template_id} ${template_id_1}
Set Test Variable ${composition_file} ${template_id}__.json
commit composition format=CANONICAL_JSON
... composition=${composition_file}
Should Be Equal As Strings ${response.status_code} 422
Should Be Equal As Strings ${response.json()['error']} Unprocessable Entity
Should Contain ${response.json()['message']} not in template
Expect 422 Unprocessable Entity - not in template
[Teardown] Delete Template Using API

2. Create Composition Fails If Nodes Are Not Present In Template 2
[Tags] Negative
Set Test Variable ${template_id} ${template_id_2}
Set Test Variable ${composition_file} ${template_id}__.json
commit composition format=CANONICAL_JSON
... composition=${composition_file}
Expect 422 Unprocessable Entity - not in template
[Teardown] Run Keywords
... (admin) delete ehr AND
... Delete Template Using API
... Delete Template Using API


*** Keywords ***
Precondition
Set Suite Variable ${template_id_1} nodes_in_template_invalid
Set Suite Variable ${template_id_2} hc3_spirometry_test_result_v0.6
Upload OPT all_types/${template_id_1}.opt
Upload OPT all_types/${template_id_2}.opt
create EHR

Expect 422 Unprocessable Entity - Not In Template
Should Be Equal As Strings ${response.status_code} 422
Should Be Equal As Strings ${response.json()['error']} Unprocessable Entity
Should Contain ${response.json()['message']} not in template
Loading

0 comments on commit 6b9ebcc

Please sign in to comment.