Skip to content

Commit

Permalink
feat: CDR-1451 add Robot tests to cover invalid target_path for EHR_S…
Browse files Browse the repository at this point in the history
…TATUS and Composition tags
  • Loading branch information
vladislavploaia committed Jun 19, 2024
1 parent a71b29e commit cb3f21d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/robot/TAGS_TESTS/basic_composition_tags_tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,23 @@ ${VALID EHR DATA SETS} ${PROJECT_ROOT}/tests/robot/_resources/test_data_se
Should Be Equal ${resp.json()['error']} Unprocessable Entity
[Teardown] (admin) delete ehr

7. Delete Composition Tag Through Delete EHR_STATUS Tag
# Needs analysis as Delete Composition Tag should not be done through Delete EHR_STATUS Tag endpoint.
7. Create Composition Tag With Invalid Target Path In Body
[Tags] Negative
[Setup] Precondition Upload OPT - Create EHR - Create Composition
Create Session For Composition Tag Calls
&{composition_tag_body} Create Dictionary
... key=${{str(uuid.uuid4())}}
... value=${tag_value}
... target_path=name/value
${err_msg} Run Keyword And Expect Error *
... Create Composition Tag Call ${composition_tag_body}
Should Contain ${err_msg} 422 != 200
Should Be Equal ${resp.json()['error']} Unprocessable Entity
Should Contain ${resp.json()['message']} target_path 'name/value' does not start at root
[Teardown] (admin) delete ehr

8. Delete Composition Tag Through Delete EHR_STATUS Tag
# Needs analysis as Delete Composition Tag should not be allowed through Delete EHR_STATUS Tag endpoint.
# Case described in comments from https://vitagroup-ag.atlassian.net/browse/CDR-1451
[Tags] Negative not-ready
[Setup] Precondition Upload OPT - Create EHR - Create Composition
Expand All @@ -110,7 +125,6 @@ ${VALID EHR DATA SETS} ${PROJECT_ROOT}/tests/robot/_resources/test_data_se
[Teardown] (admin) delete ehr



*** Keywords ***
Precondition Upload OPT - Create EHR - Create Composition
Upload OPT nested/nested.opt
Expand Down
15 changes: 15 additions & 0 deletions tests/robot/TAGS_TESTS/basic_ehr_status_tags_tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ ${VALID EHR DATA SETS} ${PROJECT_ROOT}/tests/robot/_resources/test_data_se
Should Be Equal ${resp.json()['error']} Unprocessable Entity
[Teardown] (admin) delete ehr

7. Create EHR_STATUS Tag With Invalid Target Path In Body
[Tags] Negative
[Setup] Precondition Create EHR With EHR_STATUS
Create Session For EHR_STATUS Tag Calls
&{ehr_status_tag_body} Create Dictionary
... key=${{str(uuid.uuid4())}}
... value=${tag_value}
... target_path=name/value
${err_msg} Run Keyword And Expect Error *
... Create EHR_STATUS Tag Call ${ehr_status_tag_body}
Should Contain ${err_msg} 422 != 200
Should Be Equal ${resp.json()['error']} Unprocessable Entity
Should Contain ${resp.json()['message']} target_path 'name/value' does not start at root
[Teardown] (admin) delete ehr


*** Keywords ***
Precondition Create EHR With EHR_STATUS
Expand Down

0 comments on commit cb3f21d

Please sign in to comment.