diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot index ee03a1d47..b8b16ae03 100644 --- a/tests/resources/Docker-Util.robot +++ b/tests/resources/Docker-Util.robot @@ -162,6 +162,6 @@ Docker Push Docker Push Index [Arguments] ${ip} ${user} ${pwd} ${index} ${image1} ${image2} - ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/docker_push_manifest_list.sh ${ip} ${user} ${pwd} ${index} ${image1} ${image2} + ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/docker_push_manifest_list.sh ${ip} ${user} ${pwd} ${index} ${image1} ${image2} Log ${output} Should Be Equal As Integers ${rc} 0 diff --git a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot index f08145fc9..390b5f348 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot @@ -1,24 +1,24 @@ -# Copyright Project Harbor Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License - -*** Settings *** -Documentation This resource provides any keywords related to the Harbor private registry appliance - -*** Variables *** -${artifact_action_xpath} //clr-dg-action-bar/clr-dropdown/span[contains(@class,'dropdown-toggle')] -${artifact_action_delete_xpath} //clr-dropdown-menu//div[contains(.,'Delete')] -${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @aria-label='retag'] -${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//clr-icon -${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')] - +# Copyright Project Harbor Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + +*** Settings *** +Documentation This resource provides any keywords related to the Harbor private registry appliance + +*** Variables *** +${artifact_action_xpath} //clr-dg-action-bar/clr-dropdown/span[contains(@class,'dropdown-toggle')] +${artifact_action_delete_xpath} //clr-dropdown-menu//div[contains(.,'Delete')] +${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @aria-label='retag'] +${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//a +${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')] + diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 25d0a4a14..8aa41db8d 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -211,7 +211,8 @@ Go Into Repo Capture Page Screenshot gointo_${repoName}.png Go Into Index - Retry Wait Element ${artifact_achieve_icon} + [Arguments] ${index_name}=${null} + Retry Element Click ${artifact_achieve_icon} Switch To CardView Retry Element Click xpath=//hbr-repository-gridview//span[@class='card-btn']/clr-icon diff --git a/tests/resources/Harbor-Pages/Project_Elements.robot b/tests/resources/Harbor-Pages/Project_Elements.robot index 1e4e89ba0..7c7b43327 100644 --- a/tests/resources/Harbor-Pages/Project_Elements.robot +++ b/tests/resources/Harbor-Pages/Project_Elements.robot @@ -51,6 +51,7 @@ ${repo_list_spinner} xpath=//clr-datagrid//clr-spinner ${repo_tag_1st_checkbox} xpath=//clr-datagrid//clr-dg-row//clr-checkbox-wrapper ${tag_table_column_pull_command} xpath=//clr-dg-column//span[contains(.,'Pull Command')] ${tag_table_column_vulnerabilities} xpath=//clr-dg-column//span[contains(.,'Vulnerabilities')] +${tag_table_column_os_arch} xpath=//clr-dg-column//span[contains(.,'OS/ARCH')] ${tag_table_column_tag} xpath=//clr-dg-column//span[contains(.,'Tag')] ${tag_table_column_size} xpath=//clr-dg-column//span[contains(.,'Size')] ${tag_table_column_vulnerability} xpath=//clr-dg-column//span[contains(.,'Vulnerability')] diff --git a/tests/resources/Helm-Util.robot b/tests/resources/Helm-Util.robot index 546003f12..e06a2646a 100644 --- a/tests/resources/Helm-Util.robot +++ b/tests/resources/Helm-Util.robot @@ -32,4 +32,10 @@ Helm Repo Push ${current_dir}= Run pwd Run cd ${current_dir} Run wget ${harbor_chart_file_url} - Wait Unitl Command Success ${helm_cmd} push --ca-file=/helm_ca/server.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name} \ No newline at end of file + Wait Unitl Command Success ${helm_cmd} push --ca-file=/helm_ca/server.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name} + +Helm Chart Push + [Arguments] ${ip} ${user} ${pwd} ${chart_file} ${archive} ${project} ${repo_name} ${verion} + ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/helm_push_chart.sh ${ip} ${user} ${pwd} ${chart_file} ${archive} ${project} ${repo_name} ${verion} + Log ${output} + Should Be Equal As Integers ${rc} 0 \ No newline at end of file diff --git a/tests/robot-cases/Group0-Util/helm_push_chart.sh b/tests/robot-cases/Group0-Util/helm_push_chart.sh new file mode 100755 index 000000000..7191a637b --- /dev/null +++ b/tests/robot-cases/Group0-Util/helm_push_chart.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +IP=$1 +USER=$2 +PWD=$3 +CHART_FILE=$4 +ARCHIVE=$5 +PROJECT=$6 +REPOSITORY=$7 +VERSION=$8 + +echo $IP + + +export HELM_EXPERIMENTAL_OCI=1 +wget $CHART_FILE +echo "========================" +echo ${CHART_FILE##*/} +echo "========================" +tar xvf ${CHART_FILE##*/} +helm3 registry login $IP -u $USER -p $PWD +helm3 chart save $ARCHIVE $IP/$PROJECT/$REPOSITORY +helm3 chart push $IP/$PROJECT/$REPOSITORY:$VERSION + diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 106e40b00..697f758f8 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -693,7 +693,7 @@ Test Case - Push Docker Manifest Index and Display Go Into Project test${d} Wait Until Page Contains test${d}/index${d} Go Into Repo test${d}/index${d} - Go Into Index + Retry Double Keywords When Error Go Into Index index_name=${null} Page Should Contain Element ${tag_table_column_os_arch} Page Should Contain Element ${artifact_rows} limit=2 Test Case - Push CNAB Bundle and Display @@ -711,3 +711,30 @@ Test Case - Push CNAB Bundle and Display Go Into Repo test${d}/cnab${d} Wait Until Page Contains cnab_tag${d} + Go Into Project test${d} + Wait Until Page Contains 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} + Page Should Contain Element ${artifact_rows} limit=3 + +Test Case - Push Helm Chart and Display + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + ${chart_file}= Set Variable https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz + ${archive}= Set Variable harbor/ + ${verion}= Set Variable 0.2.0 + ${repo_name}= Set Variable harbor_chart_test + + Sign In Harbor ${HARBOR_URL} user010 Test1@34 + Create An New Project test${d} + + Helm Chart Push ${ip} user010 Test1@34 ${chart_file} ${archive} test${d} ${repo_name} ${verion} + + Go Into Project test${d} + Wait Until Page Contains test${d}/${repo_name} + + Go Into Repo test${d}/${repo_name} + Wait Until Page Contains ${repo_name} + Go Into Project test${d} + Wait Until Page Contains test${d}/${repo_name} + Retry Double Keywords When Error Go Into Repo test${d}/${repo_name} Page Should Contain Element ${tag_table_column_vulnerabilities}