add read only case

This commit is contained in:
wangyan 2018-03-25 18:22:35 -07:00
parent cbcca015b0
commit 3ea42fd62c
2 changed files with 25 additions and 1 deletions

View File

@ -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')]
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

View File

@ -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