mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
Add space adaptor for regexp when create a new project, we loose the criteria to match the project name because the return json datat may be shown in different lines . (#6768)
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
3f8e06a8bc
commit
257eebfebe
@ -34,10 +34,12 @@ Create An New Project
|
||||
${element}= Set Variable xpath=//button[contains(.,'OK')]
|
||||
Wait Until Element Is Visible And Enabled ${element}
|
||||
Click Element ${element}
|
||||
#Try to get Project Infomation 5 times at most and sleep 1 second each time if we fail to get it.
|
||||
${found_project}= Set Variable ${false}
|
||||
:For ${n} IN RANGE 1 5
|
||||
\ ${rc} ${output}= Run And Return Rc And Output curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -k -X GET --header 'Accept: application/json' ${HARBOR_URL}/api/projects?name=${projectname}
|
||||
\ ${match} ${regexp_project_name} Should Match Regexp ${output} ,\"name\":\"(\\w+)\",\"creation_time\":
|
||||
\ Log To Console ${output}
|
||||
\ ${match} ${regexp_project_name} Should Match Regexp ${output} \"name\"\\s*:\\s*\"(\\w+)\"\\s*,
|
||||
\ ${found_project} Set Variable If '${rc}' == '0' and '${regexp_project_name}' == '${projectname}' ${true}
|
||||
\ Run Keyword If ${found_project} == ${true} Exit For Loop
|
||||
\ Sleep 1
|
||||
|
Loading…
Reference in New Issue
Block a user