diff --git a/tests/resources/Harbor-Pages/Project-Repository.robot b/tests/resources/Harbor-Pages/Project-Repository.robot index 708f451f1..8a1da6992 100644 --- a/tests/resources/Harbor-Pages/Project-Repository.robot +++ b/tests/resources/Harbor-Pages/Project-Repository.robot @@ -30,4 +30,17 @@ View Scan Error Log Retry Wait Until Page Contains View Log Retry Element Click xpath=${view_log_xpath} +Scan Artifact + [Arguments] ${project} ${repo} ${label_xpath}=//clr-dg-row//label[1] + Go Into Project ${project} + Go Into Repo ${project}/${repo} + Retry Element Click ${label_xpath} + Retry Element Click ${scan_artifact_btn} +Stop Scan Artifact + Retry Element Click ${stop_scan_artifact_btn} + +Check Scan Artifact Job Status Is Stopped + Wait Until Element Is Visible ${stopped_label} + ${job_status}= Get Text ${stopped_label} + Should Be Equal As Strings '${job_status}' 'Scan stopped' \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Project-Repository_Elements.robot b/tests/resources/Harbor-Pages/Project-Repository_Elements.robot index 5b4ec7b47..d21773ea1 100644 --- a/tests/resources/Harbor-Pages/Project-Repository_Elements.robot +++ b/tests/resources/Harbor-Pages/Project-Repository_Elements.robot @@ -22,5 +22,6 @@ ${view_log_xpath} //clr-dg-row//clr-dg-cell//a[contains(.,'View Log')] ${build_history_btn} //button[contains(.,'Build History')] ${build_history_data} //clr-dg-row ${push_image_command_btn} //hbr-push-image-button//button - - +${scan_artifact_btn} //button[@id='scan-btn'] +${stop_scan_artifact_btn} //button[@id='stop-scan'] +${stopped_label} //span[@class='label stopped'] diff --git a/tests/resources/Harbor-Pages/Vulnerability.robot b/tests/resources/Harbor-Pages/Vulnerability.robot index 4992f1045..398f800ad 100644 --- a/tests/resources/Harbor-Pages/Vulnerability.robot +++ b/tests/resources/Harbor-Pages/Vulnerability.robot @@ -107,3 +107,15 @@ Check Listed In CVE Allowlist Log All is_in_allow_list:${text} Should Be Equal As Strings '${text}' '${is_in}' + +Scan All Artifact + Switch To Vulnerability Page + Retry Element Click ${scan_now_button} + +Stop Scan All Artifact + Retry Element Click ${stop_scan_button} + +Check Scan All Artifact Job Status Is Stopped + Wait Until Element Is Visible ${stopped_icon} + ${stopped_total}= Get Text ${stopped_icon} + Should Be True ${stopped_total} > 0 diff --git a/tests/resources/Harbor-Pages/Vulnerability_Elements.robot b/tests/resources/Harbor-Pages/Vulnerability_Elements.robot index f96f9103c..01542b131 100644 --- a/tests/resources/Harbor-Pages/Vulnerability_Elements.robot +++ b/tests/resources/Harbor-Pages/Vulnerability_Elements.robot @@ -22,6 +22,7 @@ ${vulnerability_dropdown_list_item_none} xpath=//select[@id='selectPolicy']//op ${vulnerability_dropdown_list_item_custom} xpath=//select[@id='selectPolicy']//option[contains(.,'Custom')] ${vulnerability_save_btn} xpath=//cron-selection//button[contains(.,'SAVE')] ${scan_now_button} //vulnerability-config//button[contains(.,'NOW')] +${stop_scan_button} //vulnerability-config//button[contains(.,'Stop Scan')] ${vulnerability_page} //clr-vertical-nav-group-children/a[contains(.,'Vulnerability')] ${set_default_scanner} //button[@id='set-default'] ${scanner_action_xpath} //span[@id='action-scanner'] @@ -32,5 +33,6 @@ ${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')] ${not_scanned_icon} xpath=//span[@class[contains(.,'not-scan')]] +${stopped_icon} //span[@class[contains(.,'badge abort')]] diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index 7aae626b6..0616c6f7d 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -459,3 +459,21 @@ Check Harbor Api Page ${Title}= Get Title Should Be Equal ${Title} Harbor Swagger Retry Wait Element xpath=//h2[contains(.,"Harbor API")] + +Body Of Stop Scan And Stop Scan All + Init Chrome Driver + ${d}= get current date result_format=%m%s + ${repo}= Set Variable goharbor/harbor-e2e-engine + ${tag}= Set Variable test-ui + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Create An New Project And Go Into Project project${d} + Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${repo} ${tag} ${tag} + # stop scan + Scan Artifact project${d} ${repo} + Stop Scan Artifact + Check Scan Artifact Job Status Is Stopped + # stop scan all + Scan All Artifact + Stop Scan All Artifact + Check Scan All Artifact Job Status Is Stopped + Close Browser \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/Trivy.robot b/tests/robot-cases/Group1-Nightly/Trivy.robot index bb2903584..2e5b5ca93 100644 --- a/tests/robot-cases/Group1-Nightly/Trivy.robot +++ b/tests/robot-cases/Group1-Nightly/Trivy.robot @@ -118,3 +118,7 @@ Test Case - Verfiy Project Level CVE Allowlist Test Case - Verfiy Project Level CVE Allowlist By Quick Way of Add System Body Of Verfiy Project Level CVE Allowlist 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 - Stop Scan And Stop Scan All + [Tags] stop_scan_job + Body Of Stop Scan And Stop Scan All