mirror of
https://github.com/goharbor/harbor.git
synced 2024-08-20 11:02:58 +02:00
73 lines
3.1 KiB
Plaintext
73 lines
3.1 KiB
Plaintext
*** 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
|
|
Retry Element Click //vulnerability-config//cron-selection//button[contains(.,'EDIT')]
|
|
Retry Element Click //vulnerability-config//cron-selection//select[@id='selectPolicy']
|
|
Retry Element Click //vulnerability-config//cron-selection//select[@id='selectPolicy']//option[contains(.,'None')]
|
|
Retry Element Click //cron-selection//button[contains(.,'SAVE')]
|
|
|
|
Go To Vulnerability Config
|
|
Retry Element Click //config//button[contains(.,'Vulnerability')]
|
|
|
|
Trigger Scan Now
|
|
Retry Element Click //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
|
|
Retry Element Click //project-detail//div[@id='prevent-vulenrability-image']//label
|
|
Checkbox Should Be Selected //project-detail//clr-checkbox-wrapper//input[@name='prevent-vulenrability-image-input']
|
|
Retry Element Click //project-detail//select
|
|
#wait for dropdown popup
|
|
Sleep 1
|
|
Select From List By Index //project-detail//select ${level}
|
|
Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')]
|
|
|
|
Scan Is Disabled
|
|
Retry Wait Until Page Contains Element //button[contains(.,'Scan') and @disabled='']
|
|
|
|
Move To Summary Chart
|
|
Sleep 2
|
|
Wait Until Element Is Visible //hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
|
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
|
|
Retry Element Click //clr-dg-row[contains(.,'${tagname}')]//label
|
|
Retry Element Click //button[contains(.,'Scan')]
|
|
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
|
|
|
|
|
|
Summary Chart Should Display
|
|
[Arguments] ${tagname}
|
|
Retry Wait Until Page Contains Element //clr-dg-row[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
|
|
|
Enable Scan On Push
|
|
Checkbox Should Not Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input
|
|
Retry Element Click //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//label
|
|
Checkbox Should Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input
|
|
Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')]
|
|
Sleep 10
|
|
|
|
Vulnerability Not Ready Project Hint
|
|
Sleep 2
|
|
${element}= Set Variable xpath=//span[contains(@class, 'db-status-warning')]
|
|
Wait Until Element Is Visible And Enabled ${element}
|
|
|
|
Vulnerability Not Ready Config Hint
|
|
${element}= Set Variable xpath=//vulnerability-config//clr-tooltip
|
|
Wait Until Element Is Visible And Enabled ${element}
|