diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 12226fcc5..6291e410e 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -63,15 +63,16 @@ Switch To Replication Click Element xpath=${project_replication_xpath} Sleep 1 -Back To projects - Wait Until Element Is Enabled xpath=${projects_xpath} - Wait Until Element Is Visible xpath=${projects_xpath} - Click Element xpath=${projects_xpath} +Back To Projects + ${element}= Set Variable xpath=${projects_xpath} + Wait Until Element Is Visible And Enabled ${element} + Click Element ${element} Sleep 2 Project Should Display [Arguments] ${projectname} - Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')] + ${element}= Set Variable xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')] + Wait Until Element Is Visible And Enabled ${element} Project Should Not Display [Arguments] ${projectname} diff --git a/tests/resources/Harbor-Pages/ToolKit.robot b/tests/resources/Harbor-Pages/ToolKit.robot index 96b4ab971..87da0520d 100644 --- a/tests/resources/Harbor-Pages/ToolKit.robot +++ b/tests/resources/Harbor-Pages/ToolKit.robot @@ -37,27 +37,37 @@ Delete Fail Filter Object #Filter project repo user tag. [Arguments] ${kw} - Click Element xpath=//hbr-filter//clr-icon - Input Text xpath=//hbr-filter//input ${kw} - Sleep 1 + ${element}= Set Variable xpath=//hbr-filter//clr-icon + Wait Until Element Is Visible And Enabled ${element} + Click Element ${element} + ${element}= Set Variable xpath=//hbr-filter//input + Wait Until Element Is Visible And Enabled ${element} + Input Text ${element} ${kw} + Sleep 3 Select Object #select single element such as user project repo tag [Arguments] ${obj} - Click Element //clr-dg-row[contains(.,'${obj}')]//label + ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label + Wait Until Element Is Visible And Enabled ${element} + Click Element ${element} # This func cannot support as the delete user flow changed. Multi-delete Object [Arguments] @{obj} :For ${obj} in @{obj} - \ Click Element //clr-dg-row[contains(.,'${obj}')]//label - Sleep 1 + \ ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label + \ Wait Until Element Is Visible And Enabled ${element} + \ Click Element ${element} + Capture Page Screenshot - Click Element //button[contains(.,'Delete')] - Sleep 2 + ${element}= Set Variable xpath=//button[contains(.,'Delete')] + Wait Until Element Is Visible And Enabled ${element} + Click Element ${element} Capture Page Screenshot - Click Element //clr-modal//button[contains(.,'DELETE')] - Sleep 3 + ${element}= Set Variable xpath=//clr-modal//button[contains(.,'DELETE')] + Wait Until Element Is Visible And Enabled ${element} + Click Element ${element} Capture Page Screenshot Multi-delete User diff --git a/tests/resources/Harbor-Pages/Vulnerability.robot b/tests/resources/Harbor-Pages/Vulnerability.robot index 85392625f..4e4ed5e31 100644 --- a/tests/resources/Harbor-Pages/Vulnerability.robot +++ b/tests/resources/Harbor-Pages/Vulnerability.robot @@ -63,6 +63,9 @@ Enable Scan On Push Sleep 10 Vulnerability Not Ready Project Hint - Page Should Contain Element //span[contains(@class, "db-status-warning")] + ${element}= Set Variable xpath=//span[contains(@class, "db-status-warning")] + Wait Until Element Is Visible And Enabled ${element} + Vulnerability Not Ready Config Hint - Page Should Contain Element //vulnerability-config//clr-tooltip + ${element}= Set Variable xpath=//vulnerability-config//clr-tooltip + Wait Until Element Is Visible And Enabled ${element} diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index 558cff865..bfb2475f6 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -62,6 +62,11 @@ Resource Nightly-Util.robot Resource APITest-Util.robot *** Keywords *** +Wait Until Element Is Visible And Enabled + [Arguments] ${element} + Wait Until Element Is Visible ${element} + Wait Until Element Is Enabled ${element} + Wait Unitl Vul Data Ready [Arguments] ${url} ${timeout} ${interval} ${n}= Evaluate ${timeout}/${interval} diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 19b3fd45e..fcd8b4077 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -83,7 +83,7 @@ Test Case - Delete A Project Project Should Not Be Deleted project${d} Go Into Project project${d} Delete Repo project${d} - Back To projects + Back To Projects Project Should Be Deleted project${d} Close Browser @@ -714,7 +714,7 @@ Test Case - Retag A Image Tag Retag Image ${image_tag} project${random_num2} ${target_image_name} ${target_tag_value} Wait Until Element Is Not Visible css=${modal-dialog} - Back To projects + Back To Projects Go Into Project project${random_num2} Sleep 1 Page Should Contain ${target_image_name} diff --git a/tests/robot-cases/Group1-Nightly/Nightly.robot b/tests/robot-cases/Group1-Nightly/Nightly.robot index ec9db6db1..24d5a7ff5 100644 --- a/tests/robot-cases/Group1-Nightly/Nightly.robot +++ b/tests/robot-cases/Group1-Nightly/Nightly.robot @@ -524,7 +524,7 @@ Test Case - Delete A Project Project Should Not Be Deleted project${d} Go Into Project project${d} Delete Repo project${d} - Back To projects + Back To Projects Project Should Be Deleted project${d} Close Browser