2017-08-07 08:02:38 +02:00
|
|
|
# Copyright 2016-2017 VMware, Inc. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# 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 ***
|
|
|
|
${HARBOR_VERSION} v1.1.1
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
Create An New Project
|
2017-09-07 12:29:05 +02:00
|
|
|
[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}
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//button[contains(.,'OK')]
|
2017-09-07 12:29:05 +02:00
|
|
|
Sleep 4
|
|
|
|
Wait Until Page Contains ${projectname}
|
|
|
|
Wait Until Page Contains Project Admin
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Create An New Project With New User
|
2017-09-07 12:29:05 +02:00
|
|
|
[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}
|
2017-08-07 08:02:38 +02:00
|
|
|
Logout Harbor
|
|
|
|
Sign In Harbor ${url} ${username} ${newPassword}
|
2017-09-07 12:29:05 +02:00
|
|
|
Create An New Project ${projectname} ${public}
|
2017-08-07 08:02:38 +02:00
|
|
|
Sleep 1
|
|
|
|
|
|
|
|
#It's the log of project.
|
|
|
|
Go To Project Log
|
2017-09-07 12:29:05 +02:00
|
|
|
Click Element xpath=//project-detail//ul/li[3]
|
|
|
|
Sleep 2
|
|
|
|
|
|
|
|
Switch To Member
|
|
|
|
Click Element xpath=//project-detail//li[2]
|
|
|
|
Sleep 1
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Switch To Log
|
2017-09-07 12:29:05 +02:00
|
|
|
Click Element xpath=${log_xpath}
|
|
|
|
Sleep 1
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Switch To Replication
|
2018-01-04 04:31:25 +01:00
|
|
|
Click Element xpath=${project_replication_xpath}
|
2017-09-07 12:29:05 +02:00
|
|
|
Sleep 1
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Back To projects
|
2017-09-07 12:29:05 +02:00
|
|
|
Click Element xpath=${projects_xpath}
|
2018-01-23 06:04:19 +01:00
|
|
|
Sleep 2
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Project Should Display
|
2017-09-07 12:29:05 +02:00
|
|
|
[Arguments] ${projectname}
|
|
|
|
Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Project Should Not Display
|
2017-09-07 12:29:05 +02:00
|
|
|
[Arguments] ${projectname}
|
|
|
|
Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Search Private Projects
|
2017-09-07 12:29:05 +02:00
|
|
|
Click element xpath=//select
|
|
|
|
Click element xpath=//select/option[@value=1]
|
|
|
|
Sleep 1
|
|
|
|
Capture Page Screenshot SearchPrivateProjects.png
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Make Project Private
|
2017-09-07 12:29:05 +02:00
|
|
|
[Arguments] ${projectname}
|
2017-12-21 04:00:12 +01:00
|
|
|
Go Into Project ${project name}
|
2017-09-07 12:29:05 +02:00
|
|
|
Sleep 1
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//project-detail//a[contains(.,'Configuration')]
|
|
|
|
Checkbox Should Be Selected xpath=//input[@name='public']
|
|
|
|
Click Element //clr-checkbox[@name='public']//label
|
|
|
|
Click Element //button[contains(.,'SAVE')]
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Make Project Public
|
2017-09-07 12:29:05 +02:00
|
|
|
[Arguments] ${projectname}
|
2017-12-21 04:00:12 +01:00
|
|
|
Go Into Project ${project name}
|
2017-09-07 12:29:05 +02:00
|
|
|
Sleep 1
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//project-detail//a[contains(.,'Configuration')]
|
|
|
|
Checkbox Should Not Be Selected xpath=//input[@name='public']
|
|
|
|
Click Element //clr-checkbox[@name='public']//label
|
|
|
|
Click Element //button[contains(.,'SAVE')]
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
Delete Repo
|
2017-09-07 12:29:05 +02:00
|
|
|
[Arguments] ${projectname}
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//clr-dg-row[contains(.,"${projectname}")]//clr-checkbox//label
|
2017-08-07 08:02:38 +02:00
|
|
|
Sleep 1
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//button[contains(.,"Delete")]
|
2017-08-07 08:02:38 +02:00
|
|
|
Sleep 1
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//clr-modal//button[2]
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//button[contains(.,"CLOSE")]
|
2017-08-07 08:02:38 +02:00
|
|
|
|
2017-10-27 11:20:20 +02:00
|
|
|
Delete Project
|
2017-12-25 03:33:52 +01:00
|
|
|
[Arguments] ${projectname}
|
2017-10-27 11:20:20 +02:00
|
|
|
Sleep 1
|
2017-12-21 04:00:12 +01:00
|
|
|
Click Element xpath=//clr-dg-row[contains(.,"${projectname}")]//clr-checkbox//label
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//button[contains(.,"Delete")]
|
2018-01-25 13:35:44 +01:00
|
|
|
Sleep 2
|
2017-10-27 11:20:20 +02:00
|
|
|
|
|
|
|
Project Should Not Be Deleted
|
|
|
|
[Arguments] ${projname}
|
|
|
|
Delete Project ${projname}
|
|
|
|
Sleep 1
|
2017-10-31 08:25:35 +01:00
|
|
|
Page Should Contain ${projname}
|
2017-10-27 11:20:20 +02:00
|
|
|
|
|
|
|
Project Should Be Deleted
|
|
|
|
[Arguments] ${projname}
|
|
|
|
Delete Project ${projname}
|
|
|
|
Sleep 2
|
|
|
|
Page Should Not Contain ${projname}
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Advanced Search Should Display
|
2017-09-07 12:29:05 +02:00
|
|
|
Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
# it's not a common keywords, only used into log case.
|
|
|
|
Do Log Advanced Search
|
2017-09-07 12:29:05 +02:00
|
|
|
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
|
2017-08-07 08:02:38 +02:00
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//project-detail//audit-log//clr-dropdown/button
|
|
|
|
Sleep 1
|
|
|
|
#pull log
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Pull")]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"pull")]
|
|
|
|
#push log
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown/button
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Push")]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"push")]
|
|
|
|
#create log
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown/button
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Create")]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"create")]
|
|
|
|
#delete log
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown/button
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Delete")]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"delete")]
|
|
|
|
#others
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown/button
|
|
|
|
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Others")]
|
|
|
|
Sleep 1
|
2017-11-13 07:49:06 +01:00
|
|
|
Click Element xpath=//audit-log//hbr-filter//clr-icon
|
|
|
|
Input Text xpath=//audit-log//hbr-filter//input harbor
|
|
|
|
Sleep 1
|
|
|
|
Capture Page Screenshot LogAdvancedSearch2.png
|
|
|
|
${rc} = Get Matching Xpath Count //audit-log//clr-dg-row
|
|
|
|
Should Be Equal As Integers ${rc} 0
|
2017-08-07 08:02:38 +02:00
|
|
|
|
2017-12-08 08:05:52 +01:00
|
|
|
Go Into Repo
|
|
|
|
[Arguments] ${repoName}
|
|
|
|
Sleep 2
|
2018-01-12 03:42:17 +01:00
|
|
|
Click Element xpath=//hbr-filter//clr-icon
|
2017-12-08 08:05:52 +01:00
|
|
|
Sleep 2
|
2018-01-12 03:42:17 +01:00
|
|
|
Input Text xpath=//hbr-filter//input ${repoName}
|
|
|
|
Sleep 3
|
2017-12-08 08:05:52 +01:00
|
|
|
Wait Until Page Contains ${repoName}
|
2018-01-12 03:42:17 +01:00
|
|
|
Click Element xpath=//clr-dg-cell[contains(.,${repoName})]/a
|
2017-12-08 08:05:52 +01:00
|
|
|
Sleep 2
|
|
|
|
Capture Page Screenshot gointo_${repoName}.png
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Expand Repo
|
|
|
|
[Arguments] ${projectname}
|
2017-12-25 03:33:52 +01:00
|
|
|
Click Element //repository//clr-dg-row[contains(.,'${projectname}')]//button/clr-icon
|
2017-12-21 04:00:12 +01:00
|
|
|
Sleep 1
|
2017-09-07 12:29:05 +02:00
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Scan Repo
|
2017-10-12 05:31:44 +02:00
|
|
|
[Arguments] ${tagname}
|
2017-12-21 04:00:12 +01:00
|
|
|
#select one tag
|
|
|
|
Click Element //clr-dg-row[contains(.,"${tagname}")]//label
|
|
|
|
Click Element //button[contains(.,'Scan')]
|
2017-08-07 08:02:38 +02:00
|
|
|
Sleep 15
|
2017-09-07 12:29:05 +02:00
|
|
|
|
2017-12-08 08:05:52 +01:00
|
|
|
Edit Repo Info
|
|
|
|
Click Element //*[@id="repo-info"]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Contain Element //*[@id="info"]/form/div[2]/h3
|
|
|
|
# Cancel input
|
|
|
|
Click Element xpath=//*[@id="info-edit-button"]/button
|
|
|
|
Input Text xpath=//*[@id="info"]/form/div[2]/textarea test_description_info
|
|
|
|
Click Element xpath=//*[@id="info"]/form/div[3]/button[2]
|
|
|
|
Sleep 1
|
|
|
|
Click Element xpath=//*[@id="info"]/form/confirmation-dialog/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Contain Element //*[@id="info"]/form/div[2]/h3
|
|
|
|
# Confirm input
|
|
|
|
Click Element xpath=//*[@id="info-edit-button"]/button
|
|
|
|
Input Text xpath=//*[@id="info"]/form/div[2]/textarea test_description_info
|
|
|
|
Click Element xpath=//*[@id="info"]/form/div[3]/button[1]
|
|
|
|
Sleep 1
|
|
|
|
Page Should Contain test_description_info
|
|
|
|
Capture Page Screenshot RepoInfo.png
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
Summary Chart Should Display
|
2017-10-12 05:31:44 +02:00
|
|
|
[Arguments] ${tagname}
|
2017-12-25 03:33:52 +01:00
|
|
|
Page Should Contain Element //clr-dg-row[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|