diff --git a/src/ui_ng/src/app/project/member/add-member/add-member.component.ts b/src/ui_ng/src/app/project/member/add-member/add-member.component.ts
index e62b6883f..25c007a8d 100644
--- a/src/ui_ng/src/app/project/member/add-member/add-member.component.ts
+++ b/src/ui_ng/src/app/project/member/add-member/add-member.component.ts
@@ -25,6 +25,7 @@ import { Response } from '@angular/http';
import { NgForm } from '@angular/forms';
import { MemberService } from '../member.service';
+import { UserService } from '../../../user/user.service';
import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
@@ -36,11 +37,13 @@ import { Member } from '../member';
import { Subject } from 'rxjs/Subject';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
+import {User} from "../../../user/user";
@Component({
selector: 'add-member',
templateUrl: 'add-member.component.html',
styleUrls: ['add-member.component.css'],
+ providers: [UserService],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
@@ -69,13 +72,21 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
memberTooltip: string = 'MEMBER.USERNAME_IS_REQUIRED';
nameChecker: Subject = new Subject();
checkOnGoing: boolean = false;
+ selectUserName: string[] = [];
+ userLists: User[];
constructor(private memberService: MemberService,
+ private userService: UserService,
private messageHandlerService: MessageHandlerService,
private translateService: TranslateService,
private ref: ChangeDetectorRef) { }
ngOnInit(): void {
+ this.userService.getUsers()
+ .then(users => {
+ this.userLists = users;
+ });
+
this.nameChecker
.debounceTime(500)
.distinctUntilChanged()
@@ -97,6 +108,20 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
.catch(error => {
this.checkOnGoing = false;
});
+ //username autocomplete
+ if (this.userLists.length) {
+ this.selectUserName = [];
+ this.userLists.filter(data => {
+ if (data.username.startsWith(cont.value)) {
+ if (this.selectUserName.length < 10) {
+ this.selectUserName.push(data.username);
+ }
+ }
+ });
+ setTimeout(() => {
+ setInterval(() => this.ref.markForCheck(), 100);
+ }, 1000);
+ }
} else {
this.memberTooltip = 'MEMBER.USERNAME_IS_REQUIRED';
}
@@ -148,6 +173,11 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
}, 1000);
}
+ selectedName(username: string) {
+ this.member.username = username;
+ this.selectUserName = [];
+ }
+
onCancel() {
if (this.hasChanged) {
this.inlineAlert.showInlineConfirmation({ message: 'ALERT.FORM_CHANGE_CONFIRMATION' });
@@ -157,6 +187,9 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
}
}
+ leaveInput() {
+ this.selectUserName = [];
+ }
ngAfterViewChecked(): void {
if (this.memberForm !== this.currentForm) {
this.memberForm = this.currentForm;
@@ -189,6 +222,7 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
this.member.username = '';
this.isMemberNameValid = true;
this.memberTooltip = 'MEMBER.USERNAME_IS_REQUIRED';
+ this.selectUserName = [];
}
handleValidation(): void {
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 0968db2bb..dfecf5a1a 100644
--- a/src/ui_ng/src/i18n/lang/en-us-lang.json
+++ b/src/ui_ng/src/i18n/lang/en-us-lang.json
@@ -215,6 +215,8 @@
"FILTER_JOBS_PLACEHOLDER": "Filter Jobs",
"DELETION_TITLE": "Confirm Rule Deletion",
"DELETION_SUMMARY": "Do you want to delete rule {{param}}?",
+ "DELETION_TITLE_FAILURE": "failed to delete Rule Deletion",
+ "DELETION_SUMMARY_FAILURE": "{{param}} have pending/running/retrying status",
"FILTER_TARGETS_PLACEHOLDER": "Filter Endpoints",
"DELETION_TITLE_TARGET": "Confirm Endpoint Deletion",
"DELETION_SUMMARY_TARGET": "Do you want to delete the endpoint {{param}}?",
@@ -330,6 +332,7 @@
"DELETION_SUMMARY_TAG_DENIED": "The tag must be removed from the Notary before it can be deleted.\nDelete from Notary via this command:\n{{param}}",
"FILTER_FOR_REPOSITORIES": "Filter Repositories",
"TAG": "Tag",
+ "SIZE": "Size",
"SIGNED": "Signed",
"AUTHOR": "Author",
"CREATED": "Creation Time",
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 d78a2d73c..50e93e292 100644
--- a/src/ui_ng/src/i18n/lang/es-es-lang.json
+++ b/src/ui_ng/src/i18n/lang/es-es-lang.json
@@ -215,6 +215,8 @@
"FILTER_JOBS_PLACEHOLDER": "Filtrar Trabajos",
"DELETION_TITLE": "Confirmar Eliminación de Regla",
"DELETION_SUMMARY": "¿Quiere eliminar la regla {{param}}?",
+ "DELETION_TITLE_FAILURE": "failed to delete Rule Deletion",
+ "DELETION_SUMMARY_FAILURE": "{{param}} have pending/running/retrying status",
"FILTER_TARGETS_PLACEHOLDER": "Filtrar Endpoints",
"DELETION_TITLE_TARGET": "Confirmar Eliminación de Endpoint",
"DELETION_SUMMARY_TARGET": "¿Quiere eliminar el endpoint {{param}}?",
@@ -331,6 +333,7 @@
"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{{param}}",
"FILTER_FOR_REPOSITORIES": "Filtrar Repositorios",
"TAG": "Etiqueta",
+ "SIZE": "Size",
"SIGNED": "Firmada",
"AUTHOR": "Autor",
"CREATED": "Fecha de creación",
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 00bb9f2f6..c03a41050 100644
--- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json
+++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json
@@ -215,6 +215,8 @@
"FILTER_JOBS_PLACEHOLDER": "过滤任务",
"DELETION_TITLE": "删除规则确认",
"DELETION_SUMMARY": "确认删除规则 {{param}}?",
+ "DELETION_TITLE_FAILURE": "规则确认删除失败",
+ "DELETION_SUMMARY_FAILURE": "{{param}} 有 pending/running/retrying 状态,不能删除",
"FILTER_TARGETS_PLACEHOLDER": "过滤目标",
"DELETION_TITLE_TARGET": "删除目标确认",
"DELETION_SUMMARY_TARGET": "确认删除目标 {{param}}?",
@@ -330,6 +332,7 @@
"DELETION_SUMMARY_TAG_DENIED": "要删除此镜像标签必须首先从Notary中删除。\n请执行如下Notary命令删除:\n{{param}}",
"FILTER_FOR_REPOSITORIES": "过滤镜像仓库",
"TAG": "标签",
+ "SIZE": "大小",
"SIGNED": "已签名",
"AUTHOR": "作者",
"CREATED": "创建时间",
diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot
index dd081c1b9..16ca3eb51 100644
--- a/tests/resources/Docker-Util.robot
+++ b/tests/resources/Docker-Util.robot
@@ -40,11 +40,24 @@ Push image
Log To Console \nRunning docker push ${image}...
${rc}= Run And Return Rc docker pull ${image}
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
- Log To Console ${output}
+ Log To Console ${output}
Should Be Equal As Integers ${rc} 0
${rc}= Run And Return Rc docker tag ${image} ${ip}/${project}/${image}
${rc} ${output}= Run And Return Rc And Output docker push ${ip}/${project}/${image}
- Log To Console ${output}
+ Log To Console ${output}
+ Should Be Equal As Integers ${rc} 0
+ ${rc}= Run And Return Rc docker logout ${ip}
+
+Push Image With Tag
+ [Arguments] ${ip} ${user} ${pwd} ${project} ${image} ${tag}
+ Log To Console \nRunning docker push ${image}...
+ ${rc}= Run And Return Rc docker pull ${image}
+ ${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
+ Log To Console ${output}
+ Should Be Equal As Integers ${rc} 0
+ ${rc}= Run And Return Rc docker tag ${image} ${tag}
+ ${rc} ${output}= Run And Return Rc And Output docker push ${tag}
+ Log To Console ${output}
Should Be Equal As Integers ${rc} 0
${rc}= Run And Return Rc docker logout ${ip}
@@ -56,6 +69,19 @@ Cannot Pull image
Log To Console ${output}
Should Not Be Equal As Integers ${rc} 0
+Cannot Push image
+ [Arguments] ${ip} ${user} ${pwd} ${project} ${image}
+ Log To Console \nRunning docker push ${image}...
+ ${rc}= Run And Return Rc docker pull ${image}
+ ${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
+ Log To Console ${output}
+ Should Be Equal As Integers ${rc} 0
+ ${rc}= Run And Return Rc docker tag ${image} ${ip}/${project}/${image}
+ ${rc} ${output}= Run And Return Rc And Output docker push ${ip}/${project}/${image}
+ Log To Console ${output}
+ Should Not Be Equal As Integers ${rc} 0
+ ${rc}= Run And Return Rc docker logout ${ip}
+
Wait Until Container Stops
[Arguments] ${container}
:FOR ${idx} IN RANGE 0 60
diff --git a/tests/resources/Harbor-Pages/Configuration.robot b/tests/resources/Harbor-Pages/Configuration.robot
index e7255c66e..e9b07c9e8 100644
--- a/tests/resources/Harbor-Pages/Configuration.robot
+++ b/tests/resources/Harbor-Pages/Configuration.robot
@@ -46,96 +46,96 @@ Switch To Configure
Sleep 2
Set Pro Create Admin Only
- #set limit to admin only
- Sleep 2
+ #set limit to admin only
+ Sleep 2
Click Element xpath=//clr-main-container//nav//ul/li[3]
- Sleep 1
+ Sleep 1
Click Element xpath=//select[@id="proCreation"]
Click Element xpath=//select[@id="proCreation"]//option[@value="adminonly"]
- Sleep 1
+ Sleep 1
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Capture Page Screenshot AdminCreateOnly.png
-
+ Capture Page Screenshot AdminCreateOnly.png
+
Set Pro Create Every One
- #set limit to Every One
+ #set limit to Every One
Click Element xpath=//clr-main-container//nav//ul/li[3]
- Sleep 1
+ Sleep 1
Click Element xpath=//select[@id="proCreation"]
Click Element xpath=//select[@id="proCreation"]//option[@value="everyone"]
- Sleep 1
+ Sleep 1
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
Sleep 2
- Capture Page Screenshot EveryoneCreate.png
+ Capture Page Screenshot EveryoneCreate.png
Disable Self Reg
- Click Element xpath=//clr-main-container//nav//ul/li[3]
+ Click Element xpath=//clr-main-container//nav//ul/li[3]
Mouse Down xpath=${self_reg_xpath}
Mouse Up xpath=${self_reg_xpath}
- Sleep 1
- Self Reg Should Be Disabled
+ Sleep 1
+ Self Reg Should Be Disabled
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Capture Page Screenshot DisableSelfReg.png
- Sleep 1
+ Capture Page Screenshot DisableSelfReg.png
+ Sleep 1
Enable Self Reg
- Mouse Down xpath=${self_reg_xpath}
+ Mouse Down xpath=${self_reg_xpath}
Mouse Up xpath=${self_reg_xpath}
- Sleep 1
- Self Reg Should Be Enabled
+ Sleep 1
+ Self Reg Should Be Enabled
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Capture Page Screenshot EnableSelfReg.png
- Sleep 1
-
+ Capture Page Screenshot EnableSelfReg.png
+ Sleep 1
+
Self Reg Should Be Disabled
- Checkbox Should Not Be Selected xpath=${self_reg_xpath}
+ Checkbox Should Not Be Selected xpath=${self_reg_xpath}
Self Reg Should Be Enabled
- Checkbox Should Be Selected xpath=${self_reg_xpath}
-
+ Checkbox Should Be Selected xpath=${self_reg_xpath}
+
Project Creation Should Display
Page Should Contain Element xpath=${project_create_xpath}
Project Creation Should Not Display
Page Should Not Contain Element xpath=${project_create_xpath}
-
+
## System settings
Switch To System Settings
Sleep 1
Click Element xpath=//clr-main-container//nav//ul/li[3]
Click Element xpath=//config//ul/li[4]
-
+
Modify Token Expiration
- [Arguments] ${minutes}
- Input Text xpath=//*[@id="tokenExpiration"] ${minutes}
+ [Arguments] ${minutes}
+ Input Text xpath=//*[@id="tokenExpiration"] ${minutes}
Click Button xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Sleep 1
-
+ Sleep 1
+
Token Must Be Match
- [Arguments] ${minutes}
- Textfield Value Should Be xpath=//*[@id="tokenExpiration"] ${minutes}
+ [Arguments] ${minutes}
+ Textfield Value Should Be xpath=//*[@id="tokenExpiration"] ${minutes}
## Replication
Check Verify Remote Cert
Mouse Down xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
Mouse Up xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Capture Page Screenshot RemoteCert.png
- Sleep 1
+ Capture Page Screenshot RemoteCert.png
+ Sleep 1
Switch To System Replication
Sleep 1
Switch To Configure
Click Element xpath=//*[@id="config-replication"]
- Sleep 1
-
+ Sleep 1
+
Should Verify Remote Cert Be Enabled
- Checkbox Should Not Be Selected xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
-
+ Checkbox Should Not Be Selected xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
+
## Email
Switch To Email
- Switch To Configure
- Click Element xpath=//*[@id="config-email"]
- Sleep 1
+ Switch To Configure
+ Click Element xpath=//*[@id="config-email"]
+ Sleep 1
Config Email
Input Text xpath=//*[@id="mailServer"] smtp.vmware.com
@@ -143,13 +143,13 @@ Config Email
Input Text xpath=//*[@id="emailUsername"] example@vmware.com
Input Text xpath=//*[@id="emailPassword"] example
Input Text xpath=//*[@id="emailFrom"] example
- Sleep 1
- Mouse Down xpath=//*[@id="clr-checkbox-emailSSL"]
+ Sleep 1
+ Mouse Down xpath=//*[@id="clr-checkbox-emailSSL"]
Mouse Up xpath=//*[@id="clr-checkbox-emailSSL"]
- Sleep 1
+ Sleep 1
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
- Sleep 6
-
+ Sleep 6
+
Verify Email
Textfield Value Should Be xpath=//*[@id="mailServer"] smtp.vmware.com
Textfield Value Should Be xpath=//*[@id="emailPort"] 25
@@ -168,5 +168,4 @@ Set Scan All To Daily
sleep 1
click element //config//div/button[contains(.,'SAVE')]
Click Scan Now
- click element //vulnerability-config//button[contains(.,'SCAN')]
-
+ click element //vulnerability-config//button[contains(.,'SCAN')]
\ No newline at end of file
diff --git a/tests/resources/Harbor-Pages/HomePage.robot b/tests/resources/Harbor-Pages/HomePage.robot
index dc001d41b..7eac05e5d 100644
--- a/tests/resources/Harbor-Pages/HomePage.robot
+++ b/tests/resources/Harbor-Pages/HomePage.robot
@@ -22,32 +22,32 @@ ${HARBOR_VERSION} v1.1.1
*** Keywords ***
Sign In Harbor
[Arguments] ${url} ${user} ${pw}
- Go To ${url}
+ Go To ${url}
Sleep 5
${title}= Get Title
Log To Console ${title}
Should Be Equal ${title} Harbor
- Sleep 2
+ Sleep 2
Input Text login_username ${user}
Input Text login_password ${pw}
Sleep 2
Click button css=.btn
sleep 5
- Log To Console ${user}
+ Log To Console ${user}
Wait Until Page Contains ${user}
Sign Up Should Not Display
- Page Should Not Contain Element xpath=${sign_up_button_xpath}
+ Page Should Not Contain Element xpath=${sign_up_button_xpath}
Create An New User
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment}
- Go To ${url}
+ Go To ${url}
sleep 5
${title}= Get Title
Log To Console ${title}
Should Be Equal ${title} Harbor
- ${d}= Get Current Date result_format=%m%s
- Sleep 5
+ ${d}= Get Current Date result_format=%m%s
+ Sleep 5
Click Element xpath=${sign_up_for_an_account_xpath}
sleep 3
Input Text xpath=${username_xpath} ${username}
@@ -70,4 +70,4 @@ Create An New User
Click button css=.btn
sleep 5
Wait Until Page Contains ${username}
- Sleep 3
+ Sleep 3
diff --git a/tests/resources/Harbor-Pages/Project-Members.robot b/tests/resources/Harbor-Pages/Project-Members.robot
index 0682daa40..e97dfaec4 100644
--- a/tests/resources/Harbor-Pages/Project-Members.robot
+++ b/tests/resources/Harbor-Pages/Project-Members.robot
@@ -21,69 +21,167 @@ ${HARBOR_VERSION} v1.1.1
*** Keywords ***
Go Into Project
- [Arguments] ${project}
- Sleep 2
- Click Element xpath=//*[@id="search_input"]
- Sleep 2
- Input Text xpath=//*[@id="search_input"] ${project}
- Sleep 8
- Wait Until Page Contains ${project}
- Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
- Sleep 2
- Capture Page Screenshot gointo_${project}.png
+ [Arguments] ${project}
+ Sleep 2
+ Click Element xpath=//*[@id="search_input"]
+ Sleep 2
+ Input Text xpath=//*[@id="search_input"] ${project}
+ Sleep 8
+ Wait Until Page Contains ${project}
+ Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
+ Sleep 2
+ Capture Page Screenshot gointo_${project}.png
Go Into Project2
- [Arguments] ${project}
- Sleep 2
- Capture Page Screenshot gointo1_${project}.png
- # search icon
- Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
- Sleep 2
- # text search project
- Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
- Sleep 5
- Wait Until Page Contains ${project}
- Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
- Sleep 3
- Capture Page Screenshot gointo2_${project}.png
-
+ [Arguments] ${project}
+ Sleep 2
+ Capture Page Screenshot gointo1_${project}.png
+ # search icon
+ Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
+ Sleep 2
+ # text search project
+ Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
+ Sleep 5
+ Wait Until Page Contains ${project}
+ Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
+ Sleep 3
+ Capture Page Screenshot gointo2_${project}.png
+
Add User To Project Admin
- [Arguments] ${project} ${user}
- Go Into Project2
- Sleep 2
- Click Element xpath=${project_member_tag_xpath}
- Sleep 1
+ [Arguments] ${project} ${user}
+ Go Into Project2
+ Sleep 2
+ Click Element xpath=${project_member_tag_xpath}
+ Sleep 1
Click Element xpath=${project_member_add_button_xpath}
Sleep 2
Input Text xpath=${project_member_add_username_xpath} ${user}
- Sleep 3
+ Sleep 3
Click Element xpath=${project_member_add_admin_xpath}
Click Element xpath=${project_member_add_save_button_xpath}
- Sleep 4
-
+ Sleep 4
+
Search Project Member
- [Arguments] ${project} ${user}
- Go Into Project ${project}
- Sleep 2
- Click Element xpath=${project_member_tag_xpath}
- Sleep 1
- Click Element xpath=${project_member_search_button_xpath}
- Sleep 1
- Click Element xpath=${project_member_search_text_xpath}
- Sleep 2
- Wait Until Page Contains ${user}
-
+ [Arguments] ${project} ${user}
+ Go Into Project ${project}
+ Sleep 2
+ Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
+ Sleep 1
+ Click Element xpath=${project_member_search_button_xpath}
+ Sleep 1
+ Click Element xpath=${project_member_search_text_xpath}
+ Sleep 2
+ Wait Until Page Contains ${user}
+
Change Project Member Role
- [Arguments] ${project} ${user} ${role}
- Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
+ [Arguments] ${project} ${user} ${role}
+ Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
Sleep 2
- Click Element xpath=${project_member_tag_xpath}
- Sleep 1
- Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${user}")]//clr-dg-action-overflow
- Sleep 1
+ Click Element xpath=${project_member_tag_xpath}
+ Sleep 1
+ Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${user}')]//clr-dg-action-overflow
+ Sleep 1
Click Element xpath=//project-detail//clr-dg-action-overflow//button[contains(.,"${role}")]
- Sleep 2
- Wait Until Page Contains ${role}
-
-
-
\ No newline at end of file
+ Sleep 2
+ Wait Until Page Contains ${role}
+
+User Can Change Role
+ [arguments] ${username}
+ Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow
+
+User Can Not Change Role
+ [arguments] ${username}
+ Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow[@hidden=""]
+
+Non-admin View Member Account
+ [arguments] ${times}
+ Xpath Should Match X Times //project-detail//clr-dg-action-overflow[@hidden=""] ${times}
+
+User Can Not Add Member
+ Page Should Not Contain Element xpath=${project_member_search_button_xpath2}
+
+Add Guest Member To Project
+ [arguments] ${member}
+ Click Element xpath=${project_member_search_button_xpath2}
+ Sleep 1
+ Input Text xpath=${project_member_add_username_xpath} ${member}
+ #select guest
+ Mouse Down xpath=${project_member_guest_radio_checkbox}
+ Mouse Up xpath=${project_member_guest_radio_checkbox}
+ Click Button xpath=${project_member_add_button_xpath2}
+ Sleep 1
+
+Delete Project Member
+ [arguments] ${member}
+ Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${member}')]//clr-dg-action-overflow
+ Click Element xpath=${project_member_delete_button_xpath}
+ Sleep 1
+ Click Element xpath=${project_member_delete_confirmation_xpath}
+ Sleep 1
+
+User Should Be Owner Of Project
+ [Arguments] ${user} ${pwd} ${project}
+ Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
+ Go Into Project ${project}
+ Switch To Member
+ User Can Not Change Role ${user}
+ Push image ${ip} ${user} ${pwd} ${project} hello-world
+ Logout Harbor
+
+User Should Not Be A Member Of Project
+ [Arguments] ${user} ${pwd} ${project}
+ Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
+ Project Should Not Display ${project}
+ Logout Harbor
+ Cannot Pull image ${ip} ${user} ${pwd} ${project} ${ip}/${project}/hello-world
+ Cannot Push image ${ip} ${user} ${pwd} ${project} ${ip}/${project}/hello-world
+
+Manage Project Member
+ [Arguments] ${admin} ${pwd} ${project} ${user} ${op}
+ Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
+ Go Into Project ${project}
+ Switch To Member
+ Run Keyword If '${op}' == 'Add' Add Guest Member To Project ${user}
+ ... ELSE IF '${op}' == 'Remove' Delete Project Member ${user}
+ ... ELSE Change Project Member Role ${project} ${user} ${role}
+ Logout Harbor
+
+Change User Role In Project
+ [Arguments] ${admin} ${pwd} ${project} ${user} ${role}
+ Sign In Harbor ${HARBOR_URL} ${admin} ${pwd}
+ Change Project Member Role ${project} ${user} ${role}
+ Logout Harbor
+
+User Should Be Guest
+ [Arguments] ${user} ${pwd} ${project}
+ Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
+ Project Should Display ${project}
+ Go Into Project ${project}
+ Switch To Member
+ Non-admin View Member Account 2
+ User Can Not Add Member
+ Logout Harbor
+ Pull image ${ip} ${user} ${pwd} ${project} hello-world
+ Cannot Push image ${ip} ${user} ${pwd} ${project} hello-world
+
+User Should Be Developer
+ [Arguments] ${user} ${pwd} ${project}
+ Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
+ Project Should Display ${project}
+ Go Into Project ${project}
+ Switch To Member
+ Non-admin View Member Account 2
+ User Can Not Add Member
+ Logout Harbor
+ Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world ${ip}/${project}/hello-world:v1
+
+User Should Be Admin
+ [Arguments] ${user} ${pwd} ${project} ${guest}
+ Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
+ Project Should Display ${project}
+ Go Into Project ${project}
+ Switch To Member
+ Add Guest Member To Project ${guest}
+ User Can Change Role ${guest}
+ Logout Harbor
+ Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world ${ip}/${project}/hello-world:v2
\ No newline at end of file
diff --git a/tests/resources/Harbor-Pages/Project-Members_Elements.robot b/tests/resources/Harbor-Pages/Project-Members_Elements.robot
index 088fe2f98..e39290e6b 100644
--- a/tests/resources/Harbor-Pages/Project-Members_Elements.robot
+++ b/tests/resources/Harbor-Pages/Project-Members_Elements.robot
@@ -22,4 +22,9 @@ ${project_member_add_username_xpath} //*[@id="member_name"]
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label
${project_member_add_save_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
${project_member_search_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/clr-icon/svg
-${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
\ No newline at end of file
+${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
+${project_member_search_button_xpath2} //project-detail//button//clr-icon
+${project_member_add_button_xpath2} //project-detail//add-member//button[2]
+${project_member_guest_radio_checkbox} //project-detail//form//input[@id='checkrads_guest']
+${project_member_delete_button_xpath} //project-detail//clr-dg-cell//clr-dg-action-overflow//button[contains(.,"Delete")]
+${project_member_delete_confirmation_xpath} //confiramtion-dialog//button[2]
\ No newline at end of file
diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot
index 552fc57b5..d6bebf6c4 100644
--- a/tests/resources/Harbor-Pages/Project.robot
+++ b/tests/resources/Harbor-Pages/Project.robot
@@ -21,73 +21,77 @@ ${HARBOR_VERSION} v1.1.1
*** Keywords ***
Create An New Project
- [Arguments] ${projectname} ${public}=false
- Sleep 1
- Click Button css=${create_project_button_css}
- Sleep 1
- Log To Console Project Name: ${projectname}
- Input Text xpath=${project_name_xpath} ${projectname}
- Sleep 3
- Run Keyword If '${public}' == 'true' Click Element xpath=${project_public_xpath}
- Click Element css=${project_save_css}
- Sleep 4
- Wait Until Page Contains ${projectname}
- Wait Until Page Contains Project Admin
-
+ [Arguments] ${projectname} ${public}=false
+ Sleep 1
+ Click Button css=${create_project_button_css}
+ Sleep 1
+ Log To Console Project Name: ${projectname}
+ Input Text xpath=${project_name_xpath} ${projectname}
+ Sleep 3
+ Run Keyword If '${public}' == 'true' Click Element xpath=${project_public_xpath}
+ Click Element css=${project_save_css}
+ Sleep 4
+ Wait Until Page Contains ${projectname}
+ Wait Until Page Contains Project Admin
+
Create An New Project With New User
- [Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public}
- Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
+ [Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public}
+ Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
Logout Harbor
Sign In Harbor ${url} ${username} ${newPassword}
- Create An New Project ${projectname} ${public}
+ Create An New Project ${projectname} ${public}
Sleep 1
#It's the log of project.
Go To Project Log
- Click Element xpath=//project-detail//ul/li[3]
- Sleep 2
-
+ Click Element xpath=//project-detail//ul/li[3]
+ Sleep 2
+
+Switch To Member
+ Click Element xpath=//project-detail//li[2]
+ Sleep 1
+
Switch To Log
- Click Element xpath=${log_xpath}
- Sleep 1
+ Click Element xpath=${log_xpath}
+ Sleep 1
Switch To Replication
- Click Element xpath=${replication_xpath}
- Sleep 1
+ Click Element xpath=${replication_xpath}
+ Sleep 1
Back To projects
- Click Element xpath=${projects_xpath}
- Sleep 1
+ Click Element xpath=${projects_xpath}
+ Sleep 1
Project Should Display
- [Arguments] ${projectname}
- Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
+ [Arguments] ${projectname}
+ Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
Project Should Not Display
- [Arguments] ${projectname}
- Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
+ [Arguments] ${projectname}
+ Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
Search Private Projects
- Click element xpath=//select
- Click element xpath=//select/option[@value=1]
- Sleep 1
- Capture Page Screenshot SearchPrivateProjects.png
+ Click element xpath=//select
+ Click element xpath=//select/option[@value=1]
+ Sleep 1
+ Capture Page Screenshot SearchPrivateProjects.png
Make Project Private
- [Arguments] ${projectname}
- Sleep 1
- Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
- Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
+ [Arguments] ${projectname}
+ Sleep 1
+ Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
+ Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
Make Project Public
- [Arguments] ${projectname}
- Sleep 1
- Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
- Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
+ [Arguments] ${projectname}
+ Sleep 1
+ Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
+ Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
Delete Repo
- [Arguments] ${projectname}
- Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
+ [Arguments] ${projectname}
+ Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
Sleep 1
Click Element xpath=//clr-dg-action-overflow//button[contains(.,"Delete")]
Sleep 1
@@ -95,18 +99,18 @@ Delete Repo
Sleep 2
Advanced Search Should Display
- Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
+ Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
# it's not a common keywords, only used into log case.
Do Log Advanced Search
- Capture Page Screenshot LogAdvancedSearch.png
- Sleep 1
- Page Should Contain Element xpath=//clr-dg-row[contains(.,"pull")]
- Page Should Contain Element xpath=//clr-dg-row[contains(.,"push")]
- Page Should Contain Element xpath=//clr-dg-row[contains(.,"create")]
- Page Should Contain Element xpath=//clr-dg-row[contains(.,"delete")]
- Sleep 1
- Click Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
+ Capture Page Screenshot LogAdvancedSearch.png
+ Sleep 1
+ Page Should Contain Element xpath=//clr-dg-row[contains(.,"pull")]
+ Page Should Contain Element xpath=//clr-dg-row[contains(.,"push")]
+ Page Should Contain Element xpath=//clr-dg-row[contains(.,"create")]
+ Page Should Contain Element xpath=//clr-dg-row[contains(.,"delete")]
+ Sleep 1
+ Click Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
Sleep 1
Click Element xpath=//project-detail//audit-log//clr-dropdown/button
Sleep 1
@@ -147,13 +151,13 @@ Expand Repo
[Arguments] ${projectname}
Click Element //repository//clr-dg-row-master[contains(.,'${projectname}')]//button/clr-icon
sleep 1
-
+
Scan Repo
[Arguments] ${projectname}
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow//button[contains(.,'Scan')]
Sleep 15
-
+
Summary Chart Should Display
[Arguments] ${projectname}
Page Should Contain Element //clr-dg-row-master[contains(.,'${projectname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
\ No newline at end of file
diff --git a/tests/resources/Harbor-Pages/Replication.robot b/tests/resources/Harbor-Pages/Replication.robot
index e8cd5579c..7c1eb174e 100644
--- a/tests/resources/Harbor-Pages/Replication.robot
+++ b/tests/resources/Harbor-Pages/Replication.robot
@@ -21,23 +21,23 @@ ${HARBOR_VERSION} v1.1.1
*** Keywords ***
Create An New Rule With New Endpoint
- [Arguments] ${policy_name} ${policy_description} ${destination_name} ${destination_url} ${destination_username} ${destination_password}
+ [Arguments] ${policy_name} ${policy_description} ${destination_name} ${destination_url} ${destination_username} ${destination_password}
Click element xpath=${new_name_xpath}
Sleep 2
- Input Text xpath=${policy_name_xpath} ${policy_name}
+ Input Text xpath=${policy_name_xpath} ${policy_name}
Input Text xpath=${policy_description_xpath} ${policy_description}
-
+
Click element xpath=${policy_enable_checkbox}
Click element xpath=${policy_endpoint_checkbox}
-
+
Input text xpath=${destination_name_xpath} ${destination_name}
Input text xpath=${destination_url_xpath} ${destination_url}
Input text xpath=${destination_username_xpath} ${destination_username}
Input text xpath=${destination_password_xpath} ${destination_password}
Click element xpath=${replicaton_save_xpath}
Sleep 5
- Capture Page Screenshot rule_${policy_name}.png
- Wait Until Page Contains ${policy_name}
- Wait Until Page Contains ${policy_description}
- Wait Until Page Contains ${destination_name}
\ No newline at end of file
+ Capture Page Screenshot rule_${policy_name}.png
+ Wait Until Page Contains ${policy_name}
+ Wait Until Page Contains ${policy_description}
+ Wait Until Page Contains ${destination_name}
\ No newline at end of file
diff --git a/tests/resources/Harbor-Pages/UserProfile.robot b/tests/resources/Harbor-Pages/UserProfile.robot
index 375d1fb30..4d7f462a8 100644
--- a/tests/resources/Harbor-Pages/UserProfile.robot
+++ b/tests/resources/Harbor-Pages/UserProfile.robot
@@ -45,12 +45,12 @@ Update User Comment
Sleep 2
Logout Harbor
- Wait Until Element Is Visible xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
- Wait Until Element Is Enabled xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
+ Wait Until Element Is Visible xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
+ Wait Until Element Is Enabled xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
Sleep 2
Click Element xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header//clr-dropdown//a[4]
- Sleep 1
- Capture Page Screenshot Logout.png
- Sleep 2
+ Sleep 1
+ Capture Page Screenshot Logout.png
+ Sleep 2
Wait Until Keyword Succeeds 5x 1 Page Should Contain Element xpath=//sign-in//form//*[@class="title"]
diff --git a/tests/robot-cases/Group0-BAT/BAT.robot b/tests/robot-cases/Group0-BAT/BAT.robot
index 42ed89267..36b6033d9 100644
--- a/tests/robot-cases/Group0-BAT/BAT.robot
+++ b/tests/robot-cases/Group0-BAT/BAT.robot
@@ -24,7 +24,7 @@ ${HARBOR_URL} http://localhost
*** Test Cases ***
Test Case - Create An New User
Init Chrome Driver
- ${d}= Get Current Date result_format=%m%s
+ ${d}= Get Current Date result_format=%m%s
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
Close Browser
@@ -64,7 +64,7 @@ Test Case - User View Projects
Create An New Project test${d}2
Create An New Project test${d}3
Switch To Log
- Capture Page Screenshot UserViewProjects.png
+ Capture Page Screenshot UserViewProjects.png
Wait Until Page Contains test${d}1
Wait Until Page Contains test${d}2
Wait Until Page Contains test${d}3
@@ -76,7 +76,7 @@ Test Case - Push Image
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
Create An New Project test${d}
- Push image ${ip} tester${d} Test1@34 test${d} hello-world:latest
+ Push image ${ip} tester${d} Test1@34 test${d} hello-world:latest
Go Into Project test${d}
Wait Until Page Contains test${d}/hello-world
@@ -84,18 +84,18 @@ Test Case - User View Logs
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
+ 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
- Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
+ Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest
- Go Into Project project${d}
- Delete Repo project${d}
+ Go Into Project project${d}
+ Delete Repo project${d}
- Go To Project Log
- Advanced Search Should Display
+ Go To Project Log
+ Advanced Search Should Display
- Do Log Advanced Search
+ Do Log Advanced Search
Close Browser
Test Case - Manage project publicity
@@ -135,25 +135,25 @@ Test Case - Manage project publicity
Logout Harbor
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
Project Should Display project${d}
- Close Browser
+ Close Browser
Test Case - Edit Project Creation
- # create normal user and login
+ # create normal user and login
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
- Project Creation Should Display
+ Project Creation Should Display
Logout Harbor
- Sleep 3
+ Sleep 3
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Set Pro Create Admin Only
+ Set Pro Create Admin Only
Logout Harbor
- Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
- Project Creation Should Not Display
- Logout Harbor
+ Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
+ Project Creation Should Not Display
+ Logout Harbor
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Set Pro Create Every One
@@ -163,16 +163,16 @@ Test Case - Edit Self-Registration
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Disable Self Reg
- Logout Harbor
+ Logout Harbor
Sign Up Should Not Display
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Switch To Configure
+ Switch To Configure
Self Reg Should Be Disabled
Sleep 1
- #restore setting
+ #restore setting
Enable Self Reg
Close Browser
@@ -197,13 +197,13 @@ Test Case - Edit Email Settings
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Switch To Email
+ Switch To Email
Config Email
Logout Harbor
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Switch To Email
+ Switch To Email
Verify Email
Close Browser
@@ -211,15 +211,15 @@ Test Case - Edit Email Settings
Test Case - Edit Token Expire
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Switch To System Settings
- Modify Token Expiration 20
+ Switch To System Settings
+ Modify Token Expiration 20
Logout Harbor
- Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
- Switch To System Settings
+ Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
+ Switch To System Settings
Token Must Be Match 20
- #reset to default
+ #reset to default
Modify Token Expiration 30
Close Browser
@@ -228,10 +228,10 @@ Test Case - Create An Replication Rule New Endpoint
${d}= Get current date result_format=%m%s
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Create An New Project project${d}
- Go Into Project project${d}
+ Go Into Project project${d}
Switch To Replication
Create An New Rule With New Endpoint policy_name=test_policy_${d} policy_description=test_description destination_name=test_destination_name_${d} destination_url=test_destination_url_${d} destination_username=test_destination_username destination_password=test_destination_password
- Close Browser
+ Close Browser
Test Case - Scan A Tag
Init Chrome Driver
@@ -242,7 +242,33 @@ Test Case - Scan A Tag
Expand Repo project${d}
Scan Repo project${d}
Summary Chart Should Display project${d}
- Close Browser
+ Close Browser
+
+Test Case-Manage Project Member
+ Init Chrome Driver
+ ${d}= Get current Date result_format=%m%s
+
+ Create An New Project With New User url=${HARBOR_URL} username=alice${d} email=alice${d}@vmware.com realname=alice${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=false
+ Push image ip=${ip} user=alice${d} pwd=Test1@34 project=project${d} image=hello-world
+ Logout Harbor
+ Create An New User url=${HARBOR_URL} username=bob${d} email=bob${d}@vmware.com realname=bob${d} newPassword=Test1@34 comment=habor
+ Logout Harbor
+ Create An New User url=${HARBOR_URL} username=carol${d} email=carol${d}@vmware.com realname=carol${d} newPassword=Test1@34 comment=harbor
+ Logout Harbor
+
+ User Should Be Owner Of Project alice${d} Test1@34 project${d}
+ User Should Not Be A Member Of Project bob${d} Test1@34 project${d}
+ Manage Project Member alice${d} Test1@34 project${d} bob${d} Add
+ User Should Be Guest bob${d} Test1@34 project${d}
+ Change User Role In Project alice${d} Test1@34 project${d} bob${d} Developer
+ User Should Be Developer bob${d} Test1@34 project${d}
+ Change User Role In Project alice${d} Test1@34 project${d} bob${d} Admin
+ User Should Be Admin bob${d} Test1@34 project${d} carol${d}
+ Manage Project Member alice${d} Test1@34 project${d} bob${d} Remove
+ User Should Not Be A Member Of Project bob${d} Test1@34 project${d}
+ User Should Be Guest carol${d} Test1@34 project${d}
+
+ Close Browser
Test Case - Assign Sys Admin
Init Chrome Driver
@@ -273,8 +299,7 @@ Test Case - Admin Push Signed Image
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
Log To Console ${output}
- Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
-
+ Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-push-image.sh
Log To Console ${output}
Should Be Equal As Integers ${rc} 0
@@ -289,4 +314,4 @@ Test Case - Admin Push Un-Signed Image
Log To Console ${output}
Test Case - Clean Harbor Images
- Down Harbor with_notary=true
\ No newline at end of file
+ Down Harbor with_notary=true
diff --git a/tests/robot-cases/Group9-Content-trust/notary-push-image.sh b/tests/robot-cases/Group9-Content-trust/notary-push-image.sh
index 975653ad8..3c4849829 100755
--- a/tests/robot-cases/Group9-Content-trust/notary-push-image.sh
+++ b/tests/robot-cases/Group9-Content-trust/notary-push-image.sh
@@ -1,12 +1,24 @@
#!/bin/bash
-docker pull tomcat
+docker pull tomcat:latest
IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
+PASSHRASE='Harbor12345'
+
+echo $IP
+
export DOCKER_CONTENT_TRUST=1
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
-docker login -u admin -p Harbor12345 $IP
+export NOTARY_ROOT_PASSPHRASE=$PASSHRASE
+export NOTARY_TARGETS_PASSPHRASE=$PASSHRASE
+export NOTARY_SNAPSHOT_PASSPHRASE=$PASSHRASE
+export DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=$PASSHRASE
+export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$PASSHRASE
+export DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE=$PASSHRASE
+export DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE=$PASSHRASE
+docker login -u admin -p Harbor12345 $IP
docker tag tomcat $IP/library/tomcat:latest
-python ./tests/robot-cases/Group9-Content-trust/notary-push-image.py
+docker push $IP/library/tomcat:latest
+