From b2d0182549c9da56cf6a9e14cd6a3e32e5d5ee97 Mon Sep 17 00:00:00 2001 From: vladislavploaia Date: Thu, 22 Feb 2024 17:03:17 +0200 Subject: [PATCH] fix: CDR-1303 add access_token support for 'retrieve CONTRIBUTION by contribution_uid (JSON)' keyword --- .../_resources/keywords/contribution_keywords.robot | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/robot/_resources/keywords/contribution_keywords.robot b/tests/robot/_resources/keywords/contribution_keywords.robot index 16cf8430..6fb19770 100644 --- a/tests/robot/_resources/keywords/contribution_keywords.robot +++ b/tests/robot/_resources/keywords/contribution_keywords.robot @@ -184,8 +184,9 @@ commit COMTRIBUTION(S) (JSON) retrieve CONTRIBUTION by contribution_uid (JSON) [Documentation] DEPENDENCY ${ehr_id} & ${contribution_uid} in test scope + [Arguments] ${multitenancy_token}=${None} Set Test Variable ${KEYWORD NAME} GET CONTRI BY CONTRI_UID - GET /ehr/ehr_id/contribution/contribution_uid JSON + GET /ehr/ehr_id/contribution/contribution_uid JSON ${multitenancy_token} check response: is positive - contribution_uid exists @@ -368,7 +369,7 @@ Create Contribution With Multitenant Token # GET GET /ehr/ehr_id/contribution/contribution_uid - [Arguments] ${format} + [Arguments] ${format} ${multitenancy_token}=${None} [Documentation] DEPENDENCY ${ehr_id} & ${contribution_uid} in test scope Run Keyword If $format=='JSON' prepare new request session @@ -377,11 +378,15 @@ GET /ehr/ehr_id/contribution/contribution_uid Run Keyword If $format=='XML' prepare new request session ... XML Prefer=return=representation + IF '${multitenancy_token}' != '${None}' + Set To Dictionary ${headers} Authorization=Bearer ${multitenancy_token} + END + ${resp}= GET On Session ${SUT} /ehr/${ehr_id}/contribution/${contribution_uid} expected_status=anything ... headers=${headers} Set Test Variable ${response} ${resp} - Output Debug Info: GET /ehr/ehr_id/contribution/contribution_uid + #Output Debug Info: GET /ehr/ehr_id/contribution/contribution_uid Retrieve Contribution With Multitenant Token