From 13ae4482ab53274b77109e00e922da281235ac53 Mon Sep 17 00:00:00 2001 From: Yogi_Wang Date: Fri, 20 Mar 2020 10:04:14 +0800 Subject: [PATCH] [OCI] Change nightly case and change delete artifact words 1.nightly: fix tag retention and immutable tag case xpath 2.nightly: fix the part of delete repo button xpath 3.nightly: fix the api version when GC 4.nightly: fix add label of artifact xpath 5.text: change delete artifact show words Signed-off-by: Yogi_Wang --- .../artifact-list-tab/artifact-list-tab.component.ts | 4 ++-- src/portal/src/i18n/lang/en-us-lang.json | 4 +++- src/portal/src/i18n/lang/es-es-lang.json | 4 +++- src/portal/src/i18n/lang/fr-fr-lang.json | 4 +++- src/portal/src/i18n/lang/pt-br-lang.json | 4 +++- src/portal/src/i18n/lang/tr-tr-lang.json | 4 +++- src/portal/src/i18n/lang/zh-cn-lang.json | 2 ++ tests/resources/Harbor-Pages/Project.robot | 3 ++- tests/resources/Harbor-Pages/Project_Elements.robot | 4 ++-- tests/robot-cases/Group1-Nightly/Common_GC.robot | 5 ++--- 10 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts index a06c0c5ac..5537c5f3d 100644 --- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts +++ b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts @@ -703,8 +703,8 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { }); let titleKey: string, summaryKey: string, content: string, buttons: ConfirmationButtons; - titleKey = "REPOSITORY.DELETION_TITLE_TAG"; - summaryKey = "REPOSITORY.DELETION_SUMMARY_TAG"; + titleKey = "REPOSITORY.DELETION_TITLE_ARTIFACT"; + summaryKey = "REPOSITORY.DELETION_SUMMARY_ARTIFACT"; buttons = ConfirmationButtons.DELETE_CANCEL; content = artifactNames.join(" , "); let message = new ConfirmationMessage( diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index e9ba3349c..0d7568116 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -655,8 +655,10 @@ "DELETION_TITLE_REPO_SIGNED": "Repository cannot be deleted", "DELETION_SUMMARY_REPO_SIGNED": "Repository '{{repoName}}' cannot be deleted because the following signed images existing.\n{{signedImages}} \nYou should unsign all the signed images before deleting the repository!", "DELETION_SUMMARY_REPO": "Do you want to delete repository {{repoName}}?", + "DELETION_TITLE_ARTIFACT": "Confirm Artifact Deletion", + "DELETION_SUMMARY_ARTIFACT": "Do you want to delete artifact {{param}}? If you delete this artifact, all tags referenced by the digest will also be deleted.", "DELETION_TITLE_TAG": "Confirm Tag Deletion", - "DELETION_SUMMARY_TAG": "Do you want to delete tag {{param}}? If you delete this tag, all other tags referenced by the same digest will also be deleted.", + "DELETION_SUMMARY_TAG": "Do you want to delete tag {{param}}? ", "DELETION_TITLE_TAG_DENIED": "Signed tag cannot be deleted", "DELETION_SUMMARY_TAG_DENIED": "The tag must be removed from the Notary before it can be deleted.\nDelete from Notary via this command:\n", "TAGS_NO_DELETE": "Delete is prohibited in read only mode.", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 220c48723..5ba36407b 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -656,8 +656,10 @@ "DELETION_TITLE_REPO_SIGNED": "Repository cannot be deleted", "DELETION_SUMMARY_REPO_SIGNED": "Repository '{{repoName}}' cannot be deleted because the following signed images existing.\n{{signedImages}} \nYou should unsign all the signed images before deleting the repository!", "DELETION_SUMMARY_REPO": "¿Quiere eliminar el repositorio {{repoName}}?", + "DELETION_TITLE_ARTIFACT": "Confirm Artifact Deletion", + "DELETION_SUMMARY_ARTIFACT": "Do you want to delete artifact {{param}}? If you delete this artifact, all tags referenced by the digest will also be deleted.", "DELETION_TITLE_TAG": "Confirmación de Eliminación de Etiqueta", - "DELETION_SUMMARY_TAG": "¿Quiere eliminar la etiqueta {{param}}? If you delete this tag, all other tags referenced by the same digest will also be deleted.", + "DELETION_SUMMARY_TAG": "¿Quiere eliminar la etiqueta {{param}}? ", "DELETION_TITLE_TAG_DENIED": "La etiqueta firmada no puede ser eliminada", "DELETION_SUMMARY_TAG_DENIED": "La etiqueta debe ser eliminada de la Notaría antes de eliminarla.\nEliminarla de la Notaría con este comando:\n", "TAGS_NO_DELETE": "Delete is prohibited in read only mode.", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index b7c9c52b4..aa1b63a77 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -644,8 +644,10 @@ "DELETION_TITLE_REPO_SIGNED": "Le Dépôt ne peut être supprimé", "DELETION_SUMMARY_REPO_SIGNED": "Le Dépôt '{{repoName}}' ne peut pas être supprimé parce que les images suivantes signées existent. \n{{signedImages}} \nVous devez retirer la signature de toutes les images signées avant de supprimer le dépôt !", "DELETION_SUMMARY_REPO": "Voulez-vous supprimer le dépôt {{repoName}} ?", + "DELETION_TITLE_ARTIFACT": "Confirm Artifact Deletion", + "DELETION_SUMMARY_ARTIFACT": "Do you want to delete artifact {{param}}? If you delete this artifact, all tags referenced by the digest will also be deleted.", "DELETION_TITLE_TAG": "Confirmer la suppression du Tag", - "DELETION_SUMMARY_TAG": "Voulez-vous supprimer le tag {{param}}? If you delete this tag, all other tags referenced by the same digest will also be deleted.", + "DELETION_SUMMARY_TAG": "Voulez-vous supprimer le tag {{param}}? ", "DELETION_TITLE_TAG_DENIED": "Un tag signé ne peut être supprimé", "DELETION_SUMMARY_TAG_DENIED": "La balise doit être supprimée du Résumé avant qu'elle ne puisse être supprimée. \nSupprimer du Résumé via cette commande: \n", "TAGS_NO_DELETE": "Upload/Delete is prohibited in read only mode.", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 41f365b6b..b96703a76 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -655,8 +655,10 @@ "DELETION_TITLE_REPO_SIGNED": "Repositório não pode ser removido", "DELETION_SUMMARY_REPO_SIGNED": "Repositório '{{repoName}}' não pode ser removido pois existem as seguintes imagens assinadas.\n{{signedImages}} \nVocê deve remover a assinatura de todas as imagens assinadas antes de remover o repositório!", "DELETION_SUMMARY_REPO": "Você deseja remover o repositório {{repoName}}?", + "DELETION_TITLE_ARTIFACT": "Confirm Artifact Deletion", + "DELETION_SUMMARY_ARTIFACT": "Do you want to delete artifact {{param}}? If you delete this artifact, all tags referenced by the digest will also be deleted.", "DELETION_TITLE_TAG": "Confirmar remoção de Tag", - "DELETION_SUMMARY_TAG": "Você quer remover a Tag {{param}}? If you delete this tag, all other tags referenced by the same digest will also be deleted.", + "DELETION_SUMMARY_TAG": "Você quer remover a Tag {{param}}? ", "DELETION_TITLE_TAG_DENIED": "Tags assinadas não podem ser removidas", "DELETION_SUMMARY_TAG_DENIED": "A tag deve ser removida do Notary antes de ser apagada.\nRemova do Notary com o seguinte comando:\n", "TAGS_NO_DELETE": "Remover é proibido em modo somente leitura.", diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index b59b93d65..ba09d93dd 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -655,8 +655,10 @@ "DELETION_TITLE_REPO_SIGNED": "Depo silinemez", "DELETION_SUMMARY_REPO_SIGNED": "Depo '{{repoName}}' aşağıdaki imzalanmış görüntüler mevcut olduğu için silinemez. \n {{signedImages}} \nBir depoyu silmeden önce imzalı tüm imajları imzalamanız gerekir!", "DELETION_SUMMARY_REPO": "Depoyu silmek istiyor musunuz?{{repoName}}?", + "DELETION_TITLE_ARTIFACT": "Confirm Artifact Deletion", + "DELETION_SUMMARY_ARTIFACT": "Do you want to delete artifact {{param}}? If you delete this artifact, all tags referenced by the digest will also be deleted.", "DELETION_TITLE_TAG": "Etiket Silme İşlemini Onayla", - "DELETION_SUMMARY_TAG": "Etiketi silmek ister misiniz {{param}}? If you delete this tag, all other tags referenced by the same digest will also be deleted.", + "DELETION_SUMMARY_TAG": "Etiketi silmek ister misiniz {{param}}?", "DELETION_TITLE_TAG_DENIED": "İmzalı etiket silinemez", "DELETION_SUMMARY_TAG_DENIED": "Etiket silinmeden önce Harbordan kaldırılmalıdır. \nBu komutla Harbor'den silin: \n", "TAGS_NO_DELETE": "Salt okunur modda silmek yasaktır.", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index 9fe67dc12..33fb9006b 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -656,6 +656,8 @@ "DELETION_TITLE_REPO_SIGNED": "仓库不能被删除", "DELETION_SUMMARY_REPO_SIGNED": "镜像仓库 '{{repoName}}' 不能被删除,因为存在以下签名镜像.\n{{signedImages}} \n在删除镜像仓库前需先删除所有的签名镜像", "DELETION_SUMMARY_REPO": "确认删除镜像仓库 {{repoName}}?", + "DELETION_TITLE_ARTIFACT": "删除镜像 Artifact 确认", + "DELETION_SUMMARY_ARTIFACT": "确认删除镜像 Artifact {{param}}? 如果您删除此 Artifact,则这个 digest 的所有 Tag 也将被删除。", "DELETION_TITLE_TAG": "删除镜像 Tag 确认", "DELETION_SUMMARY_TAG": "确认删除镜像 Tag {{param}}? 如果您删除此 Tag,则这个 Tag 引用的同一个 digest 的所有其他 Tag 也将被删除。", "DELETION_TITLE_TAG_DENIED": "已签名的镜像不能被删除", diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 04586163f..a17ac467d 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -246,7 +246,8 @@ Add Labels To Tag [Arguments] ${tagName} ${labelName} Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label Capture Page Screenshot add_${labelName}.png - Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//button + Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//span + Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'labels')] Retry Element Click xpath=//clr-dropdown//div//label[contains(.,'${labelName}')] Retry Wait Until Page Contains Element xpath=//clr-dg-row//label[contains(.,'${labelName}')] diff --git a/tests/resources/Harbor-Pages/Project_Elements.robot b/tests/resources/Harbor-Pages/Project_Elements.robot index c41df7ffd..c2642cf9c 100644 --- a/tests/resources/Harbor-Pages/Project_Elements.robot +++ b/tests/resources/Harbor-Pages/Project_Elements.robot @@ -26,7 +26,7 @@ ${project_replication_xpath} //project-detail//a[contains(.,'Replication')] ${project_log_xpath} //project-detail//a[contains(.,'Logs')] ${project_member_xpath} //project-detail//a[contains(.,'Members')] ${project_config_tabsheet} xpath=//project-detail//a[contains(.,'Configuration')] -${project_tag_strategy_xpath} //clr-tabs//a[contains(.,'Tag')] +${project_tag_strategy_xpath} //clr-tabs//a[contains(.,'Policy')] ${project_tab_overflow_btn} //clr-tabs//li//button[contains(@class,"dropdown-toggle")] ${project_tag_immutability_switch} //project-detail/app-tag-feature-integration//label/a[contains(.,'Tag Immutability')] @@ -39,7 +39,7 @@ ${repo_delete_confirm_btn} xpath=//clr-modal//button[2] ${repo_retag_confirm_dlg} css=${modal-dialog} ${repo_delete_on_card_view_btn} //clr-modal//button[contains(.,'DELETE')] ${delete_btn} //button[contains(.,'Delete')] -${repo_delete_btn} xpath=//repository//button[contains(.,'Delete')] +${repo_delete_btn} xpath=//hbr-repository-gridview//button[contains(.,'Delete')] ${project_delete_btn} xpath=//list-project//clr-datagrid//button[contains(.,'Delete')] ${tag_delete_btn} xpath=//tag-repository//clr-datagrid//button[contains(.,'Delete')] ${user_delete_btn} xpath=/clr-dropdown-menu//button[contains(.,'Delete')] diff --git a/tests/robot-cases/Group1-Nightly/Common_GC.robot b/tests/robot-cases/Group1-Nightly/Common_GC.robot index 9f11d0d45..7889336bc 100644 --- a/tests/robot-cases/Group1-Nightly/Common_GC.robot +++ b/tests/robot-cases/Group1-Nightly/Common_GC.robot @@ -35,11 +35,10 @@ Test Case - Garbage Collection Go Into Project project${d} Delete Repo project${d} GC Now ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} - ${rc} ${output}= Run And Return Rc And Output curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -i --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/system/gc/1/log" + ${rc} ${output}= Run And Return Rc And Output curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -i --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/v2.0/system/gc/1/log" Log To Console ${output} Should Be Equal As Integers ${rc} 0 - Should Contain ${output} 3 blobs and 0 manifests eligible for deletion - #Should Contain ${output} Deleting blob: + Should Contain ${output} 3 blobs marked, 0 blobs and 0 manifests eligible for deletion Should Contain ${output} success to run gc in job. Close Browser \ No newline at end of file