diff --git a/tests/resources/Harbor-Pages/Vulnerability.robot b/tests/resources/Harbor-Pages/Vulnerability.robot index db26be959..f7148c374 100644 --- a/tests/resources/Harbor-Pages/Vulnerability.robot +++ b/tests/resources/Harbor-Pages/Vulnerability.robot @@ -91,3 +91,8 @@ Trivy Is Immutable Scanner Retry Double Keywords When Error Retry Element Click ${scanner_action_xpath} Retry Wait Until Page Contains Element ${delete_scanner_action_xpath} Retry Double Keywords When Error Retry Element Click ${delete_scanner_action_xpath} Retry Wait Until Page Contains Element ${delete_scanner_confirm_btn} Retry Double Keywords When Error Retry Element Click ${delete_scanner_confirm_btn} Retry Wait Until Page Contains Element ${immutable_trivy_msg_xpath} + +Set Default Scanner + [Arguments] ${scanner_name} + Retry Element Click //clr-dg-row[contains(.,'${scanner_name}')]//clr-radio-wrapper/label + Retry Double Keywords When Error Retry Element Click ${scanner_set_default} Retry Wait Until Page Contains Element ${scanner_set_default_success_xpath} diff --git a/tests/resources/Harbor-Pages/Vulnerability_Elements.robot b/tests/resources/Harbor-Pages/Vulnerability_Elements.robot index 35f7cdf92..35765de44 100644 --- a/tests/resources/Harbor-Pages/Vulnerability_Elements.robot +++ b/tests/resources/Harbor-Pages/Vulnerability_Elements.robot @@ -29,5 +29,7 @@ ${immutable_msg_xpath} //span[contains(.,'registration Clair is not allowed to ${immutable_trivy_msg_xpath} //span[contains(.,'registration Trivy is not allowed to delete as it is immutable: scanner API: delete')] ${delete_scanner_confirm_btn} xpath=//clr-modal//button[contains(.,'DELETE')] ${scan_now_result} xpath=//div[@id="scan-result-container"] +${scanner_set_default} xpath=//button[@id="set-default"] +${scanner_set_default_success_xpath} //span[contains(.,'Successfully updated')] diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index 4347c8bf7..05802d4db 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -53,34 +53,19 @@ Body Of Manage project publicity Close Browser Body Of Scan A Tag In The Repo + [Arguments] ${image_argument} ${tag_argument} Init Chrome Driver ${d}= get current date result_format=%m%s Sign In Harbor ${HARBOR_URL} user023 Test1@34 Create An New Project project${d} Go Into Project project${d} has_image=${false} - Push Image ${ip} user023 Test1@34 project${d} hello-world + Push Image ${ip} user023 Test1@34 project${d} ${image_argument}:${tag_argument} Go Into Project project${d} - Go Into Repo project${d}/hello-world - Scan Repo latest Succeed - Summary Chart Should Display latest - Pull Image ${ip} user023 Test1@34 project${d} hello-world - # Edit Repo Info - Close Browser - -Body Of Scan A Tag In The Repo Use Trivy - Init Chrome Driver - ${d}= get current date result_format=%m%s - - Sign In Harbor ${HARBOR_URL} user023 Test1@34 - Create An New Project project${d} - Go Into Project project${d} has_image=${false} - Push Image ${ip} user023 Test1@34 project${d} vmware/photon:1.0 - Go Into Project project${d} - Go Into Repo project${d}/vmware/photon - Scan Repo 1.0 Succeed - Summary Chart Should Display 1.0 - Pull Image ${ip} user023 Test1@34 project${d} vmware/photon 1.0 + Go Into Repo project${d}/${image_argument} + Scan Repo ${tag_argument} Succeed + Summary Chart Should Display ${tag_argument} + Pull Image ${ip} user023 Test1@34 project${d} ${image_argument} ${tag_argument} # Edit Repo Info Close Browser diff --git a/tests/robot-cases/Group1-Nightly/Clair.robot b/tests/robot-cases/Group1-Nightly/Clair.robot index 0ac085e91..c33e65b42 100644 --- a/tests/robot-cases/Group1-Nightly/Clair.robot +++ b/tests/robot-cases/Group1-Nightly/Clair.robot @@ -43,7 +43,7 @@ Test Case - Disable Scan Schedule Close Browser Test Case - Scan A Tag In The Repo - Body Of Scan A Tag In The Repo + Body Of Scan A Tag In The Repo hello-world latest Test Case - Scan As An Unprivileged User Init Chrome Driver diff --git a/tests/robot-cases/Group1-Nightly/Trivy.robot b/tests/robot-cases/Group1-Nightly/Trivy.robot index e662906e7..433835391 100644 --- a/tests/robot-cases/Group1-Nightly/Trivy.robot +++ b/tests/robot-cases/Group1-Nightly/Trivy.robot @@ -47,7 +47,7 @@ Test Case - Disable Scan Schedule Close Browser Test Case - Scan A Tag In The Repo - Body Of Scan A Tag In The Repo Use Trivy + Body Of Scan A Tag In The Repo vmware/photon 1.0 Test Case - Scan As An Unprivileged User Init Chrome Driver @@ -152,4 +152,36 @@ Test Case - Verfiy Project Level CVE Whitelist Body Of Verfiy Project Level CVE Whitelist goharbor/harbor-portal 2cb6a1c24dd6b88f11fd44ccc6560cb7be969f8ac5f752802c99cae6bcd592bb 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 CVE-2019-18276 Test Case - Verfiy Project Level CVE Whitelist By Quick Way of Add System - Body Of Verfiy Project Level CVE Whitelist By Quick Way of Add System goharbor/harbor-portal 2cb6a1c24dd6b88f11fd44ccc6560cb7be969f8ac5f752802c99cae6bcd592bb 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 \nCVE-2019-18276 \ No newline at end of file + Body Of Verfiy Project Level CVE Whitelist By Quick Way of Add System goharbor/harbor-portal 2cb6a1c24dd6b88f11fd44ccc6560cb7be969f8ac5f752802c99cae6bcd592bb 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 \nCVE-2019-18276 + +Test Case - Switch Scanner + Init Chrome Driver + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + ${d}= get current date result_format=%m%s + + Switch To Scanners Page + + Should Display The Default Trivy Scanner + + Create An New Project project${d} + Go Into Project project${d} has_image=${false} + Push Image ${ip} admin Harbor12345 project${d} hello-world:latest + Go Into Project project${d} + Go Into Repo project${d}/hello-world + Scan Repo latest Fail + View Scan Error Log + + Switch To Scanners Page + + Set Default Scanner Clair + Should Display The Default Clair Scanner + + Go Into Project project${d} + Go Into Repo project${d}/hello-world + Scan Repo latest Succeed + Move To Summary Chart + Wait Until Page Contains No vulnerability + + Switch To Scanners Page + Set Default Scanner Trivy + Close Browser \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/Upgrade.robot b/tests/robot-cases/Group1-Nightly/Upgrade.robot index 5138a5668..406a4ab3f 100644 --- a/tests/robot-cases/Group1-Nightly/Upgrade.robot +++ b/tests/robot-cases/Group1-Nightly/Upgrade.robot @@ -27,7 +27,7 @@ Test Case - Manage project publicity Body Of Manage project publicity Test Case - Scan A Tag In The Repo - Body Of Scan A Tag In The Repo Use Trivy + Body Of Scan A Tag In The Repo hello-world latest Test Case - List Helm Charts Body Of List Helm Charts