test case Disable Scan Schedule failed at page should contain part, it missing wait until and retry, so add one (#7228)

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-03-27 15:33:31 +08:00 committed by GitHub
parent 03709e4ec1
commit 6b19b99c97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

@ -7,16 +7,16 @@ Resource ../../resources/Util.robot
*** Keywords ***
Disable Scan Schedule
Click Element //vulnerability-config//cron-selection//button[contains(.,'EDIT')]
Click Element //vulnerability-config//cron-selection//select[@id='selectPolicy']
Click Element //vulnerability-config//cron-selection//select[@id='selectPolicy']//option[contains(.,'None')]
Click Element //cron-selection//button[contains(.,'SAVE')]
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
Click Element //config//button[contains(.,'Vulnerability')]
Retry Element Click //config//button[contains(.,'Vulnerability')]
Trigger Scan Now
Click Element //config//button[contains(.,'NOW')]
Retry Element Click //config//button[contains(.,'NOW')]
Sleep 10
Set Vulnerabilty Serverity
@ -24,16 +24,16 @@ Set Vulnerabilty Serverity
[Arguments] ${level}
Goto Project Config
#enable first
Click Element //project-detail//div[@id='prevent-vulenrability-image']//label
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']
Click Element //project-detail//select
Retry Element Click //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')]
Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')]
Scan Is Disabled
Page Should Contain Element //button[contains(.,'Scan') and @disabled='']
Retry Wait Until Page Contains Element //button[contains(.,'Scan') and @disabled='']
Move To Summary Chart
Sleep 2
@ -45,21 +45,21 @@ 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')]
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}
Page Should Contain Element //clr-dg-row[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
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
Click Element //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//label
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
Click Element //hbr-project-policy-config//button[contains(.,'SAVE')]
Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')]
Sleep 10
Vulnerability Not Ready Project Hint

View File

@ -272,7 +272,7 @@ Test Case - Disable Scan Schedule
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure
Go To Vulnerability Config
Page Should Contain None
Retry Wait Until Page Contains None
Close Browser
Test Case - User View Projects