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:
Wenkai Yin 2019-01-18 16:28:42 +08:00 committed by GitHub
commit 5abfa2de3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 14 deletions

View File

@ -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}

View File

@ -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,12 +95,14 @@ Verify Project Label
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
:For ${project} In @{project}
\ Go Into Project ${project}
\ Switch To Project Label
\ @{projectlabel}= Get Value From Json ${json} $.projects[?(@.name=${project})]..labels..name
\ :For ${label} In @{label}
\ \ Page Should Contain ${projectlabel}
\ Back To Projects
\ @{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}
\ \ Page Should Contain ${projectlabel}
\ Back To Projects
Close Browser
Verify Endpoint
@ -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

View File

@ -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":[