From 08a070a1242244038b8349d264db04bdb366d47e Mon Sep 17 00:00:00 2001 From: danfengliu Date: Mon, 23 Mar 2020 11:09:55 +0800 Subject: [PATCH] Modify nightly test case for user view logs and other Signed-off-by: danfengliu --- tests/resources/Harbor-Pages/Project.robot | 13 ++++++++----- .../Harbor-Pages/Project_Elements.robot | 2 +- tests/resources/Harbor-Pages/ToolKit.robot | 17 ++++++++++++++++- tests/robot-cases/Group1-Nightly/Common.robot | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index a17ac467d..62aed20a2 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -160,10 +160,11 @@ Advanced Search Should Display # it's not a common keywords, only used into log case. Do Log Advanced Search Capture Page Screenshot LogAdvancedSearch.png - Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'pull')] - Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'push')] - Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'create')] - Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'delete')] + 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(.,'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(.,'repository') and contains(.,'delete')] Retry Element Click xpath=//audit-log//div[@class='flex-xs-middle']/button Retry Element Click xpath=//project-detail//audit-log//clr-dropdown/button #pull log @@ -247,13 +248,15 @@ Add Labels To Tag Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label Capture Page Screenshot add_${labelName}.png Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//span - Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'labels')] + Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'Add labels')] Retry Element Click xpath=//clr-dropdown//div//label[contains(.,'${labelName}')] Retry Wait Until Page Contains Element xpath=//clr-dg-row//label[contains(.,'${labelName}')] Filter Labels In Tags [Arguments] ${labelName1} ${labelName2} Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon + Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select + Retry Element Click xpath=//clr-main-container//artifact-list-tab//clr-select-container//select/option[@value='labels'] Retry Wait Until Page Contains Element xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')] Retry Element Click xpath=//*[@id='filterArea']//div//button[contains(.,'${labelName1}')] Retry Element Click xpath=//*[@id='filterArea']//hbr-filter/span/clr-icon diff --git a/tests/resources/Harbor-Pages/Project_Elements.robot b/tests/resources/Harbor-Pages/Project_Elements.robot index c2642cf9c..1e4e89ba0 100644 --- a/tests/resources/Harbor-Pages/Project_Elements.robot +++ b/tests/resources/Harbor-Pages/Project_Elements.robot @@ -40,7 +40,7 @@ ${repo_retag_confirm_dlg} css=${modal-dialog} ${repo_delete_on_card_view_btn} //clr-modal//button[contains(.,'DELETE')] ${delete_btn} //button[contains(.,'Delete')] ${repo_delete_btn} xpath=//hbr-repository-gridview//button[contains(.,'Delete')] -${project_delete_btn} xpath=//list-project//clr-datagrid//button[contains(.,'Delete')] +${project_delete_btn} xpath=//button[@id='delete-project'] ${tag_delete_btn} xpath=//tag-repository//clr-datagrid//button[contains(.,'Delete')] ${user_delete_btn} xpath=/clr-dropdown-menu//button[contains(.,'Delete')] ${repo_search_icon} xpath=//hbr-filter//clr-icon diff --git a/tests/resources/Harbor-Pages/ToolKit.robot b/tests/resources/Harbor-Pages/ToolKit.robot index 7e6364e10..15e319f93 100644 --- a/tests/resources/Harbor-Pages/ToolKit.robot +++ b/tests/resources/Harbor-Pages/ToolKit.robot @@ -55,8 +55,23 @@ Select Object [Arguments] ${obj} Retry Element Click xpath=//clr-dg-row[contains(.,'${obj}')]//label -# This func cannot support as the delete user flow changed. Multi-delete Object + [Arguments] ${delete_btn} @{obj} + :For ${obj} in @{obj} + \ ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label + \ Retry Element Click ${element} + Sleep 1 + Capture Page Screenshot + Retry Element Click ${delete_btn} + Sleep 1 + Capture Page Screenshot + Retry Element Click ${repo_delete_on_card_view_btn} + Sleep 1 + Capture Page Screenshot + Sleep 1 + +# This func cannot support as the delete user flow changed. +Multi-delete Artifact [Arguments] ${delete_btn} @{obj} :For ${obj} in @{obj} \ ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 44283ac9d..0ef622e34 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -322,7 +322,7 @@ Test Case - Delete Multi Artifacts Go Into Project project${d} Go Into Repo redis @{tag_list} Create List 3.2.10-alpine 4.0.7-alpine - Multi-delete object ${tag_delete_btn} @{tag_list} + Multi-delete Artifact ${tag_delete_btn} @{tag_list} # Verify Delete Success sha256:dd179737 sha256:28a85227 Close Browser