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 *** *** 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