2018-09-19 18:57:15 +02:00
# Copyright Project Harbor Authors
2017-08-07 08:02:38 +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 This resource provides any keywords related to the Harbor private registry appliance
Resource ../../resources/Util.robot
*** Variables ***
*** Keywords ***
Assign User Admin
[Arguments] ${user}
2019-12-24 04:40:10 +01:00
Retry Element Click xpath=//harbor-user//hbr-filter//clr-icon
2017-12-25 03:33:52 +01:00
Input Text xpath=//harbor-user//hbr-filter//input ${user}
2017-08-07 08:02:38 +02:00
Sleep 2
2017-12-21 04:00:12 +01:00
#select checkbox
2019-12-24 04:40:10 +01:00
Retry Element Click //clr-dg-row[contains(.,'${user}')]//label
2017-12-21 04:00:12 +01:00
#click assign admin
2019-12-24 04:40:10 +01:00
Retry Element Click //*[@id='set-admin']
2017-08-07 08:02:38 +02:00
Sleep 1
Switch to User Tag
2019-12-24 04:40:10 +01:00
Retry Element Click xpath=${administration_user_tag_xpath}
2017-08-07 08:02:38 +02:00
Sleep 1
Administration Tag Should Display
2019-12-24 04:40:10 +01:00
Retry Wait Until Page Contains Element xpath=${administration_tag_xpath}
2018-01-02 11:28:48 +01:00
User Email Should Exist
[Arguments] ${email}
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Switch to User Tag
2019-12-24 04:40:10 +01:00
Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '${email}')]
2018-03-28 10:45:49 +02:00
Add User Button Should Be Disabled
Sleep 1
2019-12-24 04:40:10 +01:00
Retry Wait Until Page Contains Element //button[contains(.,'New') and @disabled='']
2020-04-27 11:38:04 +02:00
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}
2020-04-22 10:44:10 +02:00
Retry Double Keywords When Error Retry Element Click xpath=${save_new_user_button} Retry Wait Until Page Not Contains Element xpath=${save_new_user_button}
2020-04-27 11:38:04 +02:00
Retry Wait Until Page Contains Element xpath=//harbor-user//clr-dg-row//clr-dg-cell[contains(., '${username}')]