mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-09 09:27:42 +01:00
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:
parent
1823e6f135
commit
08bedb8376
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user