2018-03-12 07:20:37 +01:00
|
|
|
*** 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 ***
|
|
|
|
Disable Scan Schedule
|
2018-10-19 07:14:43 +02:00
|
|
|
Click Element //vulnerability-config//button[@id="editSchedule"]
|
2018-03-12 07:20:37 +01:00
|
|
|
Click Element //vulnerability-config//select[@id="scanAllPolicy"]
|
|
|
|
Click Element //vulnerability-config//select[@id="scanAllPolicy"]//option[contains(.,'None')]
|
2018-11-01 02:38:49 +01:00
|
|
|
Click Element //button[@id="config_vulnerbility_save"]
|
2018-03-12 07:20:37 +01:00
|
|
|
|
|
|
|
Go To Vulnerability Config
|
|
|
|
Click Element //config//button[contains(.,'Vulnerability')]
|
|
|
|
|
|
|
|
Trigger Scan Now
|
|
|
|
Click Element //config//button[contains(.,'NOW')]
|
|
|
|
Sleep 10
|
|
|
|
|
|
|
|
Set Vulnerabilty Serverity
|
|
|
|
#0 is high 1 is medium 2 is low 3 is negligible
|
|
|
|
[Arguments] ${level}
|
|
|
|
Goto Project Config
|
|
|
|
#enable first
|
2018-12-29 10:01:43 +01:00
|
|
|
Click Element //project-detail//div[@id="prevent-vulenrability-image"]//label
|
|
|
|
Checkbox Should Be Selected //project-detail//clr-checkbox-wrapper//input[@name="prevent-vulenrability-image-input"]
|
2018-03-12 07:20:37 +01:00
|
|
|
Click Element //project-detail//select
|
|
|
|
#wait for dropdown popup
|
|
|
|
Sleep 1
|
|
|
|
Select From List By Index //project-detail//select ${level}
|
|
|
|
Click Element //hbr-project-policy-config//button[contains(.,'SAVE')]
|
|
|
|
|
|
|
|
Scan Is Disabled
|
|
|
|
Page Should Contain Element //button[contains(.,'Scan') and @disabled='']
|
|
|
|
|
|
|
|
Move To Summary Chart
|
2018-03-20 06:25:03 +01:00
|
|
|
Sleep 2
|
2018-10-11 04:39:25 +02:00
|
|
|
Wait Until Element Is Visible //hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
2018-03-12 07:20:37 +01:00
|
|
|
Mouse Over //hbr-vulnerability-summary-chart
|
|
|
|
Sleep 1
|
|
|
|
|
|
|
|
Scan Repo
|
|
|
|
#use fail for image clair can not scan, otherwise use success
|
|
|
|
[Arguments] ${tagname} ${status}
|
|
|
|
#select one tag
|
|
|
|
Click Element //clr-dg-row[contains(.,"${tagname}")]//label
|
|
|
|
Click Element //button[contains(.,'Scan')]
|
2018-10-10 04:38:48 +02:00
|
|
|
Run Keyword If '${status}' == 'Succeed' Wait Until Element Is Visible //hbr-vulnerability-bar//hbr-vulnerability-summary-chart 300
|
|
|
|
Run Keyword If '${status}' == 'Fail' Wait Until Element Is Visible //hbr-vulnerability-bar//a 300
|
2018-03-12 07:20:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
Summary Chart Should Display
|
|
|
|
[Arguments] ${tagname}
|
|
|
|
Page Should Contain Element //clr-dg-row[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
|
|
|
|
|
|
|
Enable Scan On Push
|
2018-12-29 10:01:43 +01:00
|
|
|
Checkbox Should Not Be Selected //clr-checkbox-wrapper[@id="scan-image-on-push-wrapper"]//input
|
|
|
|
Click Element //clr-checkbox-wrapper[@id="scan-image-on-push-wrapper"]//label
|
|
|
|
Checkbox Should Be Selected //clr-checkbox-wrapper[@id="scan-image-on-push-wrapper"]//input
|
2018-03-12 07:20:37 +01:00
|
|
|
Click Element //hbr-project-policy-config//button[contains(.,'SAVE')]
|
2018-07-19 11:02:09 +02:00
|
|
|
Sleep 10
|
2018-03-12 07:20:37 +01:00
|
|
|
|
|
|
|
Vulnerability Not Ready Project Hint
|
2019-01-11 04:26:10 +01:00
|
|
|
${element}= Set Variable xpath=//span[contains(@class, "db-status-warning")]
|
|
|
|
Wait Until Element Is Visible And Enabled ${element}
|
|
|
|
|
2018-03-12 07:20:37 +01:00
|
|
|
Vulnerability Not Ready Config Hint
|
2019-01-11 04:26:10 +01:00
|
|
|
${element}= Set Variable xpath=//vulnerability-config//clr-tooltip
|
|
|
|
Wait Until Element Is Visible And Enabled ${element}
|