Add retry for keyword go into index

1. Add retry for keyword go into index;
2. Add retry for keyword go into project.
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2020-05-22 02:56:03 +00:00
parent 2ff0638f8b
commit 5d8a308158
12 changed files with 1793 additions and 1789 deletions

View File

@ -5,7 +5,7 @@ Make Swagger Client
[Return] ${rc} [Return] ${rc}
Setup API Test Setup API Test
Retry Keyword When Error Make Swagger Client Retry Keyword N Times When Error 10 Make Swagger Client
Harbor API Test Harbor API Test
[Arguments] ${testcase_name} [Arguments] ${testcase_name}

View File

@ -149,7 +149,7 @@ Docker Login
Docker Pull Docker Pull
[Arguments] ${image} [Arguments] ${image}
${output}= Retry Keyword When Error Wait Unitl Command Success docker pull ${image} ${output}= Retry Keyword N Times When Error 10 Wait Unitl Command Success docker pull ${image}
Log ${output} Log ${output}
Log To Console Docker Pull: \n ${output} Log To Console Docker Pull: \n ${output}
[Return] ${output} [Return] ${output}

View File

@ -36,7 +36,7 @@ GC Now
Retry GC Should Be Successful Retry GC Should Be Successful
[Arguments] ${history_id} ${expected_msg} [Arguments] ${history_id} ${expected_msg}
Retry Keyword When Error GC Should Be Successful ${history_id} ${expected_msg} Retry Keyword N Times When Error 15 GC Should Be Successful ${history_id} ${expected_msg}
GC Should Be Successful GC Should Be Successful
[Arguments] ${history_id} ${expected_msg} [Arguments] ${history_id} ${expected_msg}

View File

@ -1,210 +1,215 @@
# Copyright Project Harbor Authors # Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance Documentation This resource provides any keywords related to the Harbor private registry appliance
Resource ../../resources/Util.robot Resource ../../resources/Util.robot
*** Variables *** *** Variables ***
*** Keywords *** *** Keywords ***
Go Into Project Go Into Project
[Arguments] ${project} ${has_image}=${true} [Arguments] ${project} ${has_image}=${true}
Sleep 2 Retry Keyword N Times When Error 5 Clear Search Input And Go Into Project ${project} ${has_image}
Retry Element Click xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[1]/a/span
Sleep 2 Clear Search Input And Go Into Project
Retry Text Input ${search_input} ${project} [Arguments] ${project} ${has_image}
:For ${n} IN RANGE 1 5 # Close prompt in header
\ Sleep 2 Sleep 2
\ ${out} Run Keyword If ${has_image}==${false} Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")] DoAssert=${false} #go To ${url}
\ ... ELSE Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//project-detail//hbr-repository-gridview//clr-dg-cell[contains(.,'${project}/')] DoAssert=${false} Reload Page
\ Log To Console ${out} Sleep 2
\ Run Keyword If ${out} == 'PASS' Exit For Loop # Clear Search Input
\ Sleep 1 Retry Element Click xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[1]/a/span
Should Be Equal ${out} 'PASS' Sleep 2
Sleep 1 Retry Text Input ${search_input} ${project}
Sleep 2
Add User To Project Admin # Go Into Project
[Arguments] ${project} ${user} ${out} Run Keyword If ${has_image}==${false} Run Keywords Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a AND Wait Until Element Is Visible And Enabled xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")]
# *** this keyword has not been used *** ... ELSE Run Keywords Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a AND Wait Until Element Is Visible And Enabled xpath=//project-detail//hbr-repository-gridview//clr-dg-cell[contains(.,'${project}/')]
Go Into Project Sleep 1
Retry Element Click xpath=${project_member_tag_xpath}
Retry Element Click xpath=${project_member_add_button_xpath} Add User To Project Admin
Retry Text Input xpath=${project_member_add_username_xpath} ${user} [Arguments] ${project} ${user}
Retry Element Click xpath=${project_member_add_admin_xpath} # *** this keyword has not been used ***
Retry Element Click xpath=${project_member_add_save_button_xpath} Go Into Project
Sleep 4 Retry Element Click xpath=${project_member_tag_xpath}
Retry Element Click xpath=${project_member_add_button_xpath}
Search Project Member Retry Text Input xpath=${project_member_add_username_xpath} ${user}
[Arguments] ${project} ${user} Retry Element Click xpath=${project_member_add_admin_xpath}
# *** this keyword has not been used *** Retry Element Click xpath=${project_member_add_save_button_xpath}
Go Into Project ${project} Sleep 4
Retry Element Click xpath=//clr-dg-cell//a[contains(.,'${project}')]
Retry Element Click xpath=${project_member_search_button_xpath} Search Project Member
Retry Element Click xpath=${project_member_search_text_xpath} [Arguments] ${project} ${user}
Retry Wait Until Page Contains ${user} # *** this keyword has not been used ***
Go Into Project ${project}
Change Project Member Role Retry Element Click xpath=//clr-dg-cell//a[contains(.,'${project}')]
[Arguments] ${project} ${user} ${role} Retry Element Click xpath=${project_member_search_button_xpath}
Retry Element Click xpath=//clr-dg-cell//a[contains(.,'${project}')] Retry Element Click xpath=${project_member_search_text_xpath}
Retry Element Click xpath=${project_member_tag_xpath} Retry Wait Until Page Contains ${user}
Retry Element Click xpath=//project-detail//clr-dg-row[contains(.,'${user}')]//clr-checkbox-wrapper
#change role Change Project Member Role
Retry Element Click ${project_member_action_xpath} [Arguments] ${project} ${user} ${role}
Retry Element Click //button[contains(.,'${role}')] Retry Element Click xpath=//clr-dg-cell//a[contains(.,'${project}')]
Retry Wait Until Page Not Contains Element ${project_member_set_role_xpath} Retry Element Click xpath=${project_member_tag_xpath}
#Precondition is that only 1 member is in the list. Retry Element Click xpath=//project-detail//clr-dg-row[contains(.,'${user}')]//clr-checkbox-wrapper
Retry Wait Until Page Contains ${role} #change role
Retry Element Click ${project_member_action_xpath}
User Can Change Role Retry Element Click //button[contains(.,'${role}')]
[arguments] ${username} Retry Wait Until Page Not Contains Element ${project_member_set_role_xpath}
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label #Precondition is that only 1 member is in the list.
Retry Element Click xpath=//*[@id='member-action'] Retry Wait Until Page Contains ${role}
Retry Wait Until Page Not Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
User Can Change Role
User Can Not Change Role [arguments] ${username}
[arguments] ${username} Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label Retry Element Click xpath=//*[@id='member-action']
Retry Element Click xpath=//*[@id='member-action'] Retry Wait Until Page Not Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
User Can Not Change Role
#this keyworkd seems will not use any more, will delete in the future [arguments] ${username}
Non-admin View Member Account Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
[arguments] ${times} Retry Element Click xpath=//*[@id='member-action']
Xpath Should Match X Times //clr-dg-row-master ${times} Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
User Can Not Add Member #this keyworkd seems will not use any more, will delete in the future
Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'User')] Non-admin View Member Account
[arguments] ${times}
Add Guest Member To Project Xpath Should Match X Times //clr-dg-row-master ${times}
[arguments] ${member}
Retry Double Keywords When Error Retry Element Click xpath=${project_member_add_button_xpath} Retry Wait Until Page Contains Element xpath=${project_member_add_button_xpath} User Can Not Add Member
Retry Text Input xpath=${project_member_add_username_xpath} ${member} Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'User')]
#select guest
Mouse Down xpath=${project_member_guest_radio_checkbox} Add Guest Member To Project
Mouse Up xpath=${project_member_guest_radio_checkbox} [arguments] ${member}
Retry Double Keywords When Error Retry Element Click xpath=${project_member_add_confirmation_ok_xpath} Retry Wait Until Page Not Contains Element xpath=${project_member_add_confirmation_ok_xpath} Retry Double Keywords When Error Retry Element Click xpath=${project_member_add_button_xpath} Retry Wait Until Page Contains Element xpath=${project_member_add_button_xpath}
Retry Text Input xpath=${project_member_add_username_xpath} ${member}
Delete Project Member #select guest
[arguments] ${member} Mouse Down xpath=${project_member_guest_radio_checkbox}
Retry Element Click xpath=//clr-dg-row[contains(.,'${member}')]//input/../label Mouse Up xpath=${project_member_guest_radio_checkbox}
Retry Double Keywords When Error Retry Element Click ${member_action_xpath} Retry Wait Until Page Contains Element ${delete_action_xpath} Retry Double Keywords When Error Retry Element Click xpath=${project_member_add_confirmation_ok_xpath} Retry Wait Until Page Not Contains Element xpath=${project_member_add_confirmation_ok_xpath}
Retry Double Keywords When Error Retry Element Click ${delete_action_xpath} Retry Wait Until Page Contains Element ${repo_delete_on_card_view_btn}
Retry Double Keywords When Error Retry Element Click ${repo_delete_on_card_view_btn} Retry Wait Element xpath=${project_member_xpath} Delete Project Member
Sleep 1 [arguments] ${member}
Retry Element Click xpath=//clr-dg-row[contains(.,'${member}')]//input/../label
User Should Be Owner Of Project Retry Double Keywords When Error Retry Element Click ${member_action_xpath} Retry Wait Until Page Contains Element ${delete_action_xpath}
[Arguments] ${user} ${pwd} ${project} Retry Double Keywords When Error Retry Element Click ${delete_action_xpath} Retry Wait Until Page Contains Element ${repo_delete_on_card_view_btn}
Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Retry Double Keywords When Error Retry Element Click ${repo_delete_on_card_view_btn} Retry Wait Element xpath=${project_member_xpath}
Go Into Project ${project} Sleep 1
Switch To Member
User Can Not Change Role ${user} User Should Be Owner Of Project
Push image ${ip} ${user} ${pwd} ${project} hello-world [Arguments] ${user} ${pwd} ${project}
Logout Harbor Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Go Into Project ${project}
User Should Not Be A Member Of Project Switch To Member
[Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false} User Can Not Change Role ${user}
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Push image ${ip} ${user} ${pwd} ${project} hello-world
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user} Logout Harbor
${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd} User Should Not Be A Member Of Project
Project Should Not Display ${project} [Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false}
Logout Harbor Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Cannot Pull image ${ip} ${user} ${password} ${project} ${ip}/${project}/hello-world ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user}
Cannot Push image ${ip} ${user} ${password} ${project} hello-world ${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd}
Manage Project Member Project Should Not Display ${project}
[Arguments] ${admin} ${pwd} ${project} ${user} ${op} ${has_image}=${true} ${is_oidc_mode}=${false} Logout Harbor
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${admin} ${pwd} Cannot Pull image ${ip} ${user} ${password} ${project} ${ip}/${project}/hello-world
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${admin} Cannot Push image ${ip} ${user} ${password} ${project} hello-world
Go Into Project ${project} ${has_image}
Switch To Member Manage Project Member
Run Keyword If '${op}' == 'Add' Add Guest Member To Project ${user} [Arguments] ${admin} ${pwd} ${project} ${user} ${op} ${has_image}=${true} ${is_oidc_mode}=${false}
... ELSE IF '${op}' == 'Remove' Delete Project Member ${user} Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
... ELSE Change Project Member Role ${project} ${user} ${role} ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${admin}
Logout Harbor Go Into Project ${project} ${has_image}
Switch To Member
Change User Role In Project Run Keyword If '${op}' == 'Add' Add Guest Member To Project ${user}
[Arguments] ${admin} ${pwd} ${project} ${user} ${role} ${is_oidc_mode}=${false} ... ELSE IF '${op}' == 'Remove' Delete Project Member ${user}
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${admin} ${pwd} ... ELSE Change Project Member Role ${project} ${user} ${role}
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${admin} Logout Harbor
Retry Wait Element Visible //clr-dg-cell//a[contains(.,'${project}')]
Change Project Member Role ${project} ${user} ${role} Change User Role In Project
Logout Harbor [Arguments] ${admin} ${pwd} ${project} ${user} ${role} ${is_oidc_mode}=${false}
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
User Should Be Guest ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${admin}
[Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false} Retry Wait Element Visible //clr-dg-cell//a[contains(.,'${project}')]
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Change Project Member Role ${project} ${user} ${role}
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user} Logout Harbor
${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd} User Should Be Guest
Project Should Display ${project} [Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false}
Go Into Project ${project} Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Switch To Member ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user}
User Can Not Add Member ${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Guest')] ${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd}
Logout Harbor Project Should Display ${project}
Pull image ${ip} ${user} ${password} ${project} hello-world Go Into Project ${project}
Cannot Push image ${ip} ${user} ${password} ${project} hello-world Switch To Member
User Can Not Add Member
User Should Be Developer Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Guest')]
[Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false} Logout Harbor
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Pull image ${ip} ${user} ${password} ${project} hello-world
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user} Cannot Push image ${ip} ${user} ${password} ${project} hello-world
${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd} User Should Be Developer
Project Should Display ${project} [Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false}
Go Into Project ${project} Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Switch To Member ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user}
User Can Not Add Member ${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Developer')] ${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd}
Logout Harbor Project Should Display ${project}
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v1 Go Into Project ${project}
Switch To Member
User Should Be Admin User Can Not Add Member
[Arguments] ${user} ${pwd} ${project} ${guest} ${is_oidc_mode}=${false} Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Developer')]
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Logout Harbor
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user} Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v1
${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd} User Should Be Admin
Project Should Display ${project} [Arguments] ${user} ${pwd} ${project} ${guest} ${is_oidc_mode}=${false}
Go Into Project ${project} Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Switch To Member ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user}
Add Guest Member To Project ${guest} ${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
User Can Change Role ${guest} ${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd}
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Admin')] Project Should Display ${project}
Logout Harbor Go Into Project ${project}
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v2 Switch To Member
Add Guest Member To Project ${guest}
User Should Be Master User Can Change Role ${guest}
[Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false} Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Admin')]
Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Logout Harbor
... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user} Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v2
${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd} User Should Be Master
Project Should Display ${project} [Arguments] ${user} ${pwd} ${project} ${is_oidc_mode}=${false}
Go Into Project ${project} Run Keyword If ${is_oidc_mode} == ${false} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Delete Repo ${project} ... ELSE Sign In Harbor With OIDC User ${HARBOR_URL} username=${user}
Switch To Member ${pwd_oidc}= Run Keyword And Return If ${is_oidc_mode} == ${true} Get Secrete By API ${HARBOR_URL}
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Master')] ${password}= Set Variable If ${is_oidc_mode} == ${true} ${pwd_oidc} ${pwd}
Logout Harbor Project Should Display ${project}
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v3 Go Into Project ${project}
Delete Repo ${project}
Project Should Have Member Switch To Member
[Arguments] ${project} ${user} Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Master')]
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} Logout Harbor
Go Into Project ${project} Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v3
Switch To Member
Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '${user}')] Project Should Have Member
Logout Harbor [Arguments] ${project} ${user}
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Go Into Project ${project}
Switch To Member
Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '${user}')]
Logout Harbor

View File

@ -1,323 +1,334 @@
# Copyright Project Harbor Authors # Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance Documentation This resource provides any keywords related to the Harbor private registry appliance
Resource ../../resources/Util.robot Resource ../../resources/Util.robot
*** Variables *** *** Variables ***
*** Keywords *** *** Keywords ***
Create An New Project And Go Into Project Create An New Project And Go Into Project
[Arguments] ${projectname} ${public}=false ${count_quota}=${null} ${storage_quota}=${null} ${storage_quota_unit}=${null} [Arguments] ${projectname} ${public}=false ${count_quota}=${null} ${storage_quota}=${null} ${storage_quota_unit}=${null}
Navigate To Projects Navigate To Projects
Retry Button Click xpath=${create_project_button_xpath} Retry Button Click xpath=${create_project_button_xpath}
Log To Console Project Name: ${projectname} Log To Console Project Name: ${projectname}
Capture Page Screenshot Capture Page Screenshot
Retry Text Input xpath=${project_name_xpath} ${projectname} Retry Text Input xpath=${project_name_xpath} ${projectname}
${element_project_public}= Set Variable xpath=${project_public_xpath} ${element_project_public}= Set Variable xpath=${project_public_xpath}
Run Keyword If '${public}' == 'true' Run Keywords Wait Until Element Is Visible And Enabled ${element_project_public} AND Retry Element Click ${element_project_public} Run Keyword If '${public}' == 'true' Run Keywords Wait Until Element Is Visible And Enabled ${element_project_public} AND Retry Element Click ${element_project_public}
Run Keyword If '${count_quota}'!='${null}' Input Count Quota ${count_quota} Run Keyword If '${count_quota}'!='${null}' Input Count Quota ${count_quota}
Run Keyword If '${storage_quota}'!='${null}' Input Storage Quota ${storage_quota} ${storage_quota_unit} Run Keyword If '${storage_quota}'!='${null}' Input Storage Quota ${storage_quota} ${storage_quota_unit}
Capture Page Screenshot Capture Page Screenshot
Retry Double Keywords When Error Retry Element Click ${create_project_OK_button_xpath} Retry Wait Until Page Not Contains Element ${create_project_OK_button_xpath} Retry Double Keywords When Error Retry Element Click ${create_project_OK_button_xpath} Retry Wait Until Page Not Contains Element ${create_project_OK_button_xpath}
Capture Page Screenshot Capture Page Screenshot
Go Into Project ${projectname} has_image=${false} Go Into Project ${projectname} has_image=${false}
Create An New Project With New User Create An New Project With New User
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public} [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} Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
Logout Harbor Logout Harbor
Sign In Harbor ${url} ${username} ${newPassword} Sign In Harbor ${url} ${username} ${newPassword}
Create An New Project And Go Into Project ${projectname} ${public} Create An New Project And Go Into Project ${projectname} ${public}
Sleep 1 Sleep 1
#It's the log of project. #It's the log of project.
Go To Project Log Go To Project Log
#Switch To Project Tab Overflow #Switch To Project Tab Overflow
Retry Element Click xpath=${project_log_xpath} Retry Element Click xpath=${project_log_xpath}
Sleep 2 Sleep 2
Switch To Member Switch To Member
Sleep 3 Sleep 3
Retry Element Click xpath=${project_member_xpath} Retry Element Click xpath=${project_member_xpath}
Sleep 1 Sleep 1
Switch To Log Switch To Log
Retry Element Click xpath=${log_xpath} Retry Element Click xpath=${log_xpath}
Sleep 1 Sleep 1
Switch To Replication Switch To Replication
Retry Element Click xpath=${project_replication_xpath} Retry Element Click xpath=${project_replication_xpath}
Sleep 1 Sleep 1
Switch To Project Configuration Switch To Project Configuration
Retry Element Click ${project_config_tabsheet} Retry Element Click ${project_config_tabsheet}
Sleep 1 Sleep 1
Switch To Tag Retention Switch To Tag Retention
#Switch To Project Tab Overflow #Switch To Project Tab Overflow
Retry Element Click xpath=${project_tag_strategy_xpath} Retry Element Click xpath=${project_tag_strategy_xpath}
Sleep 1 Sleep 1
Switch To Tag Immutability Switch To Tag Immutability
#Switch To Project Tab Overflow #Switch To Project Tab Overflow
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_strategy_xpath} Retry Wait Until Page Contains Element ${project_tag_immutability_switch} Retry Double Keywords When Error Retry Element Click xpath=${project_tag_strategy_xpath} Retry Wait Until Page Contains Element ${project_tag_immutability_switch}
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_immutability_switch} Retry Wait Until Page Contains Immutability rules Retry Double Keywords When Error Retry Element Click xpath=${project_tag_immutability_switch} Retry Wait Until Page Contains Immutability rules
Sleep 1 Sleep 1
Switch To Project Tab Overflow Switch To Project Tab Overflow
Retry Element Click xpath=${project_tab_overflow_btn} Retry Element Click xpath=${project_tab_overflow_btn}
Sleep 1 Sleep 1
Navigate To Projects Navigate To Projects
Retry Element Click xpath=${projects_xpath} Retry Element Click xpath=${projects_xpath}
Sleep 2 Sleep 2
Project Should Display Project Should Display
[Arguments] ${projectname} [Arguments] ${projectname}
Retry Wait Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')] Retry Wait Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
Project Should Not Display Project Should Not Display
[Arguments] ${projectname} [Arguments] ${projectname}
Retry Wait Until Page Not Contains Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')] Retry Wait Until Page Not Contains Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
Search Private Projects Search Private Projects
Retry Element Click xpath=//select Retry Element Click xpath=//select
Retry Element Click xpath=//select/option[@value=1] Retry Element Click xpath=//select/option[@value=1]
Sleep 1 Sleep 1
Capture Page Screenshot SearchPrivateProjects.png Capture Page Screenshot SearchPrivateProjects.png
Make Project Private Make Project Private
[Arguments] ${projectname} [Arguments] ${projectname}
Go Into Project ${project name} Go Into Project ${project name}
Switch To Project Configuration Switch To Project Configuration
Retry Checkbox Should Be Selected ${project_config_public_checkbox} Retry Checkbox Should Be Selected ${project_config_public_checkbox}
Retry Double Keywords When Error Retry Element Click ${project_config_public_checkbox_label} Retry Checkbox Should Not Be Selected ${project_config_public_checkbox} Retry Double Keywords When Error Retry Element Click ${project_config_public_checkbox_label} Retry Checkbox Should Not Be Selected ${project_config_public_checkbox}
Retry Element Click //button[contains(.,'SAVE')] Retry Element Click //button[contains(.,'SAVE')]
Go Into Project ${project name} Go Into Project ${project name}
Switch To Project Configuration Switch To Project Configuration
Retry Checkbox Should Not Be Selected ${project_config_public_checkbox} Retry Checkbox Should Not Be Selected ${project_config_public_checkbox}
Make Project Public Make Project Public
[Arguments] ${projectname} [Arguments] ${projectname}
Go Into Project ${project name} Go Into Project ${project name}
Switch To Project Configuration Switch To Project Configuration
Retry Checkbox Should Not Be Selected ${project_config_public_checkbox} Retry Checkbox Should Not Be Selected ${project_config_public_checkbox}
Retry Double Keywords When Error Retry Element Click ${project_config_public_checkbox_label} Retry Checkbox Should Be Selected ${project_config_public_checkbox} Retry Double Keywords When Error Retry Element Click ${project_config_public_checkbox_label} Retry Checkbox Should Be Selected ${project_config_public_checkbox}
Retry Element Click //button[contains(.,'SAVE')] Retry Element Click //button[contains(.,'SAVE')]
Go Into Project ${project name} Go Into Project ${project name}
Switch To Project Configuration Switch To Project Configuration
Retry Checkbox Should Be Selected ${project_config_public_checkbox} Retry Checkbox Should Be Selected ${project_config_public_checkbox}
Delete Repo Delete Repo
[Arguments] ${projectname} [Arguments] ${projectname}
${element_repo_checkbox}= Set Variable xpath=//clr-dg-row[contains(.,'${projectname}')]//clr-checkbox-wrapper//label ${element_repo_checkbox}= Set Variable xpath=//clr-dg-row[contains(.,'${projectname}')]//clr-checkbox-wrapper//label
Retry Double Keywords When Error Retry Element Click ${element_repo_checkbox} Wait Until Element Is Visible And Enabled ${repo_delete_btn} Retry Double Keywords When Error Retry Element Click ${element_repo_checkbox} Wait Until Element Is Visible And Enabled ${repo_delete_btn}
Retry Double Keywords When Error Retry Element Click ${repo_delete_btn} Wait Until Element Is Visible And Enabled ${delete_confirm_btn} Retry Double Keywords When Error Retry Element Click ${repo_delete_btn} Wait Until Element Is Visible And Enabled ${delete_confirm_btn}
Retry Double Keywords When Error Retry Element Click ${delete_confirm_btn} Retry Wait Until Page Not Contains Element ${delete_confirm_btn} Retry Double Keywords When Error Retry Element Click ${delete_confirm_btn} Retry Wait Until Page Not Contains Element ${delete_confirm_btn}
Retry Wait Until Page Not Contains Element ${element_repo_checkbox} Retry Wait Until Page Not Contains Element ${element_repo_checkbox}
Delete Repo on CardView Delete Repo on CardView
[Arguments] ${reponame} [Arguments] ${reponame}
Retry Element Click //hbr-gridview//span[contains(.,'${reponame}')]//clr-dropdown/button Retry Element Click //hbr-gridview//span[contains(.,'${reponame}')]//clr-dropdown/button
Retry Element Click //hbr-gridview//span[contains(.,'${reponame}')]//clr-dropdown/clr-dropdown-menu/button[contains(.,'Delete')] Retry Element Click //hbr-gridview//span[contains(.,'${reponame}')]//clr-dropdown/clr-dropdown-menu/button[contains(.,'Delete')]
Retry Element Click ${repo_delete_on_card_view_btn} Retry Element Click ${repo_delete_on_card_view_btn}
Sleep 2 Sleep 2
Delete Project Delete Project
[Arguments] ${projectname} [Arguments] ${projectname}
Navigate To Projects Navigate To Projects
Retry Element Click xpath=//clr-dg-row[contains(.,'${projectname}')]//clr-checkbox-wrapper//label Retry Element Click xpath=//clr-dg-row[contains(.,'${projectname}')]//clr-checkbox-wrapper//label
Retry Element Click xpath=//*[@id='delete-project'] Retry Element Click xpath=//*[@id='delete-project']
Retry Element Click //clr-modal//button[contains(.,'DELETE')] Retry Element Click //clr-modal//button[contains(.,'DELETE')]
Sleep 1 Sleep 1
Project Should Not Be Deleted Project Should Not Be Deleted
[Arguments] ${projname} [Arguments] ${projname}
Delete Project ${projname} Delete Project ${projname}
Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${projname}')]/../div/clr-icon[@shape='error-standard'] Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${projname}')]/../div/clr-icon[@shape='error-standard']
Project Should Be Deleted Project Should Be Deleted
[Arguments] ${projname} [Arguments] ${projname}
Delete Project ${projname} Delete Project ${projname}
Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${projname}')]/../div/clr-icon[@shape='success-standard'] Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${projname}')]/../div/clr-icon[@shape='success-standard']
Advanced Search Should Display Advanced Search Should Display
Retry Wait Until Page Contains Element xpath=//audit-log//div[@class='flex-xs-middle']/button Retry Wait Until Page Contains Element xpath=//audit-log//div[@class='flex-xs-middle']/button
# it's not a common keywords, only used into log case. # it's not a common keywords, only used into log case.
Do Log Advanced Search Do Log Advanced Search
Capture Page Screenshot LogAdvancedSearch.png Capture Page Screenshot LogAdvancedSearch.png
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'pull')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'pull')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'create')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'create')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'delete')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'artifact') and contains(.,'delete')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'project') and contains(.,'create')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'project') and contains(.,'create')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'repository') and contains(.,'delete')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'repository') and contains(.,'delete')]
Retry Element Click xpath=//audit-log//div[@class='flex-xs-middle']/button Retry Element Click xpath=//audit-log//div[@class='flex-xs-middle']/button
Retry Element Click xpath=//project-detail//audit-log//clr-dropdown/button Retry Element Click xpath=//project-detail//audit-log//clr-dropdown/button
#pull log #pull log
Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Pull')] Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Pull')]
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'pull')] Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'pull')]
#push log #push log
Retry Element Click xpath=//audit-log//clr-dropdown/button Retry Element Click xpath=//audit-log//clr-dropdown/button
Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Push')] Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Push')]
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'push')] Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'push')]
#create log #create log
Retry Element Click xpath=//audit-log//clr-dropdown/button Retry Element Click xpath=//audit-log//clr-dropdown/button
Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Create')] Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Create')]
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'create')] Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'create')]
#delete log #delete log
Retry Element Click xpath=//audit-log//clr-dropdown/button Retry Element Click xpath=//audit-log//clr-dropdown/button
Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Delete')] Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Delete')]
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'delete')] Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'delete')]
#others #others
Retry Element Click xpath=//audit-log//clr-dropdown/button Retry Element Click xpath=//audit-log//clr-dropdown/button
Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Others')] Retry Element Click xpath=//audit-log//clr-dropdown//a[contains(.,'Others')]
Retry Element Click xpath=//audit-log//hbr-filter//clr-icon Retry Element Click xpath=//audit-log//hbr-filter//clr-icon
Retry Text Input xpath=//audit-log//hbr-filter//input harbor Retry Text Input xpath=//audit-log//hbr-filter//input harbor
Sleep 1 Sleep 1
Capture Page Screenshot LogAdvancedSearch2.png Capture Page Screenshot LogAdvancedSearch2.png
${rc} = Get Element Count //audit-log//clr-dg-row ${rc} = Get Element Count //audit-log//clr-dg-row
Should Be Equal As Integers ${rc} 0 Should Be Equal As Integers ${rc} 0
Go Into Repo Go Into Repo
[Arguments] ${repoName} [Arguments] ${repoName}
Sleep 2 Sleep 2
Retry Wait Until Page Not Contains Element ${repo_list_spinner} Retry Wait Until Page Not Contains Element ${repo_list_spinner}
${repo_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${repoName}')]/a ${repo_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${repoName}')]/a
Retry Element Click ${repo_search_icon} Retry Element Click ${repo_search_icon}
:For ${n} IN RANGE 1 10 :For ${n} IN RANGE 1 10
\ Retry Clear Element Text ${repo_search_input} \ Retry Clear Element Text ${repo_search_input}
\ Retry Text Input ${repo_search_input} ${repoName} \ Retry Text Input ${repo_search_input} ${repoName}
\ ${out} Run Keyword And Ignore Error Retry Wait Until Page Contains Element ${repo_name_element} \ ${out} Run Keyword And Ignore Error Retry Wait Until Page Contains Element ${repo_name_element}
\ Exit For Loop If '${out[0]}'=='PASS' \ Exit For Loop If '${out[0]}'=='PASS'
\ Capture Page Screenshot gointo_${repoName}.png \ Capture Page Screenshot gointo_${repoName}.png
\ Sleep 2 \ Sleep 2
Retry Double Keywords When Error Retry Element Click ${repo_name_element} Retry Wait Until Page Not Contains Element ${repo_name_element} Retry Double Keywords When Error Retry Element Click ${repo_name_element} Retry Wait Until Page Not Contains Element ${repo_name_element}
Retry Wait Element ${tag_table_column_vulnerabilities} Retry Wait Element ${tag_table_column_vulnerabilities}
Retry Wait Element ${tag_table_column_size} Retry Wait Element ${tag_table_column_size}
Capture Page Screenshot gointo_${repoName}.png Capture Page Screenshot gointo_${repoName}.png
Go Into Index Click Index Achieve
[Arguments] ${index_name}=${null} [Arguments] ${tag_name}
Retry Element Click ${artifact_achieve_icon} Retry Element Click //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256') and contains(.,'${tag_name}')]//clr-dg-cell[1]//clr-tooltip//a
Switch To CardView Go Into Index And Contain Artifacts
Retry Element Click xpath=//hbr-repository-gridview//span[@class='card-btn']/clr-icon [Arguments] ${tag_name} ${limit}=3
Sleep 5 Retry Double Keywords When Error Click Index Achieve ${tag_name} Page Should Contain Element ${tag_table_column_os_arch}
:For ${n} IN RANGE 1 10
Expand Repo \ ${out} Run Keyword And Ignore Error Page Should Contain Element ${artifact_rows} limit=${limit}
[Arguments] ${projectname} \ Exit For Loop If '${out[0]}'=='PASS'
Retry Element Click //repository//clr-dg-row[contains(.,'${projectname}')]//button/clr-icon \ Capture Page Screenshot gointo_${tag_name}.png
Sleep 1 \ Sleep 3
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot
Edit Repo Info Should Be Equal As Strings '${out[0]}' 'PASS'
Retry Element Click //*[@id='repo-info']
Retry Wait Until Page Contains Element //*[@id='info']/form/div[2] Switch To CardView
# Cancel input Retry Element Click xpath=//hbr-repository-gridview//span[@class='card-btn']/clr-icon
Retry Element Click xpath=//*[@id='info-edit-button']/button Sleep 5
Input Text xpath=//*[@id='info-edit-textarea'] test_description_info
Retry Element Click xpath=//*[@id='edit-cancel'] Expand Repo
Retry Element Click xpath=//clr-modal//button[contains(.,'CONFIRM')] [Arguments] ${projectname}
Retry Wait Until Page Contains Element //*[@id='no-editing'] Retry Element Click //repository//clr-dg-row[contains(.,'${projectname}')]//button/clr-icon
# Confirm input Sleep 1
Retry Element Click xpath=//*[@id='info-edit-button']/button
Input Text xpath=//*[@id='info-edit-textarea'] test_description_info Edit Repo Info
Retry Element Click xpath=//*[@id='edit-save'] Retry Element Click //*[@id='repo-info']
Retry Wait Until Page Contains test_description_info Retry Wait Until Page Contains Element //*[@id='info']/form/div[2]
Capture Page Screenshot # Cancel input
Retry Element Click xpath=//*[@id='info-edit-button']/button
Switch To Project Label Input Text xpath=//*[@id='info-edit-textarea'] test_description_info
Retry Element Click xpath=//project-detail//a[contains(.,'Labels')] Retry Element Click xpath=//*[@id='edit-cancel']
Sleep 1 Retry Element Click xpath=//clr-modal//button[contains(.,'CONFIRM')]
Retry Wait Until Page Contains Element //*[@id='no-editing']
Switch To Project Repo # Confirm input
Retry Element Click xpath=//project-detail//a[contains(.,'Repositories')] Retry Element Click xpath=//*[@id='info-edit-button']/button
Sleep 1 Input Text xpath=//*[@id='info-edit-textarea'] test_description_info
Retry Element Click xpath=//*[@id='edit-save']
Add Labels To Tag Retry Wait Until Page Contains test_description_info
[Arguments] ${tagName} ${labelName} Capture Page Screenshot
Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label
Capture Page Screenshot add_${labelName}.png Switch To Project Label
Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//span Retry Element Click xpath=//project-detail//a[contains(.,'Labels')]
Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'Add Labels')] Sleep 1
Retry Element Click xpath=//clr-dropdown//div//label[contains(.,'${labelName}')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row//label[contains(.,'${labelName}')] Switch To Project Repo
Retry Element Click xpath=//project-detail//a[contains(.,'Repositories')]
Filter Labels In Tags Sleep 1
[Arguments] ${labelName1} ${labelName2}
Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon Add Labels To Tag
Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select [Arguments] ${tagName} ${labelName}
Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select/option[@value='labels'] Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label
Retry Wait Until Page Contains Element xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')] Capture Page Screenshot add_${labelName}.png
Retry Element Click xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')] Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//span
Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'Add Labels')]
Retry Wait Until Page Contains Element xpath=//clr-datagrid//label[contains(.,'${labelName1}')] Retry Element Click xpath=//clr-dropdown//div//label[contains(.,'${labelName}')]
Retry Wait Until Page Contains Element xpath=//clr-dg-row//label[contains(.,'${labelName}')]
Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon
Retry Element Click xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName2}')] Filter Labels In Tags
Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon [Arguments] ${labelName1} ${labelName2}
Sleep 2 Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon
Capture Page Screenshot filter_${labelName2}.png Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select
Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${labelName2}')] Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select/option[@value='labels']
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'${labelName1}')] Retry Wait Until Page Contains Element xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')]
Retry Element Click xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')]
Get Statics Private Repo Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon
${privaterepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[2]/statistics/div/span[1] Retry Wait Until Page Contains Element xpath=//clr-datagrid//label[contains(.,'${labelName1}')]
Convert To Integer ${privaterepo}
[Return] ${privaterepo} Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon
Retry Element Click xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName2}')]
Get Statics Private Project Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon
${privateproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[1]/statistics/div/span[1] Sleep 2
Convert To Integer ${privateproj} Capture Page Screenshot filter_${labelName2}.png
[Return] ${privateproj} Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${labelName2}')]
Retry Wait Until Page Not Contains Element xpath=//clr-dg-row[contains(.,'${labelName1}')]
Get Statics Public Repo
${publicrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[2]/statistics/div/span[1] Get Statics Private Repo
Convert To Integer ${publicrepo} ${privaterepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[2]/statistics/div/span[1]
[Return] ${publicrepo} Convert To Integer ${privaterepo}
[Return] ${privaterepo}
Get Statics Public Project
${publicproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[1]/statistics/div/span[1] Get Statics Private Project
Convert To Integer ${publicproj} ${privateproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[1]/statistics/div/span[1]
[Return] ${publicproj} Convert To Integer ${privateproj}
[Return] ${privateproj}
Get Statics Total Repo
${totalrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[2]/statistics/div/span[1] Get Statics Public Repo
Convert To Integer ${totalrepo} ${publicrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[2]/statistics/div/span[1]
[Return] ${totalrepo} Convert To Integer ${publicrepo}
[Return] ${publicrepo}
Get Statics Total Project
${totalproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[1]/statistics/div/span[1] Get Statics Public Project
Convert To Integer ${totalproj} ${publicproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[1]/statistics/div/span[1]
[Return] ${totalproj} Convert To Integer ${publicproj}
[Return] ${publicproj}
Input Count Quota
[Arguments] ${text} Get Statics Total Repo
${element_xpath}= Set Variable ${project_add_count_quota_input_text_id} ${totalrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[2]/statistics/div/span[1]
Retry Clear Element Text ${element_xpath} Convert To Integer ${totalrepo}
Retry Text Input ${element_xpath} ${text} [Return] ${totalrepo}
Input Storage Quota Get Statics Total Project
[Arguments] ${text} ${unit}=${null} ${totalproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[1]/statistics/div/span[1]
${element_xpath}= Set Variable ${project_add_storage_quota_input_text_id} Convert To Integer ${totalproj}
Retry Clear Element Text ${element_xpath} [Return] ${totalproj}
Retry Text Input ${element_xpath} ${text}
Run Keyword If '${unit}'!='${null}' Select Storage Quota unit ${unit} Input Count Quota
[Arguments] ${text}
Select Storage Quota unit ${element_xpath}= Set Variable ${project_add_count_quota_input_text_id}
[Arguments] ${unit} Retry Clear Element Text ${element_xpath}
Select From List By Value ${project_add_storage_quota_unit_id} ${unit} Retry Text Input ${element_xpath} ${text}
Input Storage Quota
[Arguments] ${text} ${unit}=${null}
${element_xpath}= Set Variable ${project_add_storage_quota_input_text_id}
Retry Clear Element Text ${element_xpath}
Retry Text Input ${element_xpath} ${text}
Run Keyword If '${unit}'!='${null}' Select Storage Quota unit ${unit}
Select Storage Quota unit
[Arguments] ${unit}
Select From List By Value ${project_add_storage_quota_unit_id} ${unit}

View File

@ -1,21 +1,24 @@
# Copyright Project Harbor Authors # Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Documentation This resource provides any keywords related to public Documentation This resource provides any keywords related to public
*** Variables *** *** Variables ***
${delete_btn} //clr-modal//button[contains(.,'DELETE')] ${delete_btn} //clr-modal//button[contains(.,'DELETE')]
${delete_btn_2} //button[contains(.,'Delete')] ${delete_btn_2} //button[contains(.,'Delete')]
${default_scanner_info_close_icon} /html/body/harbor-app/harbor-shell/clr-main-container/div[1]/div[3]/clr-icon
${back_to_home_link} /html/body/harbor-app/harbor-shell/clr-main-container/div[2]/div/search-result/div/div[2]/a

View File

@ -1,259 +1,259 @@
# Copyright Project Harbor Authors # Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance Documentation This resource provides any keywords related to the Harbor private registry appliance
Resource ../../resources/Util.robot Resource ../../resources/Util.robot
*** Variables *** *** Variables ***
*** Keywords *** *** Keywords ***
Filter Replicatin Rule Filter Replicatin Rule
[Arguments] ${ruleName} [Arguments] ${ruleName}
${rule_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${ruleName}')] ${rule_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${ruleName}')]
Retry Element Click ${filter_rules_btn} Retry Element Click ${filter_rules_btn}
Retry Text Input ${filter_rules_input} ${ruleName} Retry Text Input ${filter_rules_input} ${ruleName}
Retry Wait Until Page Contains Element ${rule_name_element} Retry Wait Until Page Contains Element ${rule_name_element}
Capture Page Screenshot filter_replic_${ruleName}.png Capture Page Screenshot filter_replic_${ruleName}.png
Select Dest Registry Select Dest Registry
[Arguments] ${endpoint} [Arguments] ${endpoint}
Retry Element Click ${dest_registry_dropdown_list} Retry Element Click ${dest_registry_dropdown_list}
Retry Element Click ${dest_registry_dropdown_list}//option[contains(.,'${endpoint}')] Retry Element Click ${dest_registry_dropdown_list}//option[contains(.,'${endpoint}')]
Select Source Registry Select Source Registry
[Arguments] ${endpoint} [Arguments] ${endpoint}
Retry Element Click ${src_registry_dropdown_list} Retry Element Click ${src_registry_dropdown_list}
Retry Element Click ${src_registry_dropdown_list}//option[contains(.,'${endpoint}')] Retry Element Click ${src_registry_dropdown_list}//option[contains(.,'${endpoint}')]
Select Trigger Select Trigger
[Arguments] ${mode} [Arguments] ${mode}
Retry Element Click ${rule_trigger_select} Retry Element Click ${rule_trigger_select}
Retry Element Click ${rule_trigger_select}//option[contains(.,'${mode}')] Retry Element Click ${rule_trigger_select}//option[contains(.,'${mode}')]
Select Destination URL Select Destination URL
[Arguments] ${type} [Arguments] ${type}
Retry Element Click ${destination_url_xpath} Retry Element Click ${destination_url_xpath}
Retry Element Click //div[contains(@class, 'selectBox')]//li[contains(.,'${type}')] Retry Element Click //div[contains(@class, 'selectBox')]//li[contains(.,'${type}')]
Check New Rule UI Without Endpoint Check New Rule UI Without Endpoint
Retry Element Click ${new_replication-rule_button} Retry Element Click ${new_replication-rule_button}
Page Should Contain Please add an endpoint first Page Should Contain Please add an endpoint first
Retry Element Click ${link_to_registries} Retry Element Click ${link_to_registries}
Retry Wait Until Page Contains Endpoint URL Retry Wait Until Page Contains Endpoint URL
Retry Wait Element ${new_endpoint_button} Retry Wait Element ${new_endpoint_button}
Create A New Endpoint Create A New Endpoint
[Arguments] ${provider} ${name} ${url} ${username} ${pwd} ${save}=Y [Arguments] ${provider} ${name} ${url} ${username} ${pwd} ${save}=Y
#click new button #click new button
Retry Element Click xpath=${new_endpoint_button} Retry Element Click xpath=${new_endpoint_button}
#input necessary info #input necessary info
Select From List By Value ${provider_selector} ${provider} Select From List By Value ${provider_selector} ${provider}
Retry Text Input xpath=${destination_name_xpath} ${name} Retry Text Input xpath=${destination_name_xpath} ${name}
Run Keyword If '${provider}' == 'harbor' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url} Run Keyword If '${provider}' == 'harbor' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url}
Run Keyword If '${provider}' == 'aws-ecr' or '${provider}' == 'google-gcr' Run keyword Select Destination URL ${url} Run Keyword If '${provider}' == 'aws-ecr' or '${provider}' == 'google-gcr' Run keyword Select Destination URL ${url}
Run Keyword If '${provider}' != 'google-gcr' Retry Text Input xpath=${destination_username_xpath} ${username} Run Keyword If '${provider}' != 'google-gcr' Retry Text Input xpath=${destination_username_xpath} ${username}
Retry Text Input xpath=${destination_password_xpath} ${pwd} Retry Text Input xpath=${destination_password_xpath} ${pwd}
#cancel verify cert since we use a selfsigned cert #cancel verify cert since we use a selfsigned cert
Retry Element Click ${destination_insecure_xpath} Retry Element Click ${destination_insecure_xpath}
Run Keyword If '${save}' == 'Y' Run keyword Retry Double Keywords When Error Retry Element Click ${replication_save_xpath} Retry Wait Until Page Not Contains Element ${replication_save_xpath} Run Keyword If '${save}' == 'Y' Run keyword Retry Double Keywords When Error Retry Element Click ${replication_save_xpath} Retry Wait Until Page Not Contains Element ${replication_save_xpath}
Run Keyword If '${save}' == 'Y' Run keyword Retry Wait Until Page Contains ${name} Run Keyword If '${save}' == 'Y' Run keyword Retry Wait Until Page Contains ${name}
Run Keyword If '${save}' == 'N' No Operation Run Keyword If '${save}' == 'N' No Operation
Create A Rule With Existing Endpoint Create A Rule With Existing Endpoint
[Arguments] ${name} ${replication_mode} ${project_name} ${resource_type} ${endpoint} ${dest_namespace} [Arguments] ${name} ${replication_mode} ${project_name} ${resource_type} ${endpoint} ${dest_namespace}
... ${mode}=Manual ... ${mode}=Manual
#click new #click new
Retry Element Click ${new_name_xpath} Retry Element Click ${new_name_xpath}
#input name #input name
Retry Text Input ${rule_name} ${name} Retry Text Input ${rule_name} ${name}
Run Keyword If '${replication_mode}' == 'push' Run Keywords Retry Element Click ${replication_mode_radio_push} Run Keyword If '${replication_mode}' == 'push' Run Keywords Retry Element Click ${replication_mode_radio_push}
... AND Select Dest Registry ${endpoint} ... AND Select Dest Registry ${endpoint}
... ELSE Run Keywords Retry Element Click ${replication_mode_radio_pull} ... ELSE Run Keywords Retry Element Click ${replication_mode_radio_pull}
... AND Select Source Registry ${endpoint} ... AND Select Source Registry ${endpoint}
#set filter #set filter
Retry Text Input ${source_project} ${project_name} Retry Text Input ${source_project} ${project_name}
Run Keyword And Ignore Error Select From List By Value ${rule_resource_selector} ${resource_type} Run Keyword And Ignore Error Select From List By Value ${rule_resource_selector} ${resource_type}
Retry Text Input ${dest_namespace_xpath} ${dest_namespace} Retry Text Input ${dest_namespace_xpath} ${dest_namespace}
#set trigger #set trigger
Select Trigger ${mode} Select Trigger ${mode}
Run Keyword If '${mode}' == 'Scheduled' Log To Console Scheduled Run Keyword If '${mode}' == 'Scheduled' Log To Console Scheduled
#click save #click save
Retry Double Keywords When Error Retry Element Click ${rule_save_button} Retry Wait Until Page Not Contains Element ${rule_save_button} Retry Double Keywords When Error Retry Element Click ${rule_save_button} Retry Wait Until Page Not Contains Element ${rule_save_button}
Sleep 2 Sleep 2
Endpoint Is Unpingable Endpoint Is Unpingable
Retry Element Click ${ping_test_button} Retry Element Click ${ping_test_button}
Wait Until Page Contains Failed Wait Until Page Contains Failed
Endpoint Is Pingable Endpoint Is Pingable
Retry Element Click ${ping_test_button} Retry Element Click ${ping_test_button}
Wait Until Page Contains successfully Wait Until Page Contains successfully
Disable Certificate Verification Disable Certificate Verification
Checkbox Should Be Selected ${destination_insecure_checkbox} Checkbox Should Be Selected ${destination_insecure_checkbox}
Retry Element Click ${destination_insecure_xpath} Retry Element Click ${destination_insecure_xpath}
Sleep 1 Sleep 1
Enable Certificate Verification Enable Certificate Verification
Checkbox Should Not Be Selected ${destination_insecure_checkbox} Checkbox Should Not Be Selected ${destination_insecure_checkbox}
Retry Element Click ${destination_insecure_xpath} Retry Element Click ${destination_insecure_xpath}
Sleep 1 Sleep 1
Switch To Registries Switch To Registries
Retry Element Click ${nav_to_registries} Retry Element Click ${nav_to_registries}
Sleep 1 Sleep 1
Switch To Replication Manage Switch To Replication Manage
Retry Element Click ${nav_to_replications} Retry Element Click ${nav_to_replications}
Sleep 1 Sleep 1
Trigger Replication Manual Trigger Replication Manual
[Arguments] ${rule} [Arguments] ${rule}
Retry Element Click ${rule_filter_search} Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule} Retry Text Input ${rule_filter_input} ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_replicate} Retry Element Click ${action_bar_replicate}
Retry Wait Until Page Contains Element ${dialog_replicate} Retry Wait Until Page Contains Element ${dialog_replicate}
#change from click to mouse down and up #change from click to mouse down and up
Mouse Down ${dialog_replicate} Mouse Down ${dialog_replicate}
Mouse Up ${dialog_replicate} Mouse Up ${dialog_replicate}
Sleep 2 Sleep 2
Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${rule}')]/../div/clr-icon[@shape='success-standard'] Retry Wait Until Page Contains Element //*[@id='contentAll']//div[contains(.,'${rule}')]/../div/clr-icon[@shape='success-standard']
Sleep 1 Sleep 1
Rename Rule Rename Rule
[Arguments] ${rule} ${newname} [Arguments] ${rule} ${newname}
Retry Element Click ${rule_filter_search} Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule} Retry Text Input ${rule_filter_input} ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_edit} Retry Element Click ${action_bar_edit}
Retry Text Input ${rule_name} ${newname} Retry Text Input ${rule_name} ${newname}
Retry Element Click ${rule_save_button} Retry Element Click ${rule_save_button}
Delete Rule Delete Rule
[Arguments] ${rule} [Arguments] ${rule}
Retry Element Click ${rule_filter_search} Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule} Retry Text Input ${rule_filter_input} ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_delete} Retry Element Click ${action_bar_delete}
Retry Wait Until Page Contains Element ${dialog_delete} Retry Wait Until Page Contains Element ${dialog_delete}
#change from click to mouse down and up #change from click to mouse down and up
Mouse Down ${dialog_delete} Mouse Down ${dialog_delete}
Mouse Up ${dialog_delete} Mouse Up ${dialog_delete}
Sleep 2 Sleep 2
Filter Rule Filter Rule
[Arguments] ${rule} [Arguments] ${rule}
Retry Element Click ${rule_filter_search} Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule} Retry Text Input ${rule_filter_input} ${rule}
Sleep 1 Sleep 1
Select Rule Select Rule
[Arguments] ${rule} [Arguments] ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Stop Jobs Stop Jobs
Retry Element Click ${stop_jobs_button} Retry Element Click ${stop_jobs_button}
View Job Log View Job Log
[arguments] ${job} [arguments] ${job}
Retry Element Click ${job_filter_search} Retry Element Click ${job_filter_search}
Retry Text Input ${job_filter_input} ${job} Retry Text Input ${job_filter_input} ${job}
Retry Link Click //clr-dg-row[contains(.,'${job}')]//a Retry Link Click //clr-dg-row[contains(.,'${job}')]//a
Find Item And Click Edit Button Find Item And Click Edit Button
[Arguments] ${name} [Arguments] ${name}
Filter Object ${name} Filter Object ${name}
Retry Select Object ${name} Retry Select Object ${name}
Retry Element Click ${action_bar_edit} Retry Element Click ${action_bar_edit}
Find Item And Click Delete Button Find Item And Click Delete Button
[Arguments] ${name} [Arguments] ${name}
Filter Object ${name} Filter Object ${name}
Retry Select Object ${name} Retry Select Object ${name}
Retry Element Click ${action_bar_delete} Retry Element Click ${action_bar_delete}
Switch To Replication Manage Page Switch To Replication Manage Page
[Arguments] ${name} [Arguments] ${name}
Switch To Registries Switch To Registries
Switch To Replication Manage Switch To Replication Manage
Edit Replication Rule By Name Edit Replication Rule By Name
[Arguments] ${name} [Arguments] ${name}
Retry Double Keywords When Error Switch To Replication Manage Page "NULL" Find Item And Click Edit Button ${name} Retry Double Keywords When Error Switch To Replication Manage Page "NULL" Find Item And Click Edit Button ${name}
Delete Replication Rule By Name Delete Replication Rule By Name
[Arguments] ${name} [Arguments] ${name}
Switch To Registries Switch To Registries
Switch To Replication Manage Switch To Replication Manage
Find Item And Click Delete Button ${name} Find Item And Click Delete Button ${name}
Ensure Delete Replication Rule By Name Ensure Delete Replication Rule By Name
[Arguments] ${name} [Arguments] ${name}
Delete Replication Rule By Name ${name} Delete Replication Rule By Name ${name}
Retry Double Keywords When Error Retry Element Click ${delete_confirm_btn} Retry Wait Until Page Not Contains Element ${delete_confirm_btn} Retry Double Keywords When Error Retry Element Click ${delete_confirm_btn} Retry Wait Until Page Not Contains Element ${delete_confirm_btn}
Retry Wait Element xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any replication rules!\")] Retry Wait Element xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any replication rules!\")]
Rename Endpoint Rename Endpoint
[arguments] ${name} ${newname} [arguments] ${name} ${newname}
Find Item And Click Edit Button ${name} Find Item And Click Edit Button ${name}
Retry Wait Until Page Contains Element ${destination_name_xpath} Retry Wait Until Page Contains Element ${destination_name_xpath}
Retry Text Input ${destination_name_xpath} ${newname} Retry Text Input ${destination_name_xpath} ${newname}
Retry Element Click ${replication_save_xpath} Retry Element Click ${replication_save_xpath}
Delete Endpoint Delete Endpoint
[Arguments] ${name} [Arguments] ${name}
Retry Element Click ${endpoint_filter_search} Retry Element Click ${endpoint_filter_search}
Retry Text Input ${endpoint_filter_input} ${name} Retry Text Input ${endpoint_filter_input} ${name}
#click checkbox before target endpoint #click checkbox before target endpoint
Retry Double Keywords When Error Retry Element Click //clr-dg-row[contains(.,'${name}')]//clr-checkbox-wrapper Retry Wait Element ${action_bar_delete} Retry Double Keywords When Error Retry Element Click //clr-dg-row[contains(.,'${name}')]//clr-checkbox-wrapper Retry Wait Element ${action_bar_delete}
Retry Element Click ${action_bar_delete} Retry Element Click ${action_bar_delete}
Wait Until Page Contains Element ${dialog_delete} Wait Until Page Contains Element ${dialog_delete}
Retry Element Click ${dialog_delete} Retry Element Click ${dialog_delete}
Select Rule And Replicate Select Rule And Replicate
[Arguments] ${rule_name} [Arguments] ${rule_name}
Retry Element Click //hbr-list-replication-rule//clr-dg-cell[contains(.,'${rule_name}')] Retry Element Click //hbr-list-replication-rule//clr-dg-cell[contains(.,'${rule_name}')]
Retry Element Click ${replication_exec_id} Retry Element Click ${replication_exec_id}
Retry Double Keywords When Error Retry Element Click xpath=${dialog_replicate} Retry Wait Until Page Not Contains Element xpath=${dialog_replicate} Retry Double Keywords When Error Retry Element Click xpath=${dialog_replicate} Retry Wait Until Page Not Contains Element xpath=${dialog_replicate}
Select Rule And Click Edit Button Select Rule And Click Edit Button
[Arguments] ${rule_name} [Arguments] ${rule_name}
Retry Element Click //clr-dg-row[contains(.,'${rule_name}')]//clr-radio-wrapper/label Retry Element Click //clr-dg-row[contains(.,'${rule_name}')]//clr-radio-wrapper/label
Retry Element Click ${edit_replication_rule_id} Retry Element Click ${edit_replication_rule_id}
Delete Replication Rule Delete Replication Rule
[Arguments] ${name} [Arguments] ${name}
Retry Element Click ${endpoint_filter_search} Retry Element Click ${endpoint_filter_search}
Retry Text Input ${endpoint_filter_input} ${name} Retry Text Input ${endpoint_filter_input} ${name}
#click checkbox before target endpoint #click checkbox before target endpoint
Retry Element Click //clr-dg-row[contains(.,'${name}')]//label Retry Element Click //clr-dg-row[contains(.,'${name}')]//label
Retry Element Click ${action_bar_delete} Retry Element Click ${action_bar_delete}
Wait Until Page Contains Element ${dialog_delete} Wait Until Page Contains Element ${dialog_delete}
Retry Element Click ${dialog_delete} Retry Element Click ${dialog_delete}
Image Should Be Replicated To Project Image Should Be Replicated To Project
[Arguments] ${project} ${image} ${period}=60 ${times}=10 [Arguments] ${project} ${image} ${period}=60 ${times}=10
:For ${n} IN RANGE 1 ${times} :For ${n} IN RANGE 1 ${times}
\ Sleep ${period} \ Sleep ${period}
\ Go Into Project ${project} \ Go Into Project ${project}
\ Switch To Project Repo \ Switch To Project Repo
\ #In AWS-ECR, under repository a, there're only several images: httpd,alpine,hello-world. \ #In AWS-ECR, under repository a, there're only several images: httpd,alpine,hello-world.
\ ${out} Run Keyword And Ignore Error Retry Wait Until Page Contains ${project}/${image} \ ${out} Run Keyword And Ignore Error Retry Wait Until Page Contains ${project}/${image}
\ Log To Console Return value is ${out[0]} \ Log To Console Return value is ${out[0]}
\ Exit For Loop If '${out[0]}'=='PASS' \ Exit For Loop If '${out[0]}'=='PASS'
\ Sleep 5 \ Sleep 5
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot
Should Be Equal As Strings '${out[0]}' 'PASS' Should Be Equal As Strings '${out[0]}' 'PASS'

View File

@ -1,317 +1,317 @@
# Copyright Project Harbor Authors # Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Documentation This resource wrap test case body Documentation This resource wrap test case body
*** Variables *** *** Variables ***
*** Keywords *** *** Keywords ***
Body Of Manage project publicity Body Of Manage project publicity
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} user007 Test1@34 Sign In Harbor ${HARBOR_URL} user007 Test1@34
Create An New Project And Go Into Project project${d} public=true Create An New Project And Go Into Project project${d} public=true
Push image ${ip} user007 Test1@34 project${d} hello-world:latest Push image ${ip} user007 Test1@34 project${d} hello-world:latest
Pull image ${ip} user008 Test1@34 project${d} hello-world:latest Pull image ${ip} user008 Test1@34 project${d} hello-world:latest
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} user008 Test1@34 Sign In Harbor ${HARBOR_URL} user008 Test1@34
Project Should Display project${d} Project Should Display project${d}
Search Private Projects Search Private Projects
Project Should Not Display project${d} Project Should Not Display project${d}
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} user007 Test1@34 Sign In Harbor ${HARBOR_URL} user007 Test1@34
Make Project Private project${d} Make Project Private project${d}
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} user008 Test1@34 Sign In Harbor ${HARBOR_URL} user008 Test1@34
Project Should Not Display project${d} Project Should Not Display project${d}
Cannot Pull image ${ip} user008 Test1@34 project${d} hello-world:latest Cannot Pull image ${ip} user008 Test1@34 project${d} hello-world:latest
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} user007 Test1@34 Sign In Harbor ${HARBOR_URL} user007 Test1@34
Make Project Public project${d} Make Project Public project${d}
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} user008 Test1@34 Sign In Harbor ${HARBOR_URL} user008 Test1@34
Project Should Display project${d} Project Should Display project${d}
Close Browser Close Browser
Body Of Scan A Tag In The Repo Body Of Scan A Tag In The Repo
[Arguments] ${image_argument} ${tag_argument} ${is_no_vulerabilty}=${false} [Arguments] ${image_argument} ${tag_argument} ${is_no_vulerabilty}=${false}
Init Chrome Driver Init Chrome Driver
${d}= get current date result_format=%m%s ${d}= get current date result_format=%m%s
Sign In Harbor ${HARBOR_URL} user023 Test1@34 Sign In Harbor ${HARBOR_URL} user023 Test1@34
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} user023 Test1@34 project${d} ${image_argument}:${tag_argument} Push Image ${ip} user023 Test1@34 project${d} ${image_argument}:${tag_argument}
Go Into Project project${d} Go Into Project project${d}
Go Into Repo project${d}/${image_argument} Go Into Repo project${d}/${image_argument}
Scan Repo ${tag_argument} Succeed Scan Repo ${tag_argument} Succeed
Scan Result Should Display In List Row ${tag_argument} is_no_vulerabilty=${is_no_vulerabilty} Scan Result Should Display In List Row ${tag_argument} is_no_vulerabilty=${is_no_vulerabilty}
Pull Image ${ip} user023 Test1@34 project${d} ${image_argument} ${tag_argument} Pull Image ${ip} user023 Test1@34 project${d} ${image_argument} ${tag_argument}
# Edit Repo Info # Edit Repo Info
Close Browser Close Browser
Body Of Scan Image With Empty Vul Body Of Scan Image With Empty Vul
[Arguments] ${image_argument} ${tag_argument} [Arguments] ${image_argument} ${tag_argument}
Init Chrome Driver Init Chrome Driver
${tag}= Set Variable ${tag_argument} ${tag}= Set Variable ${tag_argument}
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library ${image_argument}:${tag_argument} Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library ${image_argument}:${tag_argument}
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Go Into Project library Go Into Project library
Go Into Repo ${image_argument} Go Into Repo ${image_argument}
Scan Repo ${tag} Succeed Scan Repo ${tag} Succeed
Move To Summary Chart Move To Summary Chart
Scan Result Should Display In List Row ${tag} is_no_vulerabilty=${true} Scan Result Should Display In List Row ${tag} is_no_vulerabilty=${true}
Close Browser Close Browser
Body Of Manual Scan All Body Of Manual Scan All
[Arguments] @{vulnerability_levels} [Arguments] @{vulnerability_levels}
Init Chrome Driver Init Chrome Driver
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library redis Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library redis
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Vulnerability Page Switch To Vulnerability Page
Trigger Scan Now And Wait Until The Result Appears Trigger Scan Now And Wait Until The Result Appears
Navigate To Projects Navigate To Projects
Go Into Project library Go Into Project library
Go Into Repo redis Go Into Repo redis
Scan Result Should Display In List Row latest Scan Result Should Display In List Row latest
View Repo Scan Details @{vulnerability_levels} View Repo Scan Details @{vulnerability_levels}
Close Browser Close Browser
Body Of View Scan Results Body Of View Scan Results
[Arguments] @{vulnerability_levels} [Arguments] @{vulnerability_levels}
Init Chrome Driver Init Chrome Driver
${d}= get current date result_format=%m%s ${d}= get current date result_format=%m%s
Sign In Harbor ${HARBOR_URL} user025 Test1@34 Sign In Harbor ${HARBOR_URL} user025 Test1@34
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} user025 Test1@34 project${d} tomcat Push Image ${ip} user025 Test1@34 project${d} tomcat
Go Into Project project${d} Go Into Project project${d}
Go Into Repo project${d}/tomcat Go Into Repo project${d}/tomcat
Scan Repo latest Succeed Scan Repo latest Succeed
Scan Result Should Display In List Row latest Scan Result Should Display In List Row latest
View Repo Scan Details @{vulnerability_levels} View Repo Scan Details @{vulnerability_levels}
Close Browser Close Browser
Body Of Scan Image On Push Body Of Scan Image On Push
[Arguments] @{vulnerability_levels} [Arguments] @{vulnerability_levels}
Init Chrome Driver Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Go Into Project library Go Into Project library
Goto Project Config Goto Project Config
Enable Scan On Push Enable Scan On Push
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library memcached Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library memcached
Navigate To Projects Navigate To Projects
Go Into Project library Go Into Project library
Go Into Repo memcached Go Into Repo memcached
Scan Result Should Display In List Row latest Scan Result Should Display In List Row latest
View Repo Scan Details @{vulnerability_levels} View Repo Scan Details @{vulnerability_levels}
Close Browser Close Browser
Body Of List Helm Charts Body Of List Helm Charts
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} user027 Test1@34 Sign In Harbor ${HARBOR_URL} user027 Test1@34
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Project Charts Switch To Project Charts
Upload Chart files Upload Chart files
Go Into Chart Version ${prometheus_chart_name} Go Into Chart Version ${prometheus_chart_name}
Retry Wait Until Page Contains ${prometheus_chart_version} Retry Wait Until Page Contains ${prometheus_chart_version}
Go Into Chart Detail ${prometheus_chart_version} Go Into Chart Detail ${prometheus_chart_version}
# Summary tab # Summary tab
Retry Wait Until Page Contains Element ${summary_markdown} Retry Wait Until Page Contains Element ${summary_markdown}
Retry Wait Until Page Contains Element ${summary_container} Retry Wait Until Page Contains Element ${summary_container}
# Dependency tab # Dependency tab
Retry Double Keywords When Error Retry Element Click xpath=${detail_dependency} Retry Wait Until Page Contains Element ${dependency_content} Retry Double Keywords When Error Retry Element Click xpath=${detail_dependency} Retry Wait Until Page Contains Element ${dependency_content}
# Values tab # Values tab
Retry Double Keywords When Error Retry Element Click xpath=${detail_value} Retry Wait Until Page Contains Element ${value_content} Retry Double Keywords When Error Retry Element Click xpath=${detail_value} Retry Wait Until Page Contains Element ${value_content}
Go Into Project project${d} has_image=${false} Go Into Project project${d} has_image=${false}
Switch To Project Charts Switch To Project Charts
Multi-delete Chart Files ${prometheus_chart_name} ${harbor_chart_name} Multi-delete Chart Files ${prometheus_chart_name} ${harbor_chart_name}
Close Browser Close Browser
Body Of Admin Push Signed Image Body Of Admin Push Signed Image
[Arguments] ${image}=tomcat ${project}=library ${with_remove}=${false} [Arguments] ${image}=tomcat ${project}=library ${with_remove}=${false}
Enable Notary Client Enable Notary Client
Docker Pull ${LOCAL_REGISTRY}/${LOCAL_REGISTRY_NAMESPACE}/${image} Docker Pull ${LOCAL_REGISTRY}/${LOCAL_REGISTRY_NAMESPACE}/${image}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} ${project} ${image} latest ${notaryServerEndpoint} ${LOCAL_REGISTRY}/${LOCAL_REGISTRY_NAMESPACE}/${image}:latest ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} ${project} ${image} latest ${notaryServerEndpoint} ${LOCAL_REGISTRY}/${LOCAL_REGISTRY_NAMESPACE}/${image}:latest
Log ${output} Log ${output}
Should Be Equal As Integers ${rc} 0 Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/v2.0/projects/${project}/repositories/${image}/artifacts/latest?with_signature=true" ${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/v2.0/projects/${project}/repositories/${image}/artifacts/latest?with_signature=true"
Log To Console ${output} Log To Console ${output}
Should Be Equal As Integers ${rc} 0 Should Be Equal As Integers ${rc} 0
Should Contain ${output} "signed":true Should Contain ${output} "signed":true
Run Keyword If ${with_remove} == ${true} Remove Notary Signature ${ip} ${image} Run Keyword If ${with_remove} == ${true} Remove Notary Signature ${ip} ${image}
Delete A Project Without Sign In Harbor Delete A Project Without Sign In Harbor
[Arguments] ${harbor_ip}=${ip} ${username}=${HARBOR_ADMIN} ${password}=${HARBOR_PASSWORD} [Arguments] ${harbor_ip}=${ip} ${username}=${HARBOR_ADMIN} ${password}=${HARBOR_PASSWORD}
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${project_name}= Set Variable 000${d} ${project_name}= Set Variable 000${d}
Create An New Project And Go Into Project ${project_name} Create An New Project And Go Into Project ${project_name}
Push Image ${harbor_ip} ${username} ${password} ${project_name} hello-world Push Image ${harbor_ip} ${username} ${password} ${project_name} hello-world
Project Should Not Be Deleted ${project_name} Project Should Not Be Deleted ${project_name}
Go Into Project ${project_name} Go Into Project ${project_name}
Delete Repo ${project_name} Delete Repo ${project_name}
Navigate To Projects Navigate To Projects
Project Should Be Deleted ${project_name} Project Should Be Deleted ${project_name}
Manage Project Member Without Sign In Harbor Manage Project Member Without Sign In Harbor
[Arguments] ${sign_in_user} ${sign_in_pwd} ${test_user1}=user005 ${test_user2}=user006 ${is_oidc_mode}=${false} [Arguments] ${sign_in_user} ${sign_in_pwd} ${test_user1}=user005 ${test_user2}=user006 ${is_oidc_mode}=${false}
${d}= Get current Date result_format=%m%s ${d}= Get current Date result_format=%m%s
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world
Logout Harbor Logout Harbor
User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Manage Project Member ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Add is_oidc_mode=${is_oidc_mode} Manage Project Member ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Add is_oidc_mode=${is_oidc_mode}
User Should Be Guest ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Be Guest ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Developer is_oidc_mode=${is_oidc_mode} Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Developer is_oidc_mode=${is_oidc_mode}
User Should Be Developer ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Be Developer ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Admin is_oidc_mode=${is_oidc_mode} Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Admin is_oidc_mode=${is_oidc_mode}
User Should Be Admin ${test_user1} ${sign_in_pwd} project${d} ${test_user2} is_oidc_mode=${is_oidc_mode} User Should Be Admin ${test_user1} ${sign_in_pwd} project${d} ${test_user2} is_oidc_mode=${is_oidc_mode}
Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Master is_oidc_mode=${is_oidc_mode} Change User Role In Project ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Master is_oidc_mode=${is_oidc_mode}
User Should Be Master ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Be Master ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Manage Project Member ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Remove is_oidc_mode=${is_oidc_mode} Manage Project Member ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Remove is_oidc_mode=${is_oidc_mode}
User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world
User Should Be Guest ${test_user2} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} User Should Be Guest ${test_user2} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode}
Helm CLI Push Without Sign In Harbor Helm CLI Push Without Sign In Harbor
[Arguments] ${sign_in_user} ${sign_in_pwd} [Arguments] ${sign_in_user} ${sign_in_pwd}
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Helm Repo Add ${HARBOR_URL} ${sign_in_user} ${sign_in_pwd} project_name=project${d} Helm Repo Add ${HARBOR_URL} ${sign_in_user} ${sign_in_pwd} project_name=project${d}
Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename} Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename}
Switch To Project Charts Switch To Project Charts
Go Into Chart Version ${harbor_chart_name} Go Into Chart Version ${harbor_chart_name}
Retry Wait Until Page Contains ${harbor_chart_version} Retry Wait Until Page Contains ${harbor_chart_version}
Capture Page Screenshot Capture Page Screenshot
Helm3 CLI Push Without Sign In Harbor Helm3 CLI Push Without Sign In Harbor
[Arguments] ${sign_in_user} ${sign_in_pwd} [Arguments] ${sign_in_user} ${sign_in_pwd}
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename} helm_repo_name=${HARBOR_URL}/chartrepo/project${d} helm_cmd=helm3 Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename} helm_repo_name=${HARBOR_URL}/chartrepo/project${d} helm_cmd=helm3
Switch To Project Charts Switch To Project Charts
Retry Double Keywords When Error Go Into Chart Version ${harbor_chart_name} Retry Wait Until Page Contains ${harbor_chart_version} Retry Double Keywords When Error Go Into Chart Version ${harbor_chart_name} Retry Wait Until Page Contains ${harbor_chart_version}
Capture Page Screenshot Capture Page Screenshot
#Important Note: All CVE IDs in CVE Whitelist cases must unique! #Important Note: All CVE IDs in CVE Whitelist cases must unique!
Body Of Verfiy System Level CVE Whitelist Body Of Verfiy System Level CVE Whitelist
[Arguments] ${image_argument} ${sha256_argument} ${most_cve_list} ${single_cve} [Arguments] ${image_argument} ${sha256_argument} ${most_cve_list} ${single_cve}
[Tags] run-once [Tags] run-once
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${image}= Set Variable ${image_argument} ${image}= Set Variable ${image_argument}
# ${image}= Set Variable goharbor/harbor-portal # ${image}= Set Variable goharbor/harbor-portal
${sha256}= Set Variable ${sha256_argument} ${sha256}= Set Variable ${sha256_argument}
# ${sha256}= Set Variable 2cb6a1c24dd6b88f11fd44ccc6560cb7be969f8ac5f752802c99cae6bcd592bb # ${sha256}= Set Variable 2cb6a1c24dd6b88f11fd44ccc6560cb7be969f8ac5f752802c99cae6bcd592bb
${signin_user}= Set Variable user025 ${signin_user}= Set Variable user025
${signin_pwd}= Set Variable Test1@34 ${signin_pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256}
Go Into Project project${d} Go Into Project project${d}
Set Vulnerabilty Serverity 2 Set Vulnerabilty Serverity 2
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Go Into Project project${d} Go Into Project project${d}
Go Into Repo project${d}/${image} Go Into Repo project${d}/${image}
Scan Repo ${sha256} Succeed Scan Repo ${sha256} Succeed
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure Switch To Configure
Switch To Configuration System Setting Switch To Configuration System Setting
# Add Items To System CVE Whitelist CVE-2019-19317\nCVE-2019-19646 \nCVE-2019-5188 \nCVE-2019-20387 \nCVE-2019-17498 \nCVE-2019-20372 \nCVE-2019-19244 \nCVE-2019-19603 \nCVE-2019-19880 \nCVE-2019-19923 \nCVE-2019-19925 \nCVE-2019-19926 \nCVE-2019-19959 \nCVE-2019-20218 \nCVE-2019-19232 \nCVE-2019-19234 \nCVE-2019-19645 # Add Items To System CVE Whitelist CVE-2019-19317\nCVE-2019-19646 \nCVE-2019-5188 \nCVE-2019-20387 \nCVE-2019-17498 \nCVE-2019-20372 \nCVE-2019-19244 \nCVE-2019-19603 \nCVE-2019-19880 \nCVE-2019-19923 \nCVE-2019-19925 \nCVE-2019-19926 \nCVE-2019-19959 \nCVE-2019-20218 \nCVE-2019-19232 \nCVE-2019-19234 \nCVE-2019-19645
Add Items To System CVE Whitelist ${most_cve_list} Add Items To System CVE Whitelist ${most_cve_list}
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
# Add Items To System CVE Whitelist CVE-2019-18276 # Add Items To System CVE Whitelist CVE-2019-18276
Add Items To System CVE Whitelist ${single_cve} Add Items To System CVE Whitelist ${single_cve}
Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Delete Top Item In System CVE Whitelist count=6 Delete Top Item In System CVE Whitelist count=6
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Close Browser Close Browser
Body Of Verfiy Project Level CVE Whitelist Body Of Verfiy Project Level CVE Whitelist
[Arguments] ${image_argument} ${sha256_argument} ${most_cve_list} ${single_cve} [Arguments] ${image_argument} ${sha256_argument} ${most_cve_list} ${single_cve}
[Tags] run-once [Tags] run-once
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${image}= Set Variable ${image_argument} ${image}= Set Variable ${image_argument}
${sha256}= Set Variable ${sha256_argument} ${sha256}= Set Variable ${sha256_argument}
${signin_user}= Set Variable user025 ${signin_user}= Set Variable user025
${signin_pwd}= Set Variable Test1@34 ${signin_pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256}
Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Go Into Project project${d} Go Into Project project${d}
Set Vulnerabilty Serverity 2 Set Vulnerabilty Serverity 2
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Go Into Project project${d} Go Into Project project${d}
Go Into Repo project${d}/${image} Go Into Repo project${d}/${image}
Scan Repo ${sha256} Succeed Scan Repo ${sha256} Succeed
Go Into Project project${d} Go Into Project project${d}
Add Items to Project CVE Whitelist ${most_cve_list} Add Items to Project CVE Whitelist ${most_cve_list}
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Add Items to Project CVE Whitelist ${single_cve} Add Items to Project CVE Whitelist ${single_cve}
Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Delete Top Item In Project CVE Whitelist Delete Top Item In Project CVE Whitelist
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Close Browser Close Browser
Body Of Verfiy Project Level CVE Whitelist By Quick Way of Add System Body Of Verfiy Project Level CVE Whitelist By Quick Way of Add System
[Arguments] ${image_argument} ${sha256_argument} ${cve_list} [Arguments] ${image_argument} ${sha256_argument} ${cve_list}
[Tags] run-once [Tags] run-once
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${image}= Set Variable ${image_argument} ${image}= Set Variable ${image_argument}
${sha256}= Set Variable ${sha256_argument} ${sha256}= Set Variable ${sha256_argument}
${signin_user}= Set Variable user025 ${signin_user}= Set Variable user025
${signin_pwd}= Set Variable Test1@34 ${signin_pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure Switch To Configure
Switch To Configuration System Setting Switch To Configuration System Setting
Add Items To System CVE Whitelist ${cve_list} Add Items To System CVE Whitelist ${cve_list}
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256}
Go Into Project project${d} Go Into Project project${d}
Set Vulnerabilty Serverity 2 Set Vulnerabilty Serverity 2
Go Into Project project${d} Go Into Project project${d}
Go Into Repo project${d}/${image} Go Into Repo project${d}/${image}
Scan Repo ${sha256} Succeed Scan Repo ${sha256} Succeed
Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Go Into Project project${d} Go Into Project project${d}
Set Project To Project Level CVE Whitelist Set Project To Project Level CVE Whitelist
Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Add System CVE Whitelist to Project CVE Whitelist By Add System Button Click Add System CVE Whitelist to Project CVE Whitelist By Add System Button Click
Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256}
Close Browser Close Browser

View File

@ -1,289 +1,276 @@
f# Copyright Project Harbor Authors f# Copyright Project Harbor Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License # limitations under the License
*** Settings *** *** Settings ***
Library OperatingSystem Library OperatingSystem
Library String Library String
Library Collections Library Collections
Library requests Library requests
Library Process Library Process
Library SSHLibrary 1 minute Library SSHLibrary 1 minute
Library DateTime Library DateTime
Library Selenium2Library 60 10 Library Selenium2Library 60 10
Library JSONLibrary Library JSONLibrary
Resource Nimbus-Util.robot Resource Nimbus-Util.robot
Resource Vsphere-Util.robot Resource Vsphere-Util.robot
Resource VCH-Util.robot Resource VCH-Util.robot
Resource Drone-Util.robot Resource Drone-Util.robot
Resource Github-Util.robot Resource Github-Util.robot
Resource Harbor-Util.robot Resource Harbor-Util.robot
Resource Harbor-Pages/Public_Elements.robot Resource Harbor-Pages/Public_Elements.robot
Resource Harbor-Pages/HomePage.robot Resource Harbor-Pages/HomePage.robot
Resource Harbor-Pages/HomePage_Elements.robot Resource Harbor-Pages/HomePage_Elements.robot
Resource Harbor-Pages/Project.robot Resource Harbor-Pages/Project.robot
Resource Harbor-Pages/Project_Elements.robot Resource Harbor-Pages/Project_Elements.robot
Resource Harbor-Pages/Project-Members.robot Resource Harbor-Pages/Project-Members.robot
Resource Harbor-Pages/Project-Members_Elements.robot Resource Harbor-Pages/Project-Members_Elements.robot
Resource Harbor-Pages/Project-Webhooks.robot Resource Harbor-Pages/Project-Webhooks.robot
Resource Harbor-Pages/Project-Webhooks_Elements.robot Resource Harbor-Pages/Project-Webhooks_Elements.robot
Resource Harbor-Pages/Project-Repository.robot Resource Harbor-Pages/Project-Repository.robot
Resource Harbor-Pages/Project-Repository_Elements.robot Resource Harbor-Pages/Project-Repository_Elements.robot
Resource Harbor-Pages/Project-Artifact.robot Resource Harbor-Pages/Project-Artifact.robot
Resource Harbor-Pages/Project-Artifact-Elements.robot Resource Harbor-Pages/Project-Artifact-Elements.robot
Resource Harbor-Pages/Project-Config.robot Resource Harbor-Pages/Project-Config.robot
Resource Harbor-Pages/Project-Config-Elements.robot Resource Harbor-Pages/Project-Config-Elements.robot
Resource Harbor-Pages/Project-Helmcharts.robot Resource Harbor-Pages/Project-Helmcharts.robot
Resource Harbor-Pages/Project-Helmcharts_Elements.robot Resource Harbor-Pages/Project-Helmcharts_Elements.robot
Resource Harbor-Pages/Project-Copy.robot Resource Harbor-Pages/Project-Copy.robot
Resource Harbor-Pages/Project-Copy-Elements.robot Resource Harbor-Pages/Project-Copy-Elements.robot
Resource Harbor-Pages/Project-Tag-Retention.robot Resource Harbor-Pages/Project-Tag-Retention.robot
Resource Harbor-Pages/Project-Tag-Retention_Elements.robot Resource Harbor-Pages/Project-Tag-Retention_Elements.robot
Resource Harbor-Pages/Project_Robot_Account.robot Resource Harbor-Pages/Project_Robot_Account.robot
Resource Harbor-Pages/Project_Robot_Account_Elements.robot Resource Harbor-Pages/Project_Robot_Account_Elements.robot
Resource Harbor-Pages/Replication.robot Resource Harbor-Pages/Replication.robot
Resource Harbor-Pages/Replication_Elements.robot Resource Harbor-Pages/Replication_Elements.robot
Resource Harbor-Pages/UserProfile.robot Resource Harbor-Pages/UserProfile.robot
Resource Harbor-Pages/UserProfile_Elements.robot Resource Harbor-Pages/UserProfile_Elements.robot
Resource Harbor-Pages/Administration-Users.robot Resource Harbor-Pages/Administration-Users.robot
Resource Harbor-Pages/Administration-Users_Elements.robot Resource Harbor-Pages/Administration-Users_Elements.robot
Resource Harbor-Pages/GC.robot Resource Harbor-Pages/GC.robot
Resource Harbor-Pages/Configuration.robot Resource Harbor-Pages/Configuration.robot
Resource Harbor-Pages/Configuration_Elements.robot Resource Harbor-Pages/Configuration_Elements.robot
Resource Harbor-Pages/ToolKit.robot Resource Harbor-Pages/ToolKit.robot
Resource Harbor-Pages/ToolKit_Elements.robot Resource Harbor-Pages/ToolKit_Elements.robot
Resource Harbor-Pages/Vulnerability.robot Resource Harbor-Pages/Vulnerability.robot
Resource Harbor-Pages/Vulnerability_Elements.robot Resource Harbor-Pages/Vulnerability_Elements.robot
Resource Harbor-Pages/LDAP-Mode.robot Resource Harbor-Pages/LDAP-Mode.robot
Resource Harbor-Pages/OIDC_Auth.robot Resource Harbor-Pages/OIDC_Auth.robot
Resource Harbor-Pages/OIDC_Auth_Elements.robot Resource Harbor-Pages/OIDC_Auth_Elements.robot
Resource Harbor-Pages/Verify.robot Resource Harbor-Pages/Verify.robot
Resource Docker-Util.robot Resource Docker-Util.robot
Resource CNAB_Util.robot Resource CNAB_Util.robot
Resource Helm-Util.robot Resource Helm-Util.robot
Resource OVA-Util.robot Resource OVA-Util.robot
Resource Cert-Util.robot Resource Cert-Util.robot
Resource SeleniumUtil.robot Resource SeleniumUtil.robot
Resource Nightly-Util.robot Resource Nightly-Util.robot
Resource APITest-Util.robot Resource APITest-Util.robot
Resource TestCaseBody.robot Resource TestCaseBody.robot
*** Keywords *** *** Keywords ***
Wait Until Element Is Visible And Enabled Wait Until Element Is Visible And Enabled
[Arguments] ${element} [Arguments] ${element}
Wait Until Element Is Visible ${element} Wait Until Element Is Visible ${element}
Wait Until Element Is Enabled ${element} Wait Until Element Is Enabled ${element}
Retry Action Keyword Retry Action Keyword
[Arguments] ${keyword} @{param} [Arguments] ${keyword} @{param}
Retry Keyword When Error ${keyword} @{param} Retry Keyword N Times When Error 3 ${keyword} @{param}
Retry Wait Element Retry Wait Element
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Element Is Visible And Enabled @{param} Retry Action Keyword Wait Until Element Is Visible And Enabled @{param}
Retry Wait Element Visible Retry Wait Element Visible
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Element Is Visible @{param} Retry Action Keyword Wait Until Element Is Visible @{param}
Retry Wait Element Not Visible Retry Wait Element Not Visible
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Element Is Not Visible @{param} Retry Action Keyword Wait Until Element Is Not Visible @{param}
Retry Wait Element Should Be Disabled Retry Wait Element Should Be Disabled
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Element Should Be Disabled @{param} Retry Action Keyword Element Should Be Disabled @{param}
Retry Element Click Retry Element Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Element Click @{param} Retry Action Keyword Element Click @{param}
Retry Button Click Retry Button Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Button Click @{param} Retry Action Keyword Button Click @{param}
Retry Text Input Retry Text Input
[Arguments] ${element_xpath} ${text} [Arguments] ${element_xpath} ${text}
@{param} Create List ${element_xpath} ${text} @{param} Create List ${element_xpath} ${text}
Retry Action Keyword Text Input @{param} Retry Action Keyword Text Input @{param}
Retry Clear Element Text Retry Clear Element Text
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Clear Element Text @{param} Retry Action Keyword Clear Element Text @{param}
Retry Link Click Retry Link Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Link Click @{param} Retry Action Keyword Link Click @{param}
Retry Checkbox Should Be Selected Retry Checkbox Should Be Selected
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Checkbox Should Be Selected @{param} Retry Action Keyword Checkbox Should Be Selected @{param}
Retry Checkbox Should Not Be Selected Retry Checkbox Should Not Be Selected
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Checkbox Should Not Be Selected @{param} Retry Action Keyword Checkbox Should Not Be Selected @{param}
Retry Wait Until Page Contains Retry Wait Until Page Contains
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Page Contains @{param} Retry Action Keyword Wait Until Page Contains @{param}
Retry Wait Until Page Contains Element Retry Wait Until Page Contains Element
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Page Contains Element @{param} Retry Action Keyword Wait Until Page Contains Element @{param}
Retry Wait Until Page Not Contains Element Retry Wait Until Page Not Contains Element
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
@{param} Create List ${element_xpath} @{param} Create List ${element_xpath}
Retry Action Keyword Wait Until Page Does Not Contain Element @{param} Retry Action Keyword Wait Until Page Does Not Contain Element @{param}
Retry Select Object Retry Select Object
[Arguments] ${obj_name} [Arguments] ${obj_name}
@{param} Create List ${obj_name} @{param} Create List ${obj_name}
Retry Action Keyword Select Object @{param} Retry Action Keyword Select Object @{param}
Retry Textfield Value Should Be Retry Textfield Value Should Be
[Arguments] ${element} ${text} [Arguments] ${element} ${text}
@{param} Create List ${element} ${text} @{param} Create List ${element} ${text}
Retry Action Keyword Wait And Textfield Value Should Be @{param} Retry Action Keyword Wait And Textfield Value Should Be @{param}
Retry List Selection Should Be Retry List Selection Should Be
[Arguments] ${element} ${text} [Arguments] ${element} ${text}
@{param} Create List ${element} ${text} @{param} Create List ${element} ${text}
Retry Action Keyword Wait And List Selection Should Be @{param} Retry Action Keyword Wait And List Selection Should Be @{param}
Link Click Link Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
Click Link ${element_xpath} Click Link ${element_xpath}
Wait And List Selection Should Be Wait And List Selection Should Be
[Arguments] ${element} ${text} [Arguments] ${element} ${text}
Wait Until Element Is Visible And Enabled ${element} Wait Until Element Is Visible And Enabled ${element}
List Selection Should Be ${element} ${text} List Selection Should Be ${element} ${text}
Wait And Textfield Value Should Be Wait And Textfield Value Should Be
[Arguments] ${element} ${text} [Arguments] ${element} ${text}
Wait Until Element Is Visible And Enabled ${element} Wait Until Element Is Visible And Enabled ${element}
Textfield Value Should Be ${element} ${text} Textfield Value Should Be ${element} ${text}
Element Click Element Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
Wait Until Element Is Visible And Enabled ${element_xpath} Wait Until Element Is Visible And Enabled ${element_xpath}
Click Element ${element_xpath} Click Element ${element_xpath}
Sleep 1 Sleep 1
Button Click Button Click
[Arguments] ${element_xpath} [Arguments] ${element_xpath}
Wait Until Element Is Visible And Enabled ${element_xpath} Wait Until Element Is Visible And Enabled ${element_xpath}
Click button ${element_xpath} Click button ${element_xpath}
Text Input Text Input
[Arguments] ${element_xpath} ${text} [Arguments] ${element_xpath} ${text}
Wait Until Element Is Visible And Enabled ${element_xpath} Wait Until Element Is Visible And Enabled ${element_xpath}
Input Text ${element_xpath} ${text} Input Text ${element_xpath} ${text}
Clear Field Of Characters Clear Field Of Characters
[Arguments] ${field} ${character count} [Arguments] ${field} ${character count}
[Documentation] This keyword pushes the delete key (ascii: \8) a specified number of times in a specified field. [Documentation] This keyword pushes the delete key (ascii: \8) a specified number of times in a specified field.
: FOR ${index} IN RANGE ${character count} : FOR ${index} IN RANGE ${character count}
\ Press Keys ${field} \\8 \ Press Keys ${field} \\8
Wait Unitl Command Success Wait Unitl Command Success
[Arguments] ${cmd} ${times}=8 [Arguments] ${cmd} ${times}=8
:FOR ${n} IN RANGE 1 ${times} :FOR ${n} IN RANGE 1 ${times}
\ Log Trying ${cmd}: ${n} ... console=True \ Log Trying ${cmd}: ${n} ... console=True
\ ${rc} ${output}= Run And Return Rc And Output ${cmd} \ ${rc} ${output}= Run And Return Rc And Output ${cmd}
\ Exit For Loop If '${rc}'=='0' \ Exit For Loop If '${rc}'=='0'
\ Sleep 2 \ Sleep 2
Log Command Result is ${output} Log Command Result is ${output}
Should Be Equal As Strings '${rc}' '0' Should Be Equal As Strings '${rc}' '0'
[Return] ${output} [Return] ${output}
Command Should be Failed Command Should be Failed
[Arguments] ${cmd} [Arguments] ${cmd}
${rc} ${output}= Run And Return Rc And Output ${cmd} ${rc} ${output}= Run And Return Rc And Output ${cmd}
Should Not Be Equal As Strings '${rc}' '0' Should Not Be Equal As Strings '${rc}' '0'
[Return] ${output} [Return] ${output}
Retry Keyword When Error Retry Keyword N Times When Error
[Arguments] ${keyword} @{elements} [Arguments] ${times} ${keyword} @{elements}
:For ${n} IN RANGE 1 10 :For ${n} IN RANGE 1 ${times}
\ Log To Console Trying ${keyword} elements @{elements} ${n} times ... \ Log To Console Trying ${keyword} elements @{elements} ${n} times ...
\ ${out} Run Keyword And Ignore Error ${keyword} @{elements} \ ${out} Run Keyword And Ignore Error ${keyword} @{elements}
\ Log To Console Return value is ${out} and ${out[0]} \ Log To Console Return value is ${out} and ${out[0]}
\ Run Keyword If '${keyword}'=='Make Swagger Client' Exit For Loop If '${out[0]}'=='PASS' and '${out[1]}'=='0' \ Run Keyword If '${keyword}'=='Make Swagger Client' Exit For Loop If '${out[0]}'=='PASS' and '${out[1]}'=='0'
\ ... ELSE Exit For Loop If '${out[0]}'=='PASS' \ ... ELSE Exit For Loop If '${out[0]}'=='PASS'
\ Sleep 10 \ Sleep 10
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot
Should Be Equal As Strings '${out[0]}' 'PASS' Should Be Equal As Strings '${out[0]}' 'PASS'
[Return] ${out[1]} [Return] ${out[1]}
Retry Keyword N Times When Error Retry Keyword When Return Value Mismatch
[Arguments] ${times} ${keyword} @{elements} [Arguments] ${keyword} ${expected_value} ${count} @{elements}
:For ${n} IN RANGE 1 ${times} :For ${n} IN RANGE 1 ${count}
\ Log To Console Trying ${keyword} elements @{elements} ${n} times ... \ Log To Console Trying ${keyword} ${n} times ...
\ ${out} Run Keyword And Ignore Error ${keyword} @{elements} \ ${out} Run Keyword And Ignore Error ${keyword} @{elements}
\ Log To Console Return value is ${out} and ${out[0]} \ Log To Console Return value is ${out[1]}
\ Run Keyword If '${keyword}'=='Make Swagger Client' Exit For Loop If '${out[0]}'=='PASS' and '${out[1]}'=='0' \ ${status}= Set Variable If '${out[1]}'=='${expected_value}' 'PASS' 'FAIL'
\ ... ELSE Exit For Loop If '${out[0]}'=='PASS' \ Exit For Loop If '${out[1]}'=='${expected_value}'
\ Sleep 10 \ Sleep 2
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Run Keyword If ${status}=='FAIL' Capture Page Screenshot
Should Be Equal As Strings '${out[0]}' 'PASS' Should Be Equal As Strings ${status} 'PASS'
[Return] ${out[1]}
Retry Double Keywords When Error
Retry Keyword When Return Value Mismatch [Arguments] ${keyword1} ${element1} ${keyword2} ${element2} ${DoAssert}=${true} ${times}=3
[Arguments] ${keyword} ${expected_value} ${count} @{elements} :For ${n} IN RANGE 1 ${times}
:For ${n} IN RANGE 1 ${count} \ Log To Console Trying ${keyword1} and ${keyword2} ${n} times ...
\ Log To Console Trying ${keyword} ${n} times ... \ ${out1} Run Keyword And Ignore Error ${keyword1} ${element1}
\ ${out} Run Keyword And Ignore Error ${keyword} @{elements} \ Capture Page Screenshot
\ Log To Console Return value is ${out[1]} \ Sleep 1
\ ${status}= Set Variable If '${out[1]}'=='${expected_value}' 'PASS' 'FAIL' \ ${out2} Run Keyword And Ignore Error ${keyword2} ${element2}
\ Exit For Loop If '${out[1]}'=='${expected_value}' \ Capture Page Screenshot
\ Sleep 2 \ Log To Console Return value is ${out1[0]} ${out2[0]}
Run Keyword If ${status}=='FAIL' Capture Page Screenshot \ Exit For Loop If '${out2[0]}'=='PASS'
Should Be Equal As Strings ${status} 'PASS' \ Sleep 1
Return From Keyword If ${DoAssert} == ${false} '${out2[0]}'
Retry Double Keywords When Error Should Be Equal As Strings '${out2[0]}' 'PASS'
[Arguments] ${keyword1} ${element1} ${keyword2} ${element2} ${DoAssert}=${true} ${times}=3
:For ${n} IN RANGE 1 ${times} Run Curl And Return Json
\ Log To Console Trying ${keyword1} and ${keyword2} ${n} times ... [Arguments] ${curl_cmd}
\ ${out1} Run Keyword And Ignore Error ${keyword1} ${element1} ${json_data_file}= Set Variable ${CURDIR}${/}cur_user_info.json
\ Capture Page Screenshot ${rc} ${output}= Run And Return Rc And Output ${curl_cmd}
\ Sleep 1 Should Be Equal As Integers 0 ${rc}
\ ${out2} Run Keyword And Ignore Error ${keyword2} ${element2} Create File ${json_data_file} ${output}
\ Capture Page Screenshot ${json}= Load Json From File ${json_data_file}
\ Log To Console Return value is ${out1[0]} ${out2[0]} [Return] ${json}
\ Exit For Loop If '${out2[0]}'=='PASS'
\ Sleep 1
Return From Keyword If ${DoAssert} == ${false} '${out2[0]}'
Should Be Equal As Strings '${out2[0]}' 'PASS'
Run Curl And Return Json
[Arguments] ${curl_cmd}
${json_data_file}= Set Variable ${CURDIR}${/}cur_user_info.json
${rc} ${output}= Run And Return Rc And Output ${curl_cmd}
Should Be Equal As Integers 0 ${rc}
Create File ${json_data_file} ${output}
${json}= Load Json From File ${json_data_file}
[Return] ${json}

View File

@ -611,8 +611,7 @@ Test Case - Push Docker Manifest Index and Display
Go Into Project test${d} Go Into Project test${d}
Wait Until Page Contains test${d}/index${d} Wait Until Page Contains test${d}/index${d}
Go Into Repo test${d}/index${d} Go Into Repo test${d}/index${d}
Retry Double Keywords When Error Go Into Index index_name=${null} Page Should Contain Element ${tag_table_column_os_arch} Go Into Index And Contain Artifacts index_tag${d} limit=2
Page Should Contain Element ${artifact_rows} limit=2
Close Browser Close Browser
Test Case - Push CNAB Bundle and Display Test Case - Push CNAB Bundle and Display
@ -633,8 +632,7 @@ Test Case - Push CNAB Bundle and Display
Go Into Project test${d} Go Into Project test${d}
Wait Until Page Contains test${d}/cnab${d} Wait Until Page Contains test${d}/cnab${d}
Go Into Repo test${d}/cnab${d} Go Into Repo test${d}/cnab${d}
Retry Double Keywords When Error Go Into Index index_name=${null} Page Should Contain Element ${tag_table_column_os_arch} Go Into Index And Contain Artifacts cnab_tag${d} limit=3
Page Should Contain Element ${artifact_rows} limit=3
Close Browser Close Browser
Test Case - Push Helm Chart and Display Test Case - Push Helm Chart and Display

View File

@ -1,91 +1,91 @@
// Copyright Project Harbor Authors // Copyright Project Harbor Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
*** Settings *** *** Settings ***
Documentation Harbor BATs Documentation Harbor BATs
Resource ../../resources/Util.robot Resource ../../resources/Util.robot
Default Tags Nightly Default Tags Nightly
*** Variables *** *** Variables ***
${HARBOR_URL} https://${OIDC_HOSTNAME} ${HARBOR_URL} https://${OIDC_HOSTNAME}
${HARBOR_ADMIN} admin ${HARBOR_ADMIN} admin
*** Test Cases *** *** Test Cases ***
Test Case - Get Harbor Version Test Case - Get Harbor Version
#Just get harbor version and log it #Just get harbor version and log it
Get Harbor Version Get Harbor Version
Test Case - OIDC User Sign In Test Case - OIDC User Sign In
#Sign in with all 9 users is for user population, other test cases might use these users. #Sign in with all 9 users is for user population, other test cases might use these users.
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test2 Sign In Harbor With OIDC User ${HARBOR_URL} test2
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test3 Sign In Harbor With OIDC User ${HARBOR_URL} test3
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test4 Sign In Harbor With OIDC User ${HARBOR_URL} test4
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test5 Sign In Harbor With OIDC User ${HARBOR_URL} test5
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test6 Sign In Harbor With OIDC User ${HARBOR_URL} test6
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test7 Sign In Harbor With OIDC User ${HARBOR_URL} test7
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test8 Sign In Harbor With OIDC User ${HARBOR_URL} test8
Sleep 2 Sleep 2
Sign In Harbor With OIDC User ${HARBOR_URL} test9 Sign In Harbor With OIDC User ${HARBOR_URL} test9
Sleep 2 Sleep 2
Close Browser Close Browser
Test Case - Create An New Project Test Case - Create An New Project
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Create An New Project And Go Into Project test${d} Create An New Project And Go Into Project test${d}
Close Browser Close Browser
Test Case - Delete A Project Test Case - Delete A Project
Init Chrome Driver Init Chrome Driver
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
${secret}= Get Secrete By API ${HARBOR_URL} ${secret}= Get Secrete By API ${HARBOR_URL}
Delete A Project Without Sign In Harbor harbor_ip=${OIDC_HOSTNAME} username=${OIDC_USERNAME} password=${secret} Delete A Project Without Sign In Harbor harbor_ip=${OIDC_HOSTNAME} username=${OIDC_USERNAME} password=${secret}
Close Browser Close Browser
Test Case - Manage Project Member Test Case - Manage Project Member
Init Chrome Driver Init Chrome Driver
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
${secret}= Get Secrete By API ${HARBOR_URL} ${secret}= Get Secrete By API ${HARBOR_URL}
Manage Project Member Without Sign In Harbor sign_in_user=${OIDC_USERNAME} sign_in_pwd=${secret} test_user1=test2 test_user2=test3 is_oidc_mode=${true} Manage Project Member Without Sign In Harbor sign_in_user=${OIDC_USERNAME} sign_in_pwd=${secret} test_user1=test2 test_user2=test3 is_oidc_mode=${true}
Close Browser Close Browser
Test Case - Generate User CLI Secret Test Case - Generate User CLI Secret
Init Chrome Driver Init Chrome Driver
${d}= Get current Date result_format=%m%s ${d}= Get current Date result_format=%m%s
${image}= Set Variable hello-world ${image}= Set Variable hello-world
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
${secret_old}= Get Secrete By API ${HARBOR_URL} ${secret_old}= Get Secrete By API ${HARBOR_URL}
Push image ip=${ip} user=${OIDC_USERNAME} pwd=${secret_old} project=project${d} image=${image} Push image ip=${ip} user=${OIDC_USERNAME} pwd=${secret_old} project=project${d} image=${image}
${secret_new}= Generate And Return Secret ${HARBOR_URL} ${secret_new}= Generate And Return Secret ${HARBOR_URL}
Log To Console ${secret_old} Log To Console ${secret_old}
Log To Console ${secret_new} Log To Console ${secret_new}
Should Not Be Equal As Strings '${secret_old}' '${secret_new}' Should Not Be Equal As Strings '${secret_old}' '${secret_new}'
Cannot Docker Login Harbor ${ip} ${OIDC_USERNAME} ${secret_old} Cannot Docker Login Harbor ${ip} ${OIDC_USERNAME} ${secret_old}
Pull image ${ip} ${OIDC_USERNAME} ${secret_new} project${d} ${image} Pull image ${ip} ${OIDC_USERNAME} ${secret_new} project${d} ${image}
Push image ${ip} ${OIDC_USERNAME} ${secret_new} project${d} ${image} Push image ${ip} ${OIDC_USERNAME} ${secret_new} project${d} ${image}
Test Case - Helm CLI Push Test Case - Helm CLI Push
Init Chrome Driver Init Chrome Driver
Sign In Harbor With OIDC User ${HARBOR_URL} Sign In Harbor With OIDC User ${HARBOR_URL}
${secret}= Get Secrete By API ${HARBOR_URL} ${secret}= Get Secrete By API ${HARBOR_URL}
Helm CLI Push Without Sign In Harbor ${OIDC_USERNAME} ${secret} Helm CLI Push Without Sign In Harbor ${OIDC_USERNAME} ${secret}

View File

@ -1,275 +1,275 @@
// Copyright Project Harbor Authors // Copyright Project Harbor Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
*** Settings *** *** Settings ***
Documentation Harbor BATs Documentation Harbor BATs
Library ../../apitests/python/library/Harbor.py ${SERVER_CONFIG} Library ../../apitests/python/library/Harbor.py ${SERVER_CONFIG}
Resource ../../resources/Util.robot Resource ../../resources/Util.robot
Default Tags Replication Default Tags Replication
*** Variables *** *** Variables ***
${HARBOR_URL} https://${ip} ${HARBOR_URL} https://${ip}
${SSH_USER} root ${SSH_USER} root
${HARBOR_ADMIN} admin ${HARBOR_ADMIN} admin
${SERVER} ${ip} ${SERVER} ${ip}
${SERVER_URL} https://${SERVER} ${SERVER_URL} https://${SERVER}
${SERVER_API_ENDPOINT} ${SERVER_URL}/api ${SERVER_API_ENDPOINT} ${SERVER_URL}/api
&{SERVER_CONFIG} endpoint=${SERVER_API_ENDPOINT} verify_ssl=False &{SERVER_CONFIG} endpoint=${SERVER_API_ENDPOINT} verify_ssl=False
${REMOTE_SERVER} ${ip1} ${REMOTE_SERVER} ${ip1}
${REMOTE_SERVER_URL} https://${REMOTE_SERVER} ${REMOTE_SERVER_URL} https://${REMOTE_SERVER}
${REMOTE_SERVER_API_ENDPOINT} ${REMOTE_SERVER_URL}/api ${REMOTE_SERVER_API_ENDPOINT} ${REMOTE_SERVER_URL}/api
*** Test Cases *** *** Test Cases ***
Test Case - Get Harbor Version Test Case - Get Harbor Version
#Just get harbor version and log it #Just get harbor version and log it
Get Harbor Version Get Harbor Version
Test Case - Pro Replication Rules Add Test Case - Pro Replication Rules Add
Init Chrome Driver Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Capture Page Screenshot Capture Page Screenshot
Switch To Replication Manage Switch To Replication Manage
Check New Rule UI Without Endpoint Check New Rule UI Without Endpoint
Close Browser Close Browser
Test Case - Harbor Endpoint Verification Test Case - Harbor Endpoint Verification
#This case need vailid info and selfsign cert #This case need vailid info and selfsign cert
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Create A New Endpoint harbor edp1${d} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} N Create A New Endpoint harbor edp1${d} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} N
Endpoint Is Pingable Endpoint Is Pingable
Enable Certificate Verification Enable Certificate Verification
Endpoint Is Unpingable Endpoint Is Unpingable
Close Browser Close Browser
Test Case - DockerHub Endpoint Add Test Case - DockerHub Endpoint Add
#This case need vailid info and selfsign cert #This case need vailid info and selfsign cert
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Create A New Endpoint docker-hub edp1${d} https://hub.docker.com/ danfengliu Aa123456 Y Create A New Endpoint docker-hub edp1${d} https://hub.docker.com/ danfengliu Aa123456 Y
Close Browser Close Browser
Test Case - Harbor Endpoint Add Test Case - Harbor Endpoint Add
#This case need vailid info and selfsign cert #This case need vailid info and selfsign cert
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Create A New Endpoint harbor testabc https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Y Create A New Endpoint harbor testabc https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Y
Close Browser Close Browser
Test Case - Harbor Endpoint Edit Test Case - Harbor Endpoint Edit
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Rename Endpoint testabc deletea Rename Endpoint testabc deletea
Retry Wait Until Page Contains deletea Retry Wait Until Page Contains deletea
Close Browser Close Browser
Test Case - Harbor Endpoint Delete Test Case - Harbor Endpoint Delete
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Delete Endpoint deletea Delete Endpoint deletea
Delete Success deletea Delete Success deletea
Close Browser Close Browser
Test Case - Replication Rule Edit Test Case - Replication Rule Edit
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${endpoint1}= Set Variable e1${d} ${endpoint1}= Set Variable e1${d}
${endpoint2}= Set Variable e2${d} ${endpoint2}= Set Variable e2${d}
${rule_name_old}= Set Variable rule_testabc${d} ${rule_name_old}= Set Variable rule_testabc${d}
${rule_name_new}= Set Variable rule_abctest${d} ${rule_name_new}= Set Variable rule_abctest${d}
${resource_type}= Set Variable chart ${resource_type}= Set Variable chart
${dest_namespace}= Set Variable dest_namespace${d} ${dest_namespace}= Set Variable dest_namespace${d}
${mode}= Set Variable Scheduled ${mode}= Set Variable Scheduled
${cron_str}= Set Variable 10 10 10 * * * ${cron_str}= Set Variable 10 10 10 * * *
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Create A New Endpoint docker-hub ${endpoint1} https://hub.docker.com/ danfengliu Aa123456 Y Create A New Endpoint docker-hub ${endpoint1} https://hub.docker.com/ danfengliu Aa123456 Y
Create A New Endpoint harbor ${endpoint2} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Y Create A New Endpoint harbor ${endpoint2} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Y
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint ${rule_name_old} pull danfengliu/* image ${endpoint1} project${d} Create A Rule With Existing Endpoint ${rule_name_old} pull danfengliu/* image ${endpoint1} project${d}
Edit Replication Rule By Name ${rule_name_old} Edit Replication Rule By Name ${rule_name_old}
# Change rule-name, source-registry, filter, trigger-mode for edition verification # Change rule-name, source-registry, filter, trigger-mode for edition verification
Clear Field Of Characters ${rule_name_input} 30 Clear Field Of Characters ${rule_name_input} 30
Retry Text Input ${rule_name_input} ${rule_name_new} Retry Text Input ${rule_name_input} ${rule_name_new}
Select Source Registry ${endpoint2} Select Source Registry ${endpoint2}
#Source Resource Filter #Source Resource Filter
Retry Text Input ${source_project} project${d} Retry Text Input ${source_project} project${d}
Select From List By Value ${rule_resource_selector} ${resource_type} Select From List By Value ${rule_resource_selector} ${resource_type}
Retry Text Input ${dest_namespace_xpath} ${dest_namespace} Retry Text Input ${dest_namespace_xpath} ${dest_namespace}
Select Trigger ${mode} Select Trigger ${mode}
Retry Text Input ${targetCron_id} ${cron_str} Retry Text Input ${targetCron_id} ${cron_str}
Retry Double Keywords When Error Retry Element Click ${rule_save_button} Retry Wait Until Page Not Contains Element ${rule_save_button} Retry Double Keywords When Error Retry Element Click ${rule_save_button} Retry Wait Until Page Not Contains Element ${rule_save_button}
# verify all items were changed as expected # verify all items were changed as expected
Edit Replication Rule By Name ${rule_name_new} Edit Replication Rule By Name ${rule_name_new}
Retry Textfield Value Should Be ${rule_name_input} ${rule_name_new} Retry Textfield Value Should Be ${rule_name_input} ${rule_name_new}
Retry List Selection Should Be ${src_registry_dropdown_list} ${endpoint2}-https://${ip} Retry List Selection Should Be ${src_registry_dropdown_list} ${endpoint2}-https://${ip}
Retry Textfield Value Should Be ${source_project} project${d} Retry Textfield Value Should Be ${source_project} project${d}
Retry Textfield Value Should Be ${dest_namespace_xpath} ${dest_namespace} Retry Textfield Value Should Be ${dest_namespace_xpath} ${dest_namespace}
Retry List Selection Should Be ${rule_resource_selector} ${resource_type} Retry List Selection Should Be ${rule_resource_selector} ${resource_type}
Retry List Selection Should Be ${rule_trigger_select} ${mode} Retry List Selection Should Be ${rule_trigger_select} ${mode}
Retry Textfield Value Should Be ${targetCron_id} ${cron_str} Retry Textfield Value Should Be ${targetCron_id} ${cron_str}
Retry Element Click ${rule_cancel_btn} Retry Element Click ${rule_cancel_btn}
Ensure Delete Replication Rule By Name ${rule_name_new} Ensure Delete Replication Rule By Name ${rule_name_new}
Close Browser Close Browser
Test Case - Replication Rule Delete Test Case - Replication Rule Delete
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
${endpoint1}= Set Variable e1${d} ${endpoint1}= Set Variable e1${d}
${rule_name}= Set Variable rule_testabc${d} ${rule_name}= Set Variable rule_testabc${d}
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries Switch To Registries
Create A New Endpoint docker-hub ${endpoint1} https://hub.docker.com/ danfengliu Aa123456 Y Create A New Endpoint docker-hub ${endpoint1} https://hub.docker.com/ danfengliu Aa123456 Y
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint ${rule_name} pull danfengliu/* image ${endpoint1} project${d} Create A Rule With Existing Endpoint ${rule_name} pull danfengliu/* image ${endpoint1} project${d}
Ensure Delete Replication Rule By Name ${rule_name} Ensure Delete Replication Rule By Name ${rule_name}
Close Browser Close Browser
Test Case - Replication Of Pull Images from DockerHub To Self Test Case - Replication Of Pull Images from DockerHub To Self
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Registries Switch To Registries
Create A New Endpoint docker-hub e${d} https://hub.docker.com/ danfengliu Aa123456 Y Create A New Endpoint docker-hub e${d} https://hub.docker.com/ danfengliu Aa123456 Y
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} pull danfengliu/* image e${d} project${d} Create A Rule With Existing Endpoint rule${d} pull danfengliu/* image e${d} project${d}
Select Rule And Replicate rule${d} Select Rule And Replicate rule${d}
#In docker-hub, under repository danfengliu, there're only 2 images: centos,mariadb. #In docker-hub, under repository danfengliu, there're only 2 images: centos,mariadb.
Image Should Be Replicated To Project project${d} centos Image Should Be Replicated To Project project${d} centos
Image Should Be Replicated To Project project${d} mariadb Image Should Be Replicated To Project project${d} mariadb
Close Browser Close Browser
Test Case - Replication Of Push Images from Self To Harbor Test Case - Replication Of Push Images from Self To Harbor
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} busybox:latest Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} busybox:latest
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world v1 Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world v1
Switch To Registries Switch To Registries
Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} project_dest${d} Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} project_dest${d}
#logout and login target #logout and login target
Logout Harbor Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project_dest${d} Create An New Project And Go Into Project project_dest${d}
#logout and login source #logout and login source
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Replication Manage Switch To Replication Manage
Select Rule And Replicate rule${d} Select Rule And Replicate rule${d}
Sleep 20 Sleep 20
Logout Harbor Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Image Should Be Replicated To Project project_dest${d} hello-world Image Should Be Replicated To Project project_dest${d} hello-world
Image Should Be Replicated To Project project_dest${d} busybox Image Should Be Replicated To Project project_dest${d} busybox
Close Browser Close Browser
Test Case - Replication Of Push Chart from Self To Harbor Test Case - Replication Of Push Chart from Self To Harbor
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Project Charts Switch To Project Charts
Upload Chart files Upload Chart files
Switch To Registries Switch To Registries
Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} push project${d}/* chart e${d} project_dest${d} Create A Rule With Existing Endpoint rule${d} push project${d}/* chart e${d} project_dest${d}
#logout and login target #logout and login target
Logout Harbor Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project_dest${d} Create An New Project And Go Into Project project_dest${d}
#logout and login source #logout and login source
Logout Harbor Logout Harbor
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Replication Manage Switch To Replication Manage
Select Rule And Replicate rule${d} Select Rule And Replicate rule${d}
Sleep 20 Sleep 20
Logout Harbor Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Go Into Project project_dest${d} has_image=${false} Go Into Project project_dest${d} has_image=${false}
Switch To Project Charts Switch To Project Charts
Go Into Chart Version ${harbor_chart_name} Go Into Chart Version ${harbor_chart_name}
Retry Wait Until Page Contains ${harbor_chart_version} Retry Wait Until Page Contains ${harbor_chart_version}
Go Into Chart Detail ${harbor_chart_version} Go Into Chart Detail ${harbor_chart_version}
Close Browser Close Browser
Test Case - Replication Of Push Images from Self To Harbor By Push Event Test Case - Replication Of Push Images from Self To Harbor By Push Event
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Registries Switch To Registries
Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create A New Endpoint harbor e${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} project_dest${d} Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} project_dest${d}
... Event Based ... Event Based
#logout and login target #logout and login target
Logout Harbor Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project_dest${d} Create An New Project And Go Into Project project_dest${d}
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} centos Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} centos
Image Should Be Replicated To Project project_dest${d} centos Image Should Be Replicated To Project project_dest${d} centos
Close Browser Close Browser
Test Case - Replication Of Pull Images from AWS-ECR To Self Test Case - Replication Of Pull Images from AWS-ECR To Self
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Registries Switch To Registries
Create A New Endpoint aws-ecr e${d} us-east-2 ${ecr_ac_id} ${ecr_ac_key} Y Create A New Endpoint aws-ecr e${d} us-east-2 ${ecr_ac_id} ${ecr_ac_key} Y
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} pull a/* image e${d} project${d} Create A Rule With Existing Endpoint rule${d} pull a/* image e${d} project${d}
Select Rule And Replicate rule${d} Select Rule And Replicate rule${d}
Image Should Be Replicated To Project project${d} httpd Image Should Be Replicated To Project project${d} httpd
Image Should Be Replicated To Project project${d} alpine Image Should Be Replicated To Project project${d} alpine
Image Should Be Replicated To Project project${d} hello-world Image Should Be Replicated To Project project${d} hello-world
Close Browser Close Browser
Test Case - Replication Of Pull Images from Google-GCR To Self Test Case - Replication Of Pull Images from Google-GCR To Self
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
#login source #login source
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project${d} Create An New Project And Go Into Project project${d}
Switch To Registries Switch To Registries
Create A New Endpoint google-gcr e${d} asia.gcr.io ${null} ${gcr_ac_key} Y Create A New Endpoint google-gcr e${d} asia.gcr.io ${null} ${gcr_ac_key} Y
Switch To Replication Manage Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} pull eminent-nation-87317/* image e${d} project${d} Create A Rule With Existing Endpoint rule${d} pull eminent-nation-87317/* image e${d} project${d}
Filter Replicatin Rule rule${d} Filter Replicatin Rule rule${d}
Select Rule And Replicate rule${d} Select Rule And Replicate rule${d}
Image Should Be Replicated To Project project${d} httpd Image Should Be Replicated To Project project${d} httpd
Image Should Be Replicated To Project project${d} tomcat Image Should Be Replicated To Project project${d} tomcat
Close Browser Close Browser