Add a big loop for keyword Go Into Project to make sure if project was not found, search it again

Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
This commit is contained in:
Danfeng Liu (c) 2019-11-22 15:02:40 +08:00
parent 1823e6f135
commit 08bedb8376

View File

@ -21,16 +21,17 @@ Resource ../../resources/Util.robot
*** Keywords *** *** Keywords ***
Go Into Project Go Into Project
[Arguments] ${project} ${has_image}=${true} [Arguments] ${project} ${has_image}=${true}
Sleep 2 :For ${n} IN RANGE 1 5
Retry Wait Element ${search_input} \ Sleep 2
Input Text ${search_input} ${project} \ Retry Wait Element ${search_input}
Retry Wait Until Page Contains ${project} \ Retry Clear Element Text ${search_input}
\ Input Text ${search_input} ${project}
#To prevent waiting for a fixed-period of time for page loading and failure caused by exception, we add loop to re-run <Wait Until Element Is Visible And Enabled> when \ Retry Wait Until Page Contains ${project}
# exception was caught. \ ${out} Run Keyword If ${has_image}==${false} Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")]
${out} Run Keyword If ${has_image}==${false} Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")] \ ... ELSE Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//project-detail//hbr-repository-gridview//clr-dg-cell[contains(.,'${project}/')]
... ELSE Retry Double Keywords When Error Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a Wait Until Element Is Visible And Enabled xpath=//project-detail//hbr-repository-gridview//clr-dg-cell[contains(.,'${project}/')] \ Log To Console ${out}
Log To Console ${out} \ Run Keyword If ${out} == 'PASS' Exit For Loop
\ Sleep 1
Should Be Equal ${out} 'PASS' Should Be Equal ${out} 'PASS'
Sleep 1 Sleep 1