From 3ea42fd62c260d6fbe6195cded87420344d6c5bd Mon Sep 17 00:00:00 2001 From: wangyan Date: Sun, 25 Mar 2018 18:22:35 -0700 Subject: [PATCH] add read only case --- tests/resources/Harbor-Pages/Configuration.robot | 14 +++++++++++++- tests/robot-cases/Group11-Nightly/Nightly.robot | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/resources/Harbor-Pages/Configuration.robot b/tests/resources/Harbor-Pages/Configuration.robot index 451807ba0..8b99584a1 100644 --- a/tests/resources/Harbor-Pages/Configuration.robot +++ b/tests/resources/Harbor-Pages/Configuration.robot @@ -211,10 +211,22 @@ Set Scan All To None click element //vulnerability-config//select/option[@value='none'] sleep 1 click element ${config_save_button_xpath} + Set Scan All To Daily click element //vulnerability-config//select click element //vulnerability-config//select/option[@value='daily'] sleep 1 click element ${config_save_button_xpath} + Click Scan Now - click element //vulnerability-config//button[contains(.,'SCAN')] \ No newline at end of file + click element //vulnerability-config//button[contains(.,'SCAN')] + +Enable Read Only + ${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X PUT -d '{"read_only":true}' "https://${ip}/api/configurations" + Log To Console ${output} + Should Be Equal As Integers ${rc} 0 + +Disable Read Only + ${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X PUT -d '{"read_only":false}' "https://${ip}/api/configurations" + Log To Console ${output} + Should Be Equal As Integers ${rc} 0 \ No newline at end of file diff --git a/tests/robot-cases/Group11-Nightly/Nightly.robot b/tests/robot-cases/Group11-Nightly/Nightly.robot index 24a073894..3c8ccfaad 100644 --- a/tests/robot-cases/Group11-Nightly/Nightly.robot +++ b/tests/robot-cases/Group11-Nightly/Nightly.robot @@ -35,6 +35,18 @@ Test Case - Vulnerability Data Not Ready Go To Vulnerability Config Vulnerability Not Ready Config Hint +Test Case - Read Only Mode + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=true + + Enable Read Only + Cannot Push image ${ip} tester${d} Test1@34 project${d} busybox:latest + + Disable Read Only + Push image ${ip} tester${d} Test1@34 project${d} busybox:latest + Close Browser + Test Case - Create An New User Init Chrome Driver ${d}= Get Current Date result_format=%m%s