mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-29 05:47:31 +02:00
Merge pull request #6759 from danfengliu/debug-go-into-project-in-harbor-nightly-migrate-offline
Keyword <Go Into Project> has modified, but verify.robot didn't adapt…
This commit is contained in:
commit
5abfa2de3a
@ -22,14 +22,21 @@ ${HARBOR_VERSION} v1.1.1
|
||||
*** Keywords ***
|
||||
Go Into Project
|
||||
[Arguments] ${project} ${has_image}=${true}
|
||||
Wait Until Element Is Visible ${search_input}
|
||||
Wait Until Element Is Visible And Enabled ${search_input}
|
||||
Input Text ${search_input} ${project}
|
||||
Wait Until Page Contains ${project}
|
||||
Wait Until Element Is Visible xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
||||
Wait Until Element Is Visible And Enabled xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
||||
Click Element xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
||||
Run Keyword If ${has_image}==${false} Wait Until Element Is Visible xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")]
|
||||
... ELSE Wait Until Element Is Visible xpath=//clr-dg-cell[contains(.,'${project}/')]
|
||||
Capture Page Screenshot gointo_${project}.png
|
||||
#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.
|
||||
:For ${n} IN RANGE 1 5
|
||||
\ ${out} Run Keyword If ${has_image}==${false} Run Keyword And Ignore Error Wait Until Element Is Visible And Enabled xpath=//clr-dg-placeholder[contains(.,\"We couldn\'t find any repositories!\")]
|
||||
\ ... ELSE Run Keyword And Ignore Error Wait Until Element Is Visible And Enabled xpath=//clr-dg-cell[contains(.,'${project}/')]
|
||||
\ Log To Console ${out[0]}
|
||||
\ ${result} Set Variable If '${out[0]}'=='PASS' ${true} ${false}
|
||||
\ Run Keyword If ${result} == ${true} Exit For Loop
|
||||
\ Sleep 1
|
||||
Should Be Equal ${result} ${true}
|
||||
|
||||
Add User To Project Admin
|
||||
[Arguments] ${project} ${user}
|
||||
|
@ -35,7 +35,9 @@ Verify Image Tag
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
:FOR ${project} IN @{project}
|
||||
\ Go Into Project ${project}
|
||||
\ @{out_has_image}= Get Value From Json ${json} $.projects[?(@.name=${project})].has_image
|
||||
\ ${has_image} Set Variable If @{out_has_image}[0] == ${true} ${true} ${false}
|
||||
\ Go Into Project ${project} has_image=${has_image}
|
||||
\ @{repo}= Get Value From Json ${json} $.projects[?(@name=${project})]..repo..name
|
||||
\ Loop Image Repo @{repo}
|
||||
\ Back To Projects
|
||||
@ -52,7 +54,9 @@ Verify Member Exist
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
:For ${project} In @{project}
|
||||
\ Go Into Project ${project}
|
||||
\ @{out_has_image}= Get Value From Json ${json} $.projects[?(@.name=${project})].has_image
|
||||
\ ${has_image} Set Variable If @{out_has_image}[0] == ${true} ${true} ${false}
|
||||
\ Go Into Project ${project} has_image=${has_image}
|
||||
\ Switch To Member
|
||||
\ @{members}= Get Value From Json ${json} $.projects[?(@name=${project})].member..name
|
||||
\ Loop Member @{members}
|
||||
@ -91,7 +95,9 @@ Verify Project Label
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
:For ${project} In @{project}
|
||||
\ Go Into Project ${project}
|
||||
\ @{out_has_image}= Get Value From Json ${json} $.projects[?(@.name=${project})].has_image
|
||||
\ ${has_image} Set Variable If @{out_has_image}[0] == ${true} ${true} ${false}
|
||||
\ Go Into Project ${project} has_image=${has_image}
|
||||
\ Switch To Project Label
|
||||
\ @{projectlabel}= Get Value From Json ${json} $.projects[?(@.name=${project})]..labels..name
|
||||
\ :For ${label} In @{label}
|
||||
@ -129,7 +135,9 @@ Verify Project Setting
|
||||
\ ${scanonpush}= Get Value From Json ${json} $.projects[?(@.name=${project})]..automatically_scan_images_on_push
|
||||
\ Init Chrome Driver
|
||||
\ Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
\ Go Into Project ${project}
|
||||
\ @{out_has_image}= Get Value From Json ${json} $.projects[?(@.name=${project})].has_image
|
||||
\ ${has_image} Set Variable If @{out_has_image}[0] == ${true} ${true} ${false}
|
||||
\ Go Into Project ${project} has_image=${has_image}
|
||||
\ Goto Project Config
|
||||
\ Run Keyword If ${public} == "public" Checkbox Should Be Checked //clr-checkbox-wrapper[@name='public']//label
|
||||
\ Run Keyword If ${contenttrust} == "true" Checkbox Should Be Checked //clr-checkbox-wrapper[@name='content-trust']//label
|
||||
|
@ -92,6 +92,7 @@
|
||||
"projects":[
|
||||
{
|
||||
"name":"project1",
|
||||
"has_image":true,
|
||||
"accesslevel":"public",
|
||||
"repocounts":2,
|
||||
"repo":[
|
||||
@ -151,6 +152,7 @@
|
||||
},
|
||||
{
|
||||
"name":"project2",
|
||||
"has_image":false,
|
||||
"accesslevel":"public",
|
||||
"repocounts":2,
|
||||
"repo":[
|
||||
|
Loading…
Reference in New Issue
Block a user