Add wait until in <Multi-delete Object> and <Project Should Display>

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-01-11 11:26:10 +08:00
parent 0b27037e34
commit 73b9e95464
6 changed files with 39 additions and 20 deletions

View File

@ -63,15 +63,16 @@ Switch To Replication
Click Element xpath=${project_replication_xpath}
Sleep 1
Back To projects
Wait Until Element Is Enabled xpath=${projects_xpath}
Wait Until Element Is Visible xpath=${projects_xpath}
Click Element xpath=${projects_xpath}
Back To Projects
${element}= Set Variable xpath=${projects_xpath}
Wait Until Element Is Visible And Enabled ${element}
Click Element ${element}
Sleep 2
Project Should Display
[Arguments] ${projectname}
Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
${element}= Set Variable xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
Wait Until Element Is Visible And Enabled ${element}
Project Should Not Display
[Arguments] ${projectname}

View File

@ -37,27 +37,37 @@ Delete Fail
Filter Object
#Filter project repo user tag.
[Arguments] ${kw}
Click Element xpath=//hbr-filter//clr-icon
Input Text xpath=//hbr-filter//input ${kw}
Sleep 1
${element}= Set Variable xpath=//hbr-filter//clr-icon
Wait Until Element Is Visible And Enabled ${element}
Click Element ${element}
${element}= Set Variable xpath=//hbr-filter//input
Wait Until Element Is Visible And Enabled ${element}
Input Text ${element} ${kw}
Sleep 3
Select Object
#select single element such as user project repo tag
[Arguments] ${obj}
Click Element //clr-dg-row[contains(.,'${obj}')]//label
${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label
Wait Until Element Is Visible And Enabled ${element}
Click Element ${element}
# This func cannot support as the delete user flow changed.
Multi-delete Object
[Arguments] @{obj}
:For ${obj} in @{obj}
\ Click Element //clr-dg-row[contains(.,'${obj}')]//label
Sleep 1
\ ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label
\ Wait Until Element Is Visible And Enabled ${element}
\ Click Element ${element}
Capture Page Screenshot
Click Element //button[contains(.,'Delete')]
Sleep 2
${element}= Set Variable xpath=//button[contains(.,'Delete')]
Wait Until Element Is Visible And Enabled ${element}
Click Element ${element}
Capture Page Screenshot
Click Element //clr-modal//button[contains(.,'DELETE')]
Sleep 3
${element}= Set Variable xpath=//clr-modal//button[contains(.,'DELETE')]
Wait Until Element Is Visible And Enabled ${element}
Click Element ${element}
Capture Page Screenshot
Multi-delete User

View File

@ -63,6 +63,9 @@ Enable Scan On Push
Sleep 10
Vulnerability Not Ready Project Hint
Page Should Contain Element //span[contains(@class, "db-status-warning")]
${element}= Set Variable xpath=//span[contains(@class, "db-status-warning")]
Wait Until Element Is Visible And Enabled ${element}
Vulnerability Not Ready Config Hint
Page Should Contain Element //vulnerability-config//clr-tooltip
${element}= Set Variable xpath=//vulnerability-config//clr-tooltip
Wait Until Element Is Visible And Enabled ${element}

View File

@ -62,6 +62,11 @@ Resource Nightly-Util.robot
Resource APITest-Util.robot
*** Keywords ***
Wait Until Element Is Visible And Enabled
[Arguments] ${element}
Wait Until Element Is Visible ${element}
Wait Until Element Is Enabled ${element}
Wait Unitl Vul Data Ready
[Arguments] ${url} ${timeout} ${interval}
${n}= Evaluate ${timeout}/${interval}

View File

@ -83,7 +83,7 @@ Test Case - Delete A Project
Project Should Not Be Deleted project${d}
Go Into Project project${d}
Delete Repo project${d}
Back To projects
Back To Projects
Project Should Be Deleted project${d}
Close Browser
@ -714,7 +714,7 @@ Test Case - Retag A Image Tag
Retag Image ${image_tag} project${random_num2} ${target_image_name} ${target_tag_value}
Wait Until Element Is Not Visible css=${modal-dialog}
Back To projects
Back To Projects
Go Into Project project${random_num2}
Sleep 1
Page Should Contain ${target_image_name}

View File

@ -524,7 +524,7 @@ Test Case - Delete A Project
Project Should Not Be Deleted project${d}
Go Into Project project${d}
Delete Repo project${d}
Back To projects
Back To Projects
Project Should Be Deleted project${d}
Close Browser