diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts index db6c59580..5fa6ba1a1 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts @@ -104,7 +104,7 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { res => { this.scan_overview = res; if (this.scan_overview && this.scan_overview[DEFAULT_SUPPORTED_MIME_TYPE]) { - this.scanningResults = this.scan_overview[DEFAULT_SUPPORTED_MIME_TYPE].vulnerabilities; + this.scanningResults = this.scan_overview[DEFAULT_SUPPORTED_MIME_TYPE].vulnerabilities || []; // sort if (this.scanningResults) { this.scanningResults.sort(((a, b) => this.getLevel(b) - this.getLevel(a))); diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html index c0b7ea179..0a4736965 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html +++ b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html @@ -2,10 +2,10 @@ - - @@ -32,7 +32,7 @@ - diff --git a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot index 390b5f348..56ba12c59 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot @@ -22,3 +22,10 @@ ${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @ ${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//a ${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')] +${artifact_list_spinner} xpath=//clr-datagrid//clr-spinner +${artifact_tag_component} xpath=//artifact-tag +${add_tag_button} xpath=//*[@id='new-tag'] +${tag_name_xpath} xpath=//*[@id='name'] +${add_ok_button} xpath=//*[@id='add-ok'] +${delete_tag_button} xpath=//*[@id='delete-tag'] +${dialog_delete_button} xpath=//clr-modal//button[contains(.,'DELETE')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Project-Artifact.robot b/tests/resources/Harbor-Pages/Project-Artifact.robot index f32e22af9..72e45690d 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact.robot @@ -16,4 +16,29 @@ Documentation This resource provides any keywords related to the Harbor private registry appliance Resource ../../resources/Util.robot -*** Keywords *** \ No newline at end of file +*** Keywords *** +Go Into Artifact + [Arguments] ${tag} + Retry Wait Until Page Not Contains Element ${artifact_list_spinner} + Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//a[contains(.,'sha256')] + Retry Wait Until Page Contains Element ${artifact_tag_component} +Should Contain Tag + [Arguments] ${tag} + Retry Wait Until Page Contains Element xpath=//artifact-tag//clr-dg-row//clr-dg-cell[contains(.,'${tag}')] + +Should Not Contain Tag + [Arguments] ${tag} + Retry Wait Until Page Not Contains Element xpath=//artifact-tag//clr-dg-row//clr-dg-cell[contains(.,'${tag}')] + +Add A New Tag + [Arguments] ${tag} + Retry Element Click ${add_tag_button} + Retry Text Input ${tag_name_xpath} ${tag} + Retry Element Click ${add_ok_button} + +Delete A Tag + [Arguments] ${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} \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index a26a33133..b4571f120 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -539,6 +539,24 @@ Test Case - Webhook CRUD Delete A Webhook newWebhook${d} Close Browser +Test Case - Tag CRUD + 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 + Switch To Project Repo + Go Into Repo hello-world + Go Into Artifact latest + Should Contain Tag latest + # add more than one tag + Add A New Tag 123 + Should Contain Tag 123 + Add A New Tag 456 + Should Contain Tag 456 + Delete A Tag latest + Should Not Contain Tag latest + Test Case - Tag Retention Init Chrome Driver Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}