Add stop scan and stop scan all test cases

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
Yang Jiao 2021-11-08 15:12:14 +08:00
parent ea16f1fb5e
commit b0d6b242ae
6 changed files with 52 additions and 2 deletions

View File

@ -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'

View File

@ -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']

View File

@ -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

View File

@ -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')]]

View File

@ -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

View File

@ -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