From c99e43674dd105acbafd0ea3f5c738113ac94886 Mon Sep 17 00:00:00 2001 From: pfh Date: Mon, 16 Apr 2018 09:54:27 +0800 Subject: [PATCH 1/4] add Filter Label about imgs --- tests/resources/Harbor-Pages/HomePage.robot | 17 +---------------- tests/resources/Harbor-Pages/Project.robot | 16 ++++++++++++++++ tests/robot-cases/Group11-Nightly/Nightly.robot | 13 ++++++++++--- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/tests/resources/Harbor-Pages/HomePage.robot b/tests/resources/Harbor-Pages/HomePage.robot index 7756d21a35..1387ea437b 100644 --- a/tests/resources/Harbor-Pages/HomePage.robot +++ b/tests/resources/Harbor-Pages/HomePage.robot @@ -19,22 +19,7 @@ Resource ../../resources/Util.robot *** Variables *** ${HARBOR_VERSION} v1.1.1 -*** Keywords *** -Sign In Harbor - [Arguments] ${url} ${user} ${pw} - Go To ${url} - Sleep 5 - ${title}= Get Title - Log To Console ${title} - Should Be Equal ${title} Harbor - Sleep 2 - Input Text login_username ${user} - Input Text login_password ${pw} - Sleep 2 - Click button css=.btn - sleep 5 - Log To Console ${user} - Wait Until Page Contains ${user} + Sign Up Should Not Display Page Should Not Contain Element xpath=${sign_up_button_xpath} diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 257752cde6..61d7eaec9e 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -226,9 +226,25 @@ Switch To Project Repo Add Labels To Tag [Arguments] ${tagName} ${labelName} Click Element xpath=//clr-dg-row[contains(.,"${tagName}")]//label + Capture Page Screenshot add_${labelName}.png Sleep 1 Click Element xpath=//clr-dg-action-bar//clr-dropdown//button Sleep 1 Click Element xpath=//clr-dropdown//div//label[contains(.,"${labelName}")] Sleep 3 Page Should Contain Element xpath=//clr-dg-row//label[contains(.,"${labelName}")] + +Filter Labels In Tags + [Argument] ${labelName1} ${labelName2} + Sleep 2 + Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon + Capture Page Screenshot filter_${labelName1}.png + Sleep 2 + Page Should Contain Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName1}")] + Click Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName1}")] + Sleep 2 + Page Should Contain Element xpath=//clr-datagrid//clr-dg-cell[8]/hbr-label-piece/label[contains(.,"${labelName1}")] + Capture Page Screenshot filter_${labelName2}.png + Click Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName2}")] + Sleep 2 + Page Should Not Contain Element xpath=//clr-datagrid//clr-dg-cell[8]/hbr-label-piece/label[contains(.,"${labelName2}")] diff --git a/tests/robot-cases/Group11-Nightly/Nightly.robot b/tests/robot-cases/Group11-Nightly/Nightly.robot index fb09c7d607..e17ee74793 100644 --- a/tests/robot-cases/Group11-Nightly/Nightly.robot +++ b/tests/robot-cases/Group11-Nightly/Nightly.robot @@ -316,17 +316,24 @@ TestCase - Project Admin Add Labels To Repo Init Chrome Driver ${d}= Get Current Date result_format=%m%s Create An New Project With New User url=${HARBOR_URL} username=test${d} email=test${d}@vmware.com realname=test${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=false - Push Image With Tag ${ip} test${d} Test1@34 project${d} vmware/photon 1.0 1.0 + ## Push Image With Tag ${ip} test${d} Test1@34 project${d} vmware/photon 1.0 1.0 + Push Image With Tag ${ip} test${d} Test1@34 project${d} redis 3.2.10-alpine 3.2.10-alpine + Push Image With Tag ${ip} test${d} Test1@34 project${d} redis 4.0.7-alpine 4.0.7-alpine Go Into Project project${d} Sleep 2 # Add labels Switch To Project Label Create New Labels label_${d} + Capture Page Screenshot CreateLabel1.png + Create New Labels label11111 + Capture Page Screenshot CreateLabel2.png Sleep 2 Switch To Project Repo - Go Into Repo project${d}/vmware/photon - Add Labels To Tag 1.0 label_${d} + Go Into Repo project${d}/redis + Add Labels To Tag 3.2.10-alpine label_${d} + Add Labels To Tag 4.0.7-alpine label11111 + Filter Labels In Tags label_${d} Close Browser TestCase - Developer Operate Labels From bd28eb45419b5467c464e017ee4f4f10775f0c1d Mon Sep 17 00:00:00 2001 From: pfh Date: Mon, 16 Apr 2018 11:37:20 +0800 Subject: [PATCH 2/4] Add Filter Label about imgs --- src/ui_ng/package.json | 2 +- tests/resources/Harbor-Pages/HomePage.robot | 17 ++++++++++++++++- tests/resources/Harbor-Pages/Project.robot | 16 +++++++++++----- .../robot-cases/Group11-Nightly/Nightly.robot | 18 +++++++++--------- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index 36d2c1ec80..8dbc0e596a 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -30,7 +30,7 @@ "clarity-icons": "0.10.24", "clarity-ui": "0.10.24", "core-js": "^2.4.1", - "harbor-ui": "0.6.74", + "harbor-ui": "0.6.75", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/tests/resources/Harbor-Pages/HomePage.robot b/tests/resources/Harbor-Pages/HomePage.robot index 1387ea437b..7756d21a35 100644 --- a/tests/resources/Harbor-Pages/HomePage.robot +++ b/tests/resources/Harbor-Pages/HomePage.robot @@ -19,7 +19,22 @@ Resource ../../resources/Util.robot *** Variables *** ${HARBOR_VERSION} v1.1.1 - +*** Keywords *** +Sign In Harbor + [Arguments] ${url} ${user} ${pw} + Go To ${url} + Sleep 5 + ${title}= Get Title + Log To Console ${title} + Should Be Equal ${title} Harbor + Sleep 2 + Input Text login_username ${user} + Input Text login_password ${pw} + Sleep 2 + Click button css=.btn + sleep 5 + Log To Console ${user} + Wait Until Page Contains ${user} Sign Up Should Not Display Page Should Not Contain Element xpath=${sign_up_button_xpath} diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 7d5505c796..188e2a3cad 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -249,16 +249,22 @@ Add Labels To Tag Page Should Contain Element xpath=//clr-dg-row//label[contains(.,"${labelName}")] Filter Labels In Tags - [Argument] ${labelName1} ${labelName2} + [Arguments] ${labelName1} ${labelName2} Sleep 2 Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon - Capture Page Screenshot filter_${labelName1}.png Sleep 2 Page Should Contain Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName1}")] Click Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName1}")] Sleep 2 - Page Should Contain Element xpath=//clr-datagrid//clr-dg-cell[8]/hbr-label-piece/label[contains(.,"${labelName1}")] - Capture Page Screenshot filter_${labelName2}.png + Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon + Page Should Contain Element xpath=//clr-datagrid//label[contains(.,"${labelName1}")] + + Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon + Sleep 2 Click Element xpath=//tag-repository//clr-dropdown-menu/div//button[contains(.,"${labelName2}")] Sleep 2 - Page Should Not Contain Element xpath=//clr-datagrid//clr-dg-cell[8]/hbr-label-piece/label[contains(.,"${labelName2}")] + Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon + Sleep 2 + Capture Page Screenshot filter_${labelName2}.png + Page Should Contain Element xpath=//clr-dg-row[contains(.,"${labelName2}")] + Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"${labelName1}")] diff --git a/tests/robot-cases/Group11-Nightly/Nightly.robot b/tests/robot-cases/Group11-Nightly/Nightly.robot index 0732a41d45..fca5aa0ada 100644 --- a/tests/robot-cases/Group11-Nightly/Nightly.robot +++ b/tests/robot-cases/Group11-Nightly/Nightly.robot @@ -36,10 +36,10 @@ Test Case - Vulnerability Data Not Ready Vulnerability Not Ready Config Hint Test Case - Read Only Mode - Init Chrome Driver - ${d}= Get Current Date result_format=%m%s + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=true - + Enable Read Only Cannot Push image ${ip} tester${d} Test1@34 project${d} busybox:latest @@ -324,16 +324,16 @@ TestCase - Project Admin Add Labels To Repo Sleep 2 # Add labels Switch To Project Label - Create New Labels label_${d} + Create New Labels label111 Capture Page Screenshot CreateLabel1.png - Create New Labels label11111 + Create New Labels label22 Capture Page Screenshot CreateLabel2.png Sleep 2 Switch To Project Repo Go Into Repo project${d}/redis - Add Labels To Tag 3.2.10-alpine label_${d} - Add Labels To Tag 4.0.7-alpine label11111 - Filter Labels In Tags label_${d} + Add Labels To Tag 3.2.10-alpine label111 + Add Labels To Tag 4.0.7-alpine label22 + Filter Labels In Tags label111 label22 Close Browser TestCase - Developer Operate Labels @@ -632,4 +632,4 @@ Test Case - View Scan Error #Test Case - OVA reset # Reset VM ${vm_name} ${vc_host} ${vc_user} ${vc_password} -# Wait for Harbor Ready https ${ip} +# Wait for Harbor Ready https ${ip} \ No newline at end of file From 786a082fff06204fd135c77f041cd90c4f376644 Mon Sep 17 00:00:00 2001 From: pfh Date: Tue, 17 Apr 2018 10:22:46 +0800 Subject: [PATCH 3/4] Fix issue about label filter and I18n --- .../src/create-edit-label/create-edit-label.component.html.ts | 2 +- src/ui_ng/lib/src/tag/tag.component.ts | 2 +- src/ui_ng/src/i18n/lang/en-us-lang.json | 3 ++- src/ui_ng/src/i18n/lang/es-es-lang.json | 3 ++- src/ui_ng/src/i18n/lang/fr-fr-lang.json | 3 ++- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 3 ++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.html.ts b/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.html.ts index cf55c2dfcf..0612514167 100644 --- a/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.html.ts +++ b/src/ui_ng/lib/src/create-edit-label/create-edit-label.component.html.ts @@ -7,7 +7,7 @@ export const CREATE_EDIT_LABEL_TEMPLATE: string = ` diff --git a/src/ui_ng/lib/src/tag/tag.component.ts b/src/ui_ng/lib/src/tag/tag.component.ts index a3aca587dc..b304698b9f 100644 --- a/src/ui_ng/lib/src/tag/tag.component.ts +++ b/src/ui_ng/lib/src/tag/tag.component.ts @@ -220,7 +220,7 @@ export class TagComponent implements OnInit, AfterViewInit { st.page.to = this.pageSize - 1; let selectedLab = this.imageFilterLabels.find(label => label.iconsShow === true); if (selectedLab) { - st.filters = [{property: 'name', value: this.lastFilteredTagName}, {property: 'labels.name', value: selectedLab.label}]; + st.filters = [{property: 'name', value: this.lastFilteredTagName}, {property: 'labels.name', value: selectedLab.label.name}]; }else { st.filters = [{property: 'name', value: this.lastFilteredTagName}]; } diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 599f50c942..9baa04b8c1 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -642,7 +642,8 @@ "NO_LABELS": "No labels", "DELETION_TITLE_TARGET": "Confirm Label Deletion", "DELETION_SUMMARY_TARGET": "Do you want to delete {{param}}?", - "PLACEHOLDER": "We couldn't find any labels!" + "PLACEHOLDER": "We couldn't find any labels!", + "NAME_ALREADY_EXISTS": "Label name already exists." }, "WEEKLY": { "MONDAY": "Monday", diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index 50456db500..574029560a 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -642,7 +642,8 @@ "NO_LABELS": "No labels", "DELETION_TITLE_TARGET": "Confirm Label Deletion", "DELETION_SUMMARY_TARGET": "Do you want to delete {{param}}?", - "PLACEHOLDER": "We couldn't find any labels!" + "PLACEHOLDER": "We couldn't find any labels!", + "NAME_ALREADY_EXISTS": "Label name already exists." }, "WEEKLY": { "MONDAY": "Monday", diff --git a/src/ui_ng/src/i18n/lang/fr-fr-lang.json b/src/ui_ng/src/i18n/lang/fr-fr-lang.json index 03f2ae7214..d22903ee6c 100644 --- a/src/ui_ng/src/i18n/lang/fr-fr-lang.json +++ b/src/ui_ng/src/i18n/lang/fr-fr-lang.json @@ -600,7 +600,8 @@ "NO_LABELS": "No labels", "DELETION_TITLE_TARGET": "Confirm Label Deletion", "DELETION_SUMMARY_TARGET": "Do you want to delete {{param}}?", - "PLACEHOLDER": "We couldn't find any labels!" + "PLACEHOLDER": "We couldn't find any labels!", + "NAME_ALREADY_EXISTS": "Label name already exists." }, "WEEKLY": { "MONDAY": "Monday", diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index 28bf204d86..777aa563d8 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -642,7 +642,8 @@ "NO_LABELS": "无标签", "DELETION_TITLE_TARGET":"删除标签确认", "DELETION_SUMMARY_TARGET": "确认删除标签 {{param}}?", - "PLACEHOLDER": "未发现任何标签!" + "PLACEHOLDER": "未发现任何标签!", + "NAME_ALREADY_EXISTS": "标签名已存在。" }, "WEEKLY": { "MONDAY": "周一", From 2989ad6c929af4f3838e546fd582179853f635c6 Mon Sep 17 00:00:00 2001 From: pfh Date: Tue, 17 Apr 2018 10:57:21 +0800 Subject: [PATCH 4/4] Delete a unused file --- src/ui_ng/{ | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/ui_ng/{ diff --git a/src/ui_ng/{ b/src/ui_ng/{ deleted file mode 100644 index e69de29bb2..0000000000