From 2912209a7ecf0212cc159dad05fd7d601f3bbd9a Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 22 May 2024 09:41:03 +0200 Subject: [PATCH 1/2] chore: Add SSHLibrary to api.resource test file --- tests/api.resource | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/api.resource diff --git a/tests/api.resource b/tests/api.resource new file mode 100644 index 0000000..e6b90ee --- /dev/null +++ b/tests/api.resource @@ -0,0 +1,14 @@ +*** Settings *** +Library SSHLibrary + +*** Keywords *** +Run task + [Arguments] ${action} ${input} ${decode_json}=${TRUE} ${rc_expected}=0 + ${stdout} ${stderr} ${rc} = Execute Command api-cli run ${action} --data '${input}' return_stdout=True return_stderr=True return_rc=True + Should Be Equal As Integers ${rc_expected} ${rc} Run task ${action} failed!${\n}${stderr} + IF ${decode_json} and len($stdout) > 0 + ${response} = Evaluate json.loads('''${stdout}''') modules=json + ELSE + ${response} = Set Variable ${stdout} + END + [Return] ${response} \ No newline at end of file From 9c2d3fe440d5bd181d4e5463d35045c38828f0c3 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 22 May 2024 10:06:05 +0200 Subject: [PATCH 2/2] chore: Add SSHLibrary to api.resource test file --- tests/dokuwiki.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/dokuwiki.robot b/tests/dokuwiki.robot index 230a954..157658b 100644 --- a/tests/dokuwiki.robot +++ b/tests/dokuwiki.robot @@ -1,5 +1,6 @@ *** Settings *** Library SSHLibrary +Resource api.resource *** Test Cases *** Check if dokuwiki is installed correctly @@ -10,7 +11,7 @@ Check if dokuwiki is installed correctly Set Suite Variable ${module_id} ${output.module_id} Check if dokuwiki can be configured - ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"wiki_name": "mywiki","username":"admin","password":"admin","email":"admin@test.local","user_full_name":"Admin","host":"dokuwiki.test.local","http2https": true,"lets_encrypt": false}' + ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"wiki_name": "mywiki","username":"admin","password":"admin","email":"admin@test.local","user_full_name":"Admin","host":"dokuwiki.test.local","http2https": true,"lets_encrypt": false, "ldap_domain": "domain.com"}' ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0