diff --git a/tests/resources/Harbor-Pages/Project-Retag.robot b/tests/resources/Harbor-Pages/Project-Retag.robot new file mode 100644 index 000000000..493f1e985 --- /dev/null +++ b/tests/resources/Harbor-Pages/Project-Retag.robot @@ -0,0 +1,16 @@ +Documentation This resource provides any keywords related to the Harbor private registry appliance +Resource ../../resources/Util.robot + +*** Keywords *** + +Retag Image + [Arguments] ${tag} ${projectname} ${reponame} ${tagname} + Click Element xpath=//clr-dg-row[contains(.,"${tag}")]//label + Sleep 1 + Click Element xpath=${retag_btn} + Sleep 1 + #input necessary info + Input Text xpath=${project-name_xpath} ${projectname} + Input Text xpath=${repo-name_xpath} ${reponame} + Input Text xpath=${tag-name_xpath} ${tagname} + Click Element xpath=${confirm_btn} diff --git a/tests/resources/Harbor-Pages/Project-Retag_Elements.robot b/tests/resources/Harbor-Pages/Project-Retag_Elements.robot new file mode 100644 index 000000000..230e4a58c --- /dev/null +++ b/tests/resources/Harbor-Pages/Project-Retag_Elements.robot @@ -0,0 +1,14 @@ +*** Settings *** +Documentation This resource provides any keywords related to the Harbor private registry appliance + +*** Variables *** + +${retag_btn} //clr-dg-action-bar//button[contains(.,'Retag')] +${project-name_xpath} //*[@id='project-name'] +${repo-name_xpath} //*[@id='repo-name'] +${tag-name_xpath} //*[@id='tag-name'] +${confirm_btn} //button[contains(.,'CONFIRM')] +${target_image_name} target-alpine +${target_tag_value} 3.2.10-target +${tag_value_xpath} //clr-dg-row[contains(.,'${target_tag_value}')] +${image_tag} 3.2.10-alpine \ No newline at end of file diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index 5a554be32..558cff865 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -39,6 +39,8 @@ Resource Harbor-Pages/Project-Repository_Elements.robot Resource Harbor-Pages/Project-Config.robot Resource Harbor-Pages/Project-Helmcharts.robot Resource Harbor-Pages/Project-Helmcharts_Elements.robot +Resource Harbor-Pages/Project-Retag.robot +Resource Harbor-Pages/Project-Retag_Elements.robot Resource Harbor-Pages/Replication.robot Resource Harbor-Pages/Replication_Elements.robot Resource Harbor-Pages/UserProfile.robot diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index ca841af92..8a407a905 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -695,4 +695,29 @@ Test Case - Scan Image On Push Go Into Project library Go Into Repo memcached Summary Chart Should Display latest - Close Browser \ No newline at end of file + Close Browser + +Test Case - Retag A Image Tag + Init Chrome Driver + ${random_num1}= Get Current Date result_format=%m%s + ${random_num2}= Evaluate str(random.randint(1000,9999)) modules=random + + Sign In Harbor ${HARBOR_URL} user028 Test1@34 + Create An New Project project${random_num1} + Create An New Project project${random_num2} + + Go Into Project project${random_num1} + Sleep 1 + Push Image With Tag ${ip} user028 Test1@34 project${random_num1} redis ${image_tag} + Sleep 1 + Go Into Repo project${random_num1}/redis + Retag Image ${image_tag} project${random_num2} ${target_image_name} ${target_tag_value} + + Back To projects + Go Into Project project${random_num2} + Sleep 1 + Page Should Contain ${target_image_name} + Go Into Repo project${random_num2}/${target_image_name} + Sleep 1 + Page Should Contain Element xpath=${tag_value_xpath} + Close Browser