-
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.
CDR-1580 if match tests for Directory (#32)
* feat: CDR-1580 add tests with If-Match for EHR_STATUS update * feat: CDR-1580 add Robot tests to cover cases with If-Match on Update Directory
- Loading branch information
1 parent
09da5db
commit 7874333
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
tests/robot/DIRECTORY_TESTS/UPDATE_DIRECTORY/H.4__Directory_If_Match_Checks.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,64 @@ | ||
*** Settings *** | ||
Metadata TOP_TEST_SUITE DIRECTORY | ||
|
||
Resource ../../_resources/keywords/directory_keywords.robot | ||
Resource ../../_resources/keywords/ehr_keywords.robot | ||
Resource ../../_resources/keywords/admin_keywords.robot | ||
Suite Setup Set Library Search Order For Tests | ||
|
||
|
||
*** Test Cases *** | ||
Update Directory - If-Match With Non-Existing UUID Version Number | ||
[Tags] not-ready CDR-1585 | ||
[Documentation] Update Directory with If-Match value (non-existing version number). | ||
... Example: If-Match=1b6d2873-fcba-4fb6-b11e-13ce977b0666::local.ehrbase.org::2 | ||
... Expect 412. | ||
... Check as well the Location and ETag keys presence in response headers from Update call. | ||
create EHR | ||
create DIRECTORY (JSON) empty_directory.json | ||
validate POST response - 201 created directory | ||
#set {preceding_version_uid} with replaced version number (non-existing version number) | ||
${directory_uuid_non_existing_version} Replace String | ||
... ${preceding_version_uid} ::1 ::2 | ||
Set Suite Variable ${preceding_version_uid} ${directory_uuid_non_existing_version} | ||
update DIRECTORY (JSON) update/2_add_subfolders.json isModifiable=${FALSE} | ||
Should Be Equal ${response.status_code} ${412} | ||
Log https://vitagroup-ag.atlassian.net/browse/CDR-1585 | ||
Dictionary Should Contain Key ${response.headers} Location | ||
Dictionary Should Contain Key ${response.headers} ETag | ||
[Teardown] (admin) delete ehr | ||
|
||
Update Directory - If-Match With Non-Existing UID Value | ||
[Tags] not-ready CDR-1580 | ||
[Documentation] Update Directory with If-Match value (non-existing uid value). | ||
... Example: If-Match=2c7d2873-fcba-4fb6-c55r-13ce977b0547::local.ehrbase.org::1 | ||
... Expect 412. | ||
create EHR | ||
create DIRECTORY (JSON) empty_directory.json | ||
validate POST response - 201 created directory | ||
@{temp_folder_uid_list} Split String ${preceding_version_uid} :: | ||
Set Test Variable ${folder_uid_without_system_and_version} ${temp_folder_uid_list}[0] | ||
#set {preceding_version_uid} with replaced uid value (non-existing uid value) | ||
${directory_uuid_non_existing_value} Replace String | ||
... ${preceding_version_uid} ${folder_uid_without_system_and_version} ${{str(uuid.uuid4())}} | ||
Set Suite Variable ${preceding_version_uid} ${directory_uuid_non_existing_value} | ||
Log ${preceding_version_uid} | ||
update DIRECTORY (JSON) update/2_add_subfolders.json isModifiable=${FALSE} | ||
Log https://vitagroup-ag.atlassian.net/browse/CDR-1580 | ||
Should Be Equal ${response.status_code} ${412} | ||
[Teardown] (admin) delete ehr | ||
|
||
Update Directory - If-Match With Wrong Value | ||
[Tags] not-ready CDR-1586 | ||
[Documentation] Update Directory with If-Match value (wrong format). | ||
... Example: If-Match=783beec5-9d29-4067-85b4-ad0884bc7c88::5 | ||
... Expect 400. | ||
create EHR | ||
create DIRECTORY (JSON) empty_directory.json | ||
validate POST response - 201 created directory | ||
#set {preceding_version_uid} with wrongly structured value (e.g. 783beec5-9d29-4067-85b4-ad0884bc7c88::5) | ||
Set Suite Variable ${preceding_version_uid} ${{str(uuid.uuid4())}}::5 | ||
update DIRECTORY (JSON) update/2_add_subfolders.json isModifiable=${FALSE} | ||
Log https://vitagroup-ag.atlassian.net/browse/CDR-1586 | ||
Should Be Equal ${response.status_code} ${400} | ||
[Teardown] (admin) delete ehr |