diff --git a/src/portal/src/app/user/new-user-modal.component.html b/src/portal/src/app/user/new-user-modal.component.html index e952810c7..b73b3270f 100644 --- a/src/portal/src/app/user/new-user-modal.component.html +++ b/src/portal/src/app/user/new-user-modal.component.html @@ -7,6 +7,6 @@ - \ No newline at end of file + diff --git a/src/portal/src/app/user/user.component.html b/src/portal/src/app/user/user.component.html index ed72c544c..d089f7561 100644 --- a/src/portal/src/app/user/user.component.html +++ b/src/portal/src/app/user/user.component.html @@ -11,7 +11,7 @@
- + {{'BUTTON.ACTIONS' | translate}} diff --git a/tests/resources/Harbor-Pages/Administration-Users.robot b/tests/resources/Harbor-Pages/Administration-Users.robot index be3a67571..c89858296 100644 --- a/tests/resources/Harbor-Pages/Administration-Users.robot +++ b/tests/resources/Harbor-Pages/Administration-Users.robot @@ -46,3 +46,15 @@ User Email Should Exist Add User Button Should Be Disabled Sleep 1 Retry Wait Until Page Contains Element //button[contains(.,'New') and @disabled=''] + +Add A New User + [Arguments] ${username} ${email} ${realname} ${newPassword} ${comment} + Retry Element Click xpath=${add_new_user_button} + Retry Text Input xpath=${username_xpath} ${username} + Retry Text Input xpath=${email_xpath} ${email} + Retry Text Input xpath=${realname_xpath} ${realname} + Retry Text Input xpath=${newPassword_xpath} ${newPassword} + Retry Text Input xpath=${confirmPassword_xpath} ${newPassword} + Retry Text Input xpath=${comment_xpath} ${comment} + Retry Element Click xpath=${save_new_user_button} + Retry Wait Until Page Contains Element xpath=//harbor-user//clr-dg-row//clr-dg-cell[contains(., '${username}')] diff --git a/tests/resources/Harbor-Pages/Administration-Users_Elements.robot b/tests/resources/Harbor-Pages/Administration-Users_Elements.robot index e8071153d..9b950d179 100644 --- a/tests/resources/Harbor-Pages/Administration-Users_Elements.robot +++ b/tests/resources/Harbor-Pages/Administration-Users_Elements.robot @@ -17,4 +17,6 @@ Documentation This resource provides any keywords related to the Harbor private *** Variables *** ${administration_user_tag_xpath} //clr-vertical-nav-group-children/a[contains(.,'Users')] -${administration_tag_xpath} //clr-vertical-nav-group[contains(.,'Admin')] \ No newline at end of file +${administration_tag_xpath} //clr-vertical-nav-group[contains(.,'Admin')] +${add_new_user_button} //*[@id='add-new-user'] +${save_new_user_button} //*[@id='save-button'] diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 0e3e89393..2bc361122 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -755,4 +755,22 @@ Test Case - Read Only Mode Disable Read Only Sleep 5 Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} busybox:latest - Close Browser \ No newline at end of file + Close Browser +Test Case - Admin Add New Users + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + # can add a new user when self-reg is enbled + Switch To Configure + Self Reg Should Be Enabled + Switch to User Tag + Add A New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest + # can add a new user when self-reg is disabled + Switch To Configure + Self Reg Should Be Enabled + Sleep 1 + Disable Self Reg + Self Reg Should Be Disabled + Switch to User Tag + Add A New User username=tester2${d} email=tester2${d}@vmware.com realname=harbortest2 newPassword=Test1@34 comment=harbortest2 + Close Browser