mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
refactory testcase for project member management and replace tab to space
This commit is contained in:
parent
609f199c81
commit
75566bffd1
@ -40,11 +40,24 @@ Push image
|
||||
Log To Console \nRunning docker push ${image}...
|
||||
${rc}= Run And Return Rc docker pull ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Log To Console ${output}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker tag ${image} ${ip}/${project}/${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker push ${ip}/${project}/${image}
|
||||
Log To Console ${output}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker logout ${ip}
|
||||
|
||||
Push Image With Tag
|
||||
[Arguments] ${ip} ${user} ${pwd} ${project} ${image} ${tag}
|
||||
Log To Console \nRunning docker push ${image}...
|
||||
${rc}= Run And Return Rc docker pull ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker tag ${image} ${tag}
|
||||
${rc} ${output}= Run And Return Rc And Output docker push ${tag}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker logout ${ip}
|
||||
|
||||
@ -56,6 +69,19 @@ Cannot Pull image
|
||||
Log To Console ${output}
|
||||
Should Not Be Equal As Integers ${rc} 0
|
||||
|
||||
Cannot Push image
|
||||
[Arguments] ${ip} ${user} ${pwd} ${project} ${image}
|
||||
Log To Console \nRunning docker push ${image}...
|
||||
${rc}= Run And Return Rc docker pull ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker tag ${image} ${ip}/${project}/${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker push ${ip}/${project}/${image}
|
||||
Log To Console ${output}
|
||||
Should Not Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker logout ${ip}
|
||||
|
||||
Wait Until Container Stops
|
||||
[Arguments] ${container}
|
||||
:FOR ${idx} IN RANGE 0 60
|
||||
|
@ -46,96 +46,96 @@ Switch To Configure
|
||||
Sleep 2
|
||||
|
||||
Set Pro Create Admin Only
|
||||
#set limit to admin only
|
||||
Sleep 2
|
||||
#set limit to admin only
|
||||
Sleep 2
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Sleep 1
|
||||
Sleep 1
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="adminonly"]
|
||||
Sleep 1
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot AdminCreateOnly.png
|
||||
|
||||
Capture Page Screenshot AdminCreateOnly.png
|
||||
|
||||
Set Pro Create Every One
|
||||
#set limit to Every One
|
||||
#set limit to Every One
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Sleep 1
|
||||
Sleep 1
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="everyone"]
|
||||
Sleep 1
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 2
|
||||
Capture Page Screenshot EveryoneCreate.png
|
||||
Capture Page Screenshot EveryoneCreate.png
|
||||
|
||||
Disable Self Reg
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Mouse Down xpath=${self_reg_xpath}
|
||||
Mouse Up xpath=${self_reg_xpath}
|
||||
Sleep 1
|
||||
Self Reg Should Be Disabled
|
||||
Sleep 1
|
||||
Self Reg Should Be Disabled
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot DisableSelfReg.png
|
||||
Sleep 1
|
||||
Capture Page Screenshot DisableSelfReg.png
|
||||
Sleep 1
|
||||
|
||||
Enable Self Reg
|
||||
Mouse Down xpath=${self_reg_xpath}
|
||||
Mouse Down xpath=${self_reg_xpath}
|
||||
Mouse Up xpath=${self_reg_xpath}
|
||||
Sleep 1
|
||||
Self Reg Should Be Enabled
|
||||
Sleep 1
|
||||
Self Reg Should Be Enabled
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot EnableSelfReg.png
|
||||
Sleep 1
|
||||
|
||||
Capture Page Screenshot EnableSelfReg.png
|
||||
Sleep 1
|
||||
|
||||
Self Reg Should Be Disabled
|
||||
Checkbox Should Not Be Selected xpath=${self_reg_xpath}
|
||||
Checkbox Should Not Be Selected xpath=${self_reg_xpath}
|
||||
|
||||
Self Reg Should Be Enabled
|
||||
Checkbox Should Be Selected xpath=${self_reg_xpath}
|
||||
|
||||
Checkbox Should Be Selected xpath=${self_reg_xpath}
|
||||
|
||||
Project Creation Should Display
|
||||
Page Should Contain Element xpath=${project_create_xpath}
|
||||
|
||||
Project Creation Should Not Display
|
||||
Page Should Not Contain Element xpath=${project_create_xpath}
|
||||
|
||||
|
||||
## System settings
|
||||
Switch To System Settings
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//config//ul/li[4]
|
||||
|
||||
|
||||
Modify Token Expiration
|
||||
[Arguments] ${minutes}
|
||||
Input Text xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
[Arguments] ${minutes}
|
||||
Input Text xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
Click Button xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 1
|
||||
|
||||
Sleep 1
|
||||
|
||||
Token Must Be Match
|
||||
[Arguments] ${minutes}
|
||||
Textfield Value Should Be xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
[Arguments] ${minutes}
|
||||
Textfield Value Should Be xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
|
||||
## Replication
|
||||
Check Verify Remote Cert
|
||||
Mouse Down xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
Mouse Up xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot RemoteCert.png
|
||||
Sleep 1
|
||||
Capture Page Screenshot RemoteCert.png
|
||||
Sleep 1
|
||||
|
||||
Switch To System Replication
|
||||
Sleep 1
|
||||
Switch To Configure
|
||||
Click Element xpath=//*[@id="config-replication"]
|
||||
Sleep 1
|
||||
|
||||
Sleep 1
|
||||
|
||||
Should Verify Remote Cert Be Enabled
|
||||
Checkbox Should Not Be Selected xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
|
||||
Checkbox Should Not Be Selected xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
|
||||
## Email
|
||||
Switch To Email
|
||||
Switch To Configure
|
||||
Click Element xpath=//*[@id="config-email"]
|
||||
Sleep 1
|
||||
Switch To Configure
|
||||
Click Element xpath=//*[@id="config-email"]
|
||||
Sleep 1
|
||||
|
||||
Config Email
|
||||
Input Text xpath=//*[@id="mailServer"] smtp.vmware.com
|
||||
@ -143,13 +143,13 @@ Config Email
|
||||
Input Text xpath=//*[@id="emailUsername"] example@vmware.com
|
||||
Input Text xpath=//*[@id="emailPassword"] example
|
||||
Input Text xpath=//*[@id="emailFrom"] example<example@vmware.com>
|
||||
Sleep 1
|
||||
Mouse Down xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
Sleep 1
|
||||
Mouse Down xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
Mouse Up xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
Sleep 1
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 6
|
||||
|
||||
Sleep 6
|
||||
|
||||
Verify Email
|
||||
Textfield Value Should Be xpath=//*[@id="mailServer"] smtp.vmware.com
|
||||
Textfield Value Should Be xpath=//*[@id="emailPort"] 25
|
||||
@ -168,5 +168,4 @@ Set Scan All To Daily
|
||||
sleep 1
|
||||
click element //config//div/button[contains(.,'SAVE')]
|
||||
Click Scan Now
|
||||
click element //vulnerability-config//button[contains(.,'SCAN')]
|
||||
|
||||
click element //vulnerability-config//button[contains(.,'SCAN')]
|
@ -22,32 +22,32 @@ ${HARBOR_VERSION} v1.1.1
|
||||
*** Keywords ***
|
||||
Sign In Harbor
|
||||
[Arguments] ${url} ${user} ${pw}
|
||||
Go To ${url}
|
||||
Go To ${url}
|
||||
Sleep 5
|
||||
${title}= Get Title
|
||||
Log To Console ${title}
|
||||
Should Be Equal ${title} Harbor
|
||||
Sleep 2
|
||||
Sleep 2
|
||||
Input Text login_username ${user}
|
||||
Input Text login_password ${pw}
|
||||
Sleep 2
|
||||
Click button css=.btn
|
||||
sleep 5
|
||||
Log To Console ${user}
|
||||
Log To Console ${user}
|
||||
Wait Until Page Contains ${user}
|
||||
|
||||
Sign Up Should Not Display
|
||||
Page Should Not Contain Element xpath=${sign_up_button_xpath}
|
||||
Page Should Not Contain Element xpath=${sign_up_button_xpath}
|
||||
|
||||
Create An New User
|
||||
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment}
|
||||
Go To ${url}
|
||||
Go To ${url}
|
||||
sleep 5
|
||||
${title}= Get Title
|
||||
Log To Console ${title}
|
||||
Should Be Equal ${title} Harbor
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Sleep 5
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Sleep 5
|
||||
Click Element xpath=${sign_up_for_an_account_xpath}
|
||||
sleep 3
|
||||
Input Text xpath=${username_xpath} ${username}
|
||||
@ -70,4 +70,4 @@ Create An New User
|
||||
Click button css=.btn
|
||||
sleep 5
|
||||
Wait Until Page Contains ${username}
|
||||
Sleep 3
|
||||
Sleep 3
|
||||
|
@ -21,69 +21,167 @@ ${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Go Into Project
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=//*[@id="search_input"]
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="search_input"] ${project}
|
||||
Sleep 8
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo_${project}.png
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=//*[@id="search_input"]
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="search_input"] ${project}
|
||||
Sleep 8
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo_${project}.png
|
||||
|
||||
Go Into Project2
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo1_${project}.png
|
||||
# search icon
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
|
||||
Sleep 2
|
||||
# text search project
|
||||
Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
|
||||
Sleep 5
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
|
||||
Sleep 3
|
||||
Capture Page Screenshot gointo2_${project}.png
|
||||
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo1_${project}.png
|
||||
# search icon
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
|
||||
Sleep 2
|
||||
# text search project
|
||||
Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
|
||||
Sleep 5
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
|
||||
Sleep 3
|
||||
Capture Page Screenshot gointo2_${project}.png
|
||||
|
||||
Add User To Project Admin
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project2
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project2
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_add_button_xpath}
|
||||
Sleep 2
|
||||
Input Text xpath=${project_member_add_username_xpath} ${user}
|
||||
Sleep 3
|
||||
Sleep 3
|
||||
Click Element xpath=${project_member_add_admin_xpath}
|
||||
Click Element xpath=${project_member_add_save_button_xpath}
|
||||
Sleep 4
|
||||
|
||||
Sleep 4
|
||||
|
||||
Search Project Member
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_button_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_text_xpath}
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${user}
|
||||
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_button_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_text_xpath}
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${user}
|
||||
|
||||
Change Project Member Role
|
||||
[Arguments] ${project} ${user} ${role}
|
||||
Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
|
||||
[Arguments] ${project} ${user} ${role}
|
||||
Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${user}")]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${user}')]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-action-overflow//button[contains(.,"${role}")]
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${role}
|
||||
|
||||
|
||||
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${role}
|
||||
|
||||
User Can Change Role
|
||||
[arguments] ${username}
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow
|
||||
|
||||
User Can Not Change Role
|
||||
[arguments] ${username}
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow[@hidden=""]
|
||||
|
||||
Non-admin View Member Account
|
||||
[arguments] ${times}
|
||||
Xpath Should Match X Times //project-detail//clr-dg-action-overflow[@hidden=""] ${times}
|
||||
|
||||
User Can Not Add Member
|
||||
Page Should Not Contain Element xpath=${project_member_search_button_xpath2}
|
||||
|
||||
Add Guest Member To Project
|
||||
[arguments] ${member}
|
||||
Click Element xpath=${project_member_search_button_xpath2}
|
||||
Sleep 1
|
||||
Input Text xpath=${project_member_add_username_xpath} ${member}
|
||||
#select guest
|
||||
Mouse Down xpath=${project_member_guest_radio_checkbox}
|
||||
Mouse Up xpath=${project_member_guest_radio_checkbox}
|
||||
Click Button xpath=${project_member_add_button_xpath2}
|
||||
Sleep 1
|
||||
|
||||
Delete Project Member
|
||||
[arguments] ${member}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${member}')]//clr-dg-action-overflow
|
||||
Click Element xpath=${project_member_delete_button_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_delete_confirmation_xpath}
|
||||
Sleep 1
|
||||
|
||||
User Should Be Owner Of Project
|
||||
[Arguments] ${user} ${pwd} ${project}
|
||||
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||
Go Into Project ${project}
|
||||
Switch To Member
|
||||
User Can Not Change Role ${user}
|
||||
Push image ${ip} ${user} ${pwd} ${project} hello-world
|
||||
Logout Harbor
|
||||
|
||||
User Should Not Be A Member Of Project
|
||||
[Arguments] ${user} ${pwd} ${project}
|
||||
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||
Project Should Not Display ${project}
|
||||
Logout Harbor
|
||||
Cannot Pull image ${ip} ${user} ${pwd} ${project} ${ip}/${project}/hello-world
|
||||
Cannot Push image ${ip} ${user} ${pwd} ${project} ${ip}/${project}/hello-world
|
||||
|
||||
Manage Project Member
|
||||
[Arguments] ${admin} ${pwd} ${project} ${user} ${op}
|
||||
Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
|
||||
Go Into Project ${project}
|
||||
Switch To Member
|
||||
Run Keyword If '${op}' == 'Add' Add Guest Member To Project ${user}
|
||||
... ELSE IF '${op}' == 'Remove' Delete Project Member ${user}
|
||||
... ELSE Change Project Member Role ${project} ${user} ${role}
|
||||
Logout Harbor
|
||||
|
||||
Change User Role In Project
|
||||
[Arguments] ${admin} ${pwd} ${project} ${user} ${role}
|
||||
Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
|
||||
Change Project Member Role ${project} ${user} ${role}
|
||||
Logout Harbor
|
||||
|
||||
User Should Be Guest
|
||||
[Arguments] ${user} ${pwd} ${project}
|
||||
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||
Project Should Display ${project}
|
||||
Go Into Project ${project}
|
||||
Switch To Member
|
||||
Non-admin View Member Account 2
|
||||
User Can Not Add Member
|
||||
Logout Harbor
|
||||
Pull image ${ip} ${user} ${pwd} ${project} hello-world
|
||||
Cannot Push image ${ip} ${user} ${pwd} ${project} hello-world
|
||||
|
||||
User Should Be Developer
|
||||
[Arguments] ${user} ${pwd} ${project}
|
||||
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||
Project Should Display ${project}
|
||||
Go Into Project ${project}
|
||||
Switch To Member
|
||||
Non-admin View Member Account 2
|
||||
User Can Not Add Member
|
||||
Logout Harbor
|
||||
Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world ${ip}/${project}/hello-world:v1
|
||||
|
||||
User Should Be Admin
|
||||
[Arguments] ${user} ${pwd} ${project} ${guest}
|
||||
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||
Project Should Display ${project}
|
||||
Go Into Project ${project}
|
||||
Switch To Member
|
||||
Add Guest Member To Project ${guest}
|
||||
User Can Change Role ${guest}
|
||||
Logout Harbor
|
||||
Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world ${ip}/${project}/hello-world:v2
|
@ -22,4 +22,9 @@ ${project_member_add_username_xpath} //*[@id="member_name"]
|
||||
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label
|
||||
${project_member_add_save_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
|
||||
${project_member_search_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/clr-icon/svg
|
||||
${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
|
||||
${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
|
||||
${project_member_search_button_xpath2} //project-detail//button//clr-icon
|
||||
${project_member_add_button_xpath2} //project-detail//add-member//button[2]
|
||||
${project_member_guest_radio_checkbox} //project-detail//form//input[@id='checkrads_guest']
|
||||
${project_member_delete_button_xpath} //project-detail//clr-dg-cell//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
${project_member_delete_confirmation_xpath} //confiramtion-dialog//button[2]
|
@ -21,73 +21,77 @@ ${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Create An New Project
|
||||
[Arguments] ${projectname} ${public}=false
|
||||
Sleep 1
|
||||
Click Button css=${create_project_button_css}
|
||||
Sleep 1
|
||||
Log To Console Project Name: ${projectname}
|
||||
Input Text xpath=${project_name_xpath} ${projectname}
|
||||
Sleep 3
|
||||
Run Keyword If '${public}' == 'true' Click Element xpath=${project_public_xpath}
|
||||
Click Element css=${project_save_css}
|
||||
Sleep 4
|
||||
Wait Until Page Contains ${projectname}
|
||||
Wait Until Page Contains Project Admin
|
||||
|
||||
[Arguments] ${projectname} ${public}=false
|
||||
Sleep 1
|
||||
Click Button css=${create_project_button_css}
|
||||
Sleep 1
|
||||
Log To Console Project Name: ${projectname}
|
||||
Input Text xpath=${project_name_xpath} ${projectname}
|
||||
Sleep 3
|
||||
Run Keyword If '${public}' == 'true' Click Element xpath=${project_public_xpath}
|
||||
Click Element css=${project_save_css}
|
||||
Sleep 4
|
||||
Wait Until Page Contains ${projectname}
|
||||
Wait Until Page Contains Project Admin
|
||||
|
||||
Create An New Project With New User
|
||||
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public}
|
||||
Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
|
||||
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public}
|
||||
Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
|
||||
Logout Harbor
|
||||
Sign In Harbor ${url} ${username} ${newPassword}
|
||||
Create An New Project ${projectname} ${public}
|
||||
Create An New Project ${projectname} ${public}
|
||||
Sleep 1
|
||||
|
||||
#It's the log of project.
|
||||
Go To Project Log
|
||||
Click Element xpath=//project-detail//ul/li[3]
|
||||
Sleep 2
|
||||
|
||||
Click Element xpath=//project-detail//ul/li[3]
|
||||
Sleep 2
|
||||
|
||||
Switch To Member
|
||||
Click Element xpath=//project-detail//li[2]
|
||||
Sleep 1
|
||||
|
||||
Switch To Log
|
||||
Click Element xpath=${log_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${log_xpath}
|
||||
Sleep 1
|
||||
|
||||
Switch To Replication
|
||||
Click Element xpath=${replication_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${replication_xpath}
|
||||
Sleep 1
|
||||
|
||||
Back To projects
|
||||
Click Element xpath=${projects_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${projects_xpath}
|
||||
Sleep 1
|
||||
|
||||
Project Should Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
[Arguments] ${projectname}
|
||||
Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
|
||||
Project Should Not Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
[Arguments] ${projectname}
|
||||
Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
|
||||
Search Private Projects
|
||||
Click element xpath=//select
|
||||
Click element xpath=//select/option[@value=1]
|
||||
Sleep 1
|
||||
Capture Page Screenshot SearchPrivateProjects.png
|
||||
Click element xpath=//select
|
||||
Click element xpath=//select/option[@value=1]
|
||||
Sleep 1
|
||||
Capture Page Screenshot SearchPrivateProjects.png
|
||||
|
||||
Make Project Private
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
|
||||
|
||||
Make Project Public
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
|
||||
|
||||
Delete Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
|
||||
[Arguments] ${projectname}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
Sleep 1
|
||||
@ -95,18 +99,18 @@ Delete Repo
|
||||
Sleep 2
|
||||
|
||||
Advanced Search Should Display
|
||||
Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
|
||||
# it's not a common keywords, only used into log case.
|
||||
Do Log Advanced Search
|
||||
Capture Page Screenshot LogAdvancedSearch.png
|
||||
Sleep 1
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"pull")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"push")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"create")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"delete")]
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
Capture Page Screenshot LogAdvancedSearch.png
|
||||
Sleep 1
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"pull")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"push")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"create")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"delete")]
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//audit-log//clr-dropdown/button
|
||||
Sleep 1
|
||||
@ -147,13 +151,13 @@ Expand Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element //repository//clr-dg-row-master[contains(.,'${projectname}')]//button/clr-icon
|
||||
sleep 1
|
||||
|
||||
|
||||
Scan Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow//button[contains(.,'Scan')]
|
||||
Sleep 15
|
||||
|
||||
|
||||
Summary Chart Should Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Contain Element //clr-dg-row-master[contains(.,'${projectname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
@ -21,23 +21,23 @@ ${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Create An New Rule With New Endpoint
|
||||
[Arguments] ${policy_name} ${policy_description} ${destination_name} ${destination_url} ${destination_username} ${destination_password}
|
||||
[Arguments] ${policy_name} ${policy_description} ${destination_name} ${destination_url} ${destination_username} ${destination_password}
|
||||
Click element xpath=${new_name_xpath}
|
||||
Sleep 2
|
||||
|
||||
Input Text xpath=${policy_name_xpath} ${policy_name}
|
||||
Input Text xpath=${policy_name_xpath} ${policy_name}
|
||||
Input Text xpath=${policy_description_xpath} ${policy_description}
|
||||
|
||||
|
||||
Click element xpath=${policy_enable_checkbox}
|
||||
Click element xpath=${policy_endpoint_checkbox}
|
||||
|
||||
|
||||
Input text xpath=${destination_name_xpath} ${destination_name}
|
||||
Input text xpath=${destination_url_xpath} ${destination_url}
|
||||
Input text xpath=${destination_username_xpath} ${destination_username}
|
||||
Input text xpath=${destination_password_xpath} ${destination_password}
|
||||
Click element xpath=${replicaton_save_xpath}
|
||||
Sleep 5
|
||||
Capture Page Screenshot rule_${policy_name}.png
|
||||
Wait Until Page Contains ${policy_name}
|
||||
Wait Until Page Contains ${policy_description}
|
||||
Wait Until Page Contains ${destination_name}
|
||||
Capture Page Screenshot rule_${policy_name}.png
|
||||
Wait Until Page Contains ${policy_name}
|
||||
Wait Until Page Contains ${policy_description}
|
||||
Wait Until Page Contains ${destination_name}
|
@ -45,12 +45,12 @@ Update User Comment
|
||||
Sleep 2
|
||||
|
||||
Logout Harbor
|
||||
Wait Until Element Is Visible xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Wait Until Element Is Enabled xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Wait Until Element Is Visible xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Wait Until Element Is Enabled xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Sleep 2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header//clr-dropdown//a[4]
|
||||
Sleep 1
|
||||
Capture Page Screenshot Logout.png
|
||||
Sleep 2
|
||||
Sleep 1
|
||||
Capture Page Screenshot Logout.png
|
||||
Sleep 2
|
||||
Wait Until Keyword Succeeds 5x 1 Page Should Contain Element xpath=//sign-in//form//*[@class="title"]
|
||||
|
@ -24,7 +24,7 @@ ${HARBOR_URL} http://localhost
|
||||
*** Test Cases ***
|
||||
Test Case - Create An New User
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Close Browser
|
||||
|
||||
@ -64,7 +64,7 @@ Test Case - User View Projects
|
||||
Create An New Project test${d}2
|
||||
Create An New Project test${d}3
|
||||
Switch To Log
|
||||
Capture Page Screenshot UserViewProjects.png
|
||||
Capture Page Screenshot UserViewProjects.png
|
||||
Wait Until Page Contains test${d}1
|
||||
Wait Until Page Contains test${d}2
|
||||
Wait Until Page Contains test${d}3
|
||||
@ -76,7 +76,7 @@ Test Case - Push Image
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}
|
||||
|
||||
Push image ${ip} tester${d} Test1@34 test${d} hello-world:latest
|
||||
Push image ${ip} tester${d} Test1@34 test${d} hello-world:latest
|
||||
Go Into Project test${d}
|
||||
Wait Until Page Contains test${d}/hello-world
|
||||
|
||||
@ -84,18 +84,18 @@ Test Case - User View Logs
|
||||
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
|
||||
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
|
||||
|
||||
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
|
||||
Go To Project Log
|
||||
Advanced Search Should Display
|
||||
Go To Project Log
|
||||
Advanced Search Should Display
|
||||
|
||||
Do Log Advanced Search
|
||||
Do Log Advanced Search
|
||||
Close Browser
|
||||
|
||||
Test Case - Manage project publicity
|
||||
@ -135,25 +135,25 @@ Test Case - Manage project publicity
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Display project${d}
|
||||
Close Browser
|
||||
Close Browser
|
||||
|
||||
Test Case - Edit Project Creation
|
||||
# create normal user and login
|
||||
# create normal user and login
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
|
||||
Project Creation Should Display
|
||||
Project Creation Should Display
|
||||
Logout Harbor
|
||||
|
||||
Sleep 3
|
||||
Sleep 3
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Set Pro Create Admin Only
|
||||
Set Pro Create Admin Only
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
|
||||
Project Creation Should Not Display
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
|
||||
Project Creation Should Not Display
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Set Pro Create Every One
|
||||
@ -163,16 +163,16 @@ Test Case - Edit Self-Registration
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Disable Self Reg
|
||||
Logout Harbor
|
||||
Logout Harbor
|
||||
|
||||
Sign Up Should Not Display
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To Configure
|
||||
Switch To Configure
|
||||
Self Reg Should Be Disabled
|
||||
Sleep 1
|
||||
|
||||
#restore setting
|
||||
#restore setting
|
||||
Enable Self Reg
|
||||
Close Browser
|
||||
|
||||
@ -197,13 +197,13 @@ Test Case - Edit Email Settings
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Switch To Email
|
||||
Config Email
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Switch To Email
|
||||
Verify Email
|
||||
|
||||
Close Browser
|
||||
@ -211,15 +211,15 @@ Test Case - Edit Email Settings
|
||||
Test Case - Edit Token Expire
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Modify Token Expiration 20
|
||||
Switch To System Settings
|
||||
Modify Token Expiration 20
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Token Must Be Match 20
|
||||
|
||||
#reset to default
|
||||
#reset to default
|
||||
Modify Token Expiration 30
|
||||
Close Browser
|
||||
|
||||
@ -228,10 +228,10 @@ Test Case - Create An Replication Rule New Endpoint
|
||||
${d}= Get current date result_format=%m%s
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Create An New Project project${d}
|
||||
Go Into Project project${d}
|
||||
Go Into Project project${d}
|
||||
Switch To Replication
|
||||
Create An New Rule With New Endpoint policy_name=test_policy_${d} policy_description=test_description destination_name=test_destination_name_${d} destination_url=test_destination_url_${d} destination_username=test_destination_username destination_password=test_destination_password
|
||||
Close Browser
|
||||
Close Browser
|
||||
|
||||
Test Case - Scan A Tag
|
||||
Init Chrome Driver
|
||||
@ -242,7 +242,33 @@ Test Case - Scan A Tag
|
||||
Expand Repo project${d}
|
||||
Scan Repo project${d}
|
||||
Summary Chart Should Display project${d}
|
||||
Close Browser
|
||||
Close Browser
|
||||
|
||||
Test Case-Manage Project Member
|
||||
Init Chrome Driver
|
||||
${d}= Get current Date result_format=%m%s
|
||||
|
||||
Create An New Project With New User url=${HARBOR_URL} username=alice${d} email=alice${d}@vmware.com realname=alice${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=false
|
||||
Push image ip=${ip} user=alice${d} pwd=Test1@34 project=project${d} image=hello-world
|
||||
Logout Harbor
|
||||
Create An New User url=${HARBOR_URL} username=bob${d} email=bob${d}@vmware.com realname=bob${d} newPassword=Test1@34 comment=habor
|
||||
Logout Harbor
|
||||
Create An New User url=${HARBOR_URL} username=carol${d} email=carol${d}@vmware.com realname=carol${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
|
||||
User Should Be Owner Of Project alice${d} Test1@34 project${d}
|
||||
User Should Not Be A Member Of Project bob${d} Test1@34 project${d}
|
||||
Manage Project Member alice${d} Test1@34 project${d} bob${d} Add
|
||||
User Should Be Guest bob${d} Test1@34 project${d}
|
||||
Change User Role In Project alice${d} Test1@34 project${d} bob${d} Developer
|
||||
User Should Be Developer bob${d} Test1@34 project${d}
|
||||
Change User Role In Project alice${d} Test1@34 project${d} bob${d} Admin
|
||||
User Should Be Admin bob${d} Test1@34 project${d} carol${d}
|
||||
Manage Project Member alice${d} Test1@34 project${d} bob${d} Remove
|
||||
User Should Not Be A Member Of Project bob${d} Test1@34 project${d}
|
||||
User Should Be Guest carol${d} Test1@34 project${d}
|
||||
|
||||
Close Browser
|
||||
|
||||
Test Case - Assign Sys Admin
|
||||
Init Chrome Driver
|
||||
@ -273,7 +299,7 @@ Test Case - Admin Push Signed Image
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
|
||||
Log To Console ${output}
|
||||
|
||||
Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
|
||||
Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
|
||||
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-push-image.sh
|
||||
Log To Console ${output}
|
||||
@ -289,4 +315,4 @@ Test Case - Admin Push Un-Signed Image
|
||||
Log To Console ${output}
|
||||
|
||||
Test Case - Clean Harbor Images
|
||||
Down Harbor with_notary=true
|
||||
Down Harbor with_notary=true
|
||||
|
Loading…
Reference in New Issue
Block a user