From cdb03f4e68fe47a53b1d4f6def1a89b774260b89 Mon Sep 17 00:00:00 2001 From: vladislavploaia Date: Tue, 11 Jun 2024 12:03:46 +0300 Subject: [PATCH] fix: CDR-1471 add Get All Templates test --- .../TEMPLATE_TESTS/template_operations.robot | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/tests/robot/TEMPLATE_TESTS/template_operations.robot b/tests/robot/TEMPLATE_TESTS/template_operations.robot index b787bcdd..b43055a1 100644 --- a/tests/robot/TEMPLATE_TESTS/template_operations.robot +++ b/tests/robot/TEMPLATE_TESTS/template_operations.robot @@ -71,20 +71,40 @@ Suite Setup Set Library Search Order For Tests ... Prefer=return=representation ${resp} GET On Session ${SUT} /definition/template/adl1.4/${template_id} expected_status=anything ... headers=${headers} - Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 - ${xml} Parse Xml ${resp.text} - Set Test Variable ${actual} ${xml} 9. Get Template With Accept (application/json) - ## Must return 200, as per JIRA ticket CDR-1471 + ## Must return 200, as per JIRA ticket CDR-1471 - but returns 400 [Tags] Positive not-ready prepare new request session no content header ... Prefer=return=representation ${resp} GET On Session ${SUT} /definition/template/adl1.4/${template_id} expected_status=anything ... headers=${headers} - Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 -# ${xml} Parse Xml ${resp.text} -# Set Test Variable ${actual} ${xml} - [Teardown] Run Keyword And Return Status (admin) delete OPT \ No newline at end of file + +10. Get Template With Accept (application/openehr.wt+json) + ## Must return 200, as per JIRA ticket CDR-1471 - but returns 406 + [Tags] Positive not-ready + prepare new request session no headers + ... Accept=application/openehr.wt+json + ... Prefer=return=representation + ${resp} GET On Session ${SUT} /definition/template/adl1.4/${template_id} expected_status=anything + ... headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +11. Get All Templates + Set Test Variable ${template_id_1} ${template_id} #template_id created in '6. Get Template' + Upload OPT minimal/minimal_action.opt + Extract Template Id From OPT File + Set Test Variable ${template_id_2} ${template_id} + prepare new request session no headers + ... Prefer=return=representation + ${resp} GET On Session ${SUT} /definition/template/adl1.4 expected_status=anything + ... headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + ${len} Get Length ${resp.json()} + Should Be True ${len}>1 + Set Test Variable ${template_id} ${template_id_1} + (admin) delete OPT + Set Test Variable ${template_id} ${template_id_2} + (admin) delete OPT \ No newline at end of file