Merge pull request #9970 from danfengliu/add-loop-to-keyword-go-into-project

Add a big loop for keyword Go Into Project
This commit is contained in:
danfengliu 2019-11-22 16:41:37 +08:00 committed by GitHub
commit c09f479750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,16 +21,17 @@ Resource ../../resources/Util.robot
*** Keywords ***
Go Into Project
[Arguments] ${project} ${has_image}=${true}
Sleep 2
Retry Wait Element ${search_input}
Input Text ${search_input} ${project}
Retry Wait Until Page Contains ${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
# 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!\")]
... 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}
:For ${n} IN RANGE 1 5
\ Sleep 2
\ Retry Wait Element ${search_input}
\ Retry Clear Element Text ${search_input}
\ Input Text ${search_input} ${project}
\ Retry Wait Until Page Contains ${project}
\ ${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}/')]
\ Log To Console ${out}
\ Run Keyword If ${out} == 'PASS' Exit For Loop
\ Sleep 1
Should Be Equal ${out} 'PASS'
Sleep 1