2018-09-19 18:57:15 +02:00
|
|
|
// Copyright Project Harbor Authors
|
2018-07-19 11:02:09 +02:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
*** Settings ***
|
|
|
|
Documentation Harbor BATs
|
|
|
|
Resource ../../resources/Util.robot
|
|
|
|
Default Tags Nightly
|
|
|
|
|
|
|
|
*** Variables ***
|
|
|
|
${HARBOR_URL} https://${ip}
|
|
|
|
${SSH_USER} root
|
|
|
|
${HARBOR_ADMIN} admin
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
Test Case - Create An New User
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
2019-10-28 08:56:35 +01:00
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Configure
|
|
|
|
Self Reg Should Be Disabled
|
|
|
|
Sleep 1
|
2019-10-21 08:34:34 +02:00
|
|
|
Enable Self Reg
|
2019-10-28 08:56:35 +01:00
|
|
|
Logout Harbor
|
|
|
|
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@harbortest.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
2018-07-19 11:02:09 +02:00
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Update User Comment
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@harbortest.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
2018-07-19 11:02:09 +02:00
|
|
|
Update User Comment Test12#4
|
|
|
|
Logout Harbor
|
|
|
|
|
|
|
|
Test Case - Update Password
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@harbortest.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
2018-07-19 11:02:09 +02:00
|
|
|
Change Password Test1@34 Test12#4
|
|
|
|
Logout Harbor
|
|
|
|
Sign In Harbor ${HARBOR_URL} tester${d} Test12#4
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Delete Multi User
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User ${HARBOR_URL} deletea${d} testa${d}@harbortest.com test${d} Test1@34 harbor
|
2018-07-19 11:02:09 +02:00
|
|
|
Logout Harbor
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User ${HARBOR_URL} deleteb${d} testb${d}@harbortest.com test${d} Test1@34 harbor
|
2018-07-19 11:02:09 +02:00
|
|
|
Logout Harbor
|
2021-05-11 08:55:14 +02:00
|
|
|
Create An New User ${HARBOR_URL} deletec${d} testc${d}@harbortest.com test${d} Test1@34 harbor
|
2018-07-19 11:02:09 +02:00
|
|
|
Logout Harbor
|
|
|
|
Sign In Harbor ${HARBOR_URL} admin Harbor12345
|
|
|
|
Switch To User Tag
|
|
|
|
Filter Object delete
|
|
|
|
Multi-delete User deletea deleteb deletec
|
|
|
|
# Assert delete
|
|
|
|
Delete Success deletea deleteb deletec
|
|
|
|
Sleep 1
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Edit Self-Registration
|
|
|
|
Init Chrome Driver
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Disable Self Reg
|
|
|
|
Logout Harbor
|
|
|
|
|
|
|
|
Sign Up Should Not Display
|
|
|
|
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Configure
|
|
|
|
Self Reg Should Be Disabled
|
|
|
|
Sleep 1
|
|
|
|
|
|
|
|
# Restore setting
|
|
|
|
Enable Self Reg
|
|
|
|
Close Browser
|
2020-04-29 23:42:21 +02:00
|
|
|
|
|
|
|
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
|
2021-05-11 08:55:14 +02:00
|
|
|
Add A New User username=tester${d} email=tester${d}@harbortest.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
2020-04-29 23:42:21 +02:00
|
|
|
# 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
|
2021-05-11 08:55:14 +02:00
|
|
|
Add A New User username=tester2${d} email=tester2${d}@harbortest.com realname=harbortest2 newPassword=Test1@34 comment=harbortest2
|
2020-04-29 23:42:21 +02:00
|
|
|
Close Browser
|