Add new nightly case for GC untagged images

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2020-04-13 15:29:09 +08:00
parent 009662a317
commit 46320641b4
5 changed files with 48 additions and 3 deletions

View File

@ -1035,7 +1035,7 @@
"TAGGED": "Tagged",
"UNTAGGED": "Untagged",
"ALL": "All",
"PLACEHOLDER": "We couldn't find any artifactds!",
"PLACEHOLDER": "We couldn't find any artifacts!",
"SCAN_UNSUPPORTED": "Unsupported"
},
"TAG": {

View File

@ -304,6 +304,12 @@ Click GC Now
Retry Element Click xpath=${gc_now_xpath}
Sleep 2
Click GC Now With Param Delete Untagged Artifacts
Sleep 1
Retry Element Click xpath=${checkbox_delete_untagged_artifacts}
Retry Element Click xpath=${gc_now_xpath}
Sleep 5
View GC Details
Retry Element Click xpath=${gc_log_details_xpath}
Sleep 2

View File

@ -36,4 +36,5 @@ ${configuration_system_wl_add_btn} //*[@id='show-add-modal-button']
${configuration_system_wl_textarea} //*[@id='whitelist-textarea']
${configuration_system_wl_add_confirm_btn} //*[@id='add-to-system']
${configuration_system_wl_delete_a_cve_id_icon} //system-settings/form/section//ul/li[1]/clr-icon
${configuration_sys_repo_readonly_chb_id} //*[@id='repo_read_only_lbl']
${configuration_sys_repo_readonly_chb_id} //*[@id='repo_read_only_lbl']
${checkbox_delete_untagged_artifacts} //gc-config//clr-checkbox-wrapper//label[contains(@for,'delete_untagged')]

View File

@ -41,4 +41,10 @@ Delete A Tag
Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//clr-checkbox-wrapper//label[contains(@class,'clr-control-label')]
Retry Element Click ${delete_tag_button}
Retry Wait Until Page Contains Element ${dialog_delete_button}
Retry Element Click ${dialog_delete_button}
Retry Element Click ${dialog_delete_button}
Should Contain Artifact
Retry Wait Until Page Contains Element xpath=//artifact-list-tab//clr-dg-row//a[contains(.,'sha256')]
Should Not Contain Any Artifact
Retry Wait Until Page Not Contains Element xpath=//artifact-list-tab//clr-dg-row

View File

@ -556,6 +556,38 @@ Test Case - Tag CRUD
Should Contain Tag 456
Delete A Tag latest
Should Not Contain Tag latest
Close Browser
Test Case - GC Untagged Images
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
${d}= Get Current Date result_format=%m%s
Create An New Project project${d}
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world latest
# make hello-world untagged
Go Into Project project${d}
Go Into Repo hello-world
Go Into Artifact latest
Should Contain Tag latest
Delete A Tag latest
Should Not Contain Tag latest
# run gc without param delete untagged artifacts checked, should not delete hello-world:latest
Switch To Garbage Collection
Click GC Now
Go Into Project project${d}
Switch To Project Repo
Go Into Repo hello-world
Should Contain Artifact
# run gc with param delete untagged artifacts checked, should delete hello-world
Switch To Garbage Collection
Click GC Now With Param Delete Untagged Artifacts
Go Into Project project${d}
Switch To Project Repo
Go Into Repo hello-world
Should Not Contain Any Artifact
Close Browser
Test Case - Tag Retention
Init Chrome Driver