Merge pull request #4684 from pengpengshui/labelCase

Add filter images by label testcase
This commit is contained in:
pengpengshui 2018-04-17 18:17:10 +08:00 committed by GitHub
commit 813f6d2ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 48 additions and 15 deletions

View File

@ -7,7 +7,7 @@ export const CREATE_EDIT_LABEL_TEMPLATE: string = `
<label aria-haspopup="true" role="tooltip" [class.invalid]="isLabelNameExist" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
<input type="text" id="name" name="name" required size="20" autocomplete="off" [(ngModel)]="labelModel.name" #name="ngModel" (keyup)="existValid(labelModel.name)">
<span class="tooltip-content">
{{'LABEL.NAME_ALREADY_EXIST' | translate }}
{{'LABEL.NAME_ALREADY_EXISTS' | translate }}
</span>
</label>
</label>

View File

@ -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}];
}

View File

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

View File

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

View File

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

View File

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

View File

@ -642,7 +642,8 @@
"NO_LABELS": "无标签",
"DELETION_TITLE_TARGET":"删除标签确认",
"DELETION_SUMMARY_TARGET": "确认删除标签 {{param}}?",
"PLACEHOLDER": "未发现任何标签!"
"PLACEHOLDER": "未发现任何标签!",
"NAME_ALREADY_EXISTS": "标签名已存在。"
},
"WEEKLY": {
"MONDAY": "周一",

View File

View File

@ -240,9 +240,31 @@ 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
[Arguments] ${labelName1} ${labelName2}
Sleep 2
Click Element xpath=//clr-dropdown/hbr-filter/span/clr-icon
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
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
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}")]

View File

@ -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
@ -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}
Create New Labels label111
Capture Page Screenshot CreateLabel1.png
Create New Labels label22
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 label111
Add Labels To Tag 4.0.7-alpine label22
Filter Labels In Tags label111 label22
Close Browser
TestCase - Developer Operate Labels
@ -625,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}