Merge pull request #9982 from danfengliu/add-restrict-xpath-for-go-into-project

Modify keyword Go Into Project and Quota case
This commit is contained in:
danfengliu 2019-11-25 18:09:50 +08:00 committed by GitHub
commit 6d382bdb18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -26,9 +26,8 @@ Go Into Project
\ 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}/')]
\ ${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!\")] DoAssert=${false}
\ ... 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}/')] DoAssert=${false}
\ Log To Console ${out}
\ Run Keyword If ${out} == 'PASS' Exit For Loop
\ Sleep 1

View File

@ -246,7 +246,7 @@ Retry Keyword When Return Value Mismatch
Should Be Equal As Strings ${status} 'PASS'
Retry Double Keywords When Error
[Arguments] ${keyword1} ${element1} ${keyword2} ${element2}
[Arguments] ${keyword1} ${element1} ${keyword2} ${element2} ${DoAssert}=${true}
:For ${n} IN RANGE 1 5
\ Log To Console Trying ${keyword1} and ${keyword2} ${n} times ...
\ ${out1} Run Keyword And Ignore Error ${keyword1} ${element1}
@ -257,8 +257,8 @@ Retry Double Keywords When Error
\ Log To Console Return value is ${out1[0]} ${out2[0]}
\ Exit For Loop If '${out2[0]}'=='PASS'
\ Sleep 1
Return From Keyword If ${DoAssert} == ${false} '${out2[0]}'
Should Be Equal As Strings '${out2[0]}' 'PASS'
[Return] 'PASS'
Run Curl And Return Json
[Arguments] ${curl_cmd}

View File

@ -508,11 +508,16 @@ Test Case - Project Storage Quotas Dispaly And Control
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_b} tag=${image_b_ver} tag1=${image_b_ver}
${storage_quota_ret}= Get Project Storage Quota Text From Project Quotas List project${d}
Should Be Equal As Strings ${storage_quota_ret} ${image_b_size} of ${storage_quota}${storage_quota_unit}
Cannot Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a}:${image_a_ver} err_msg=Quota exceeded when processing the request of adding 25.9 MiB of storage resource, which when updated to current usage of 329.3 MiB will exceed the configured upper limit of 330.0 MiB
Cannot Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a}:${image_a_ver} err_msg=Quota exceeded when processing the request of adding 25.8 MiB of storage resource, which when updated to current usage of 329.3 MiB will exceed the configured upper limit of 330.0 MiB
Go Into Project project${d}
Delete Repo project${d}/${image_b}
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a} tag=${image_a_ver} tag1=${image_a_ver}
${storage_quota_ret}= Get Project Storage Quota Text From Project Quotas List project${d}
${storage_quota_ret_str_left} Fetch From Left ${storage_quota_ret} 25.
Log ${storage_quota_ret_str_left}
${storage_quota_ret_str_right} Fetch From Left ${storage_quota_ret} 25.
Log ${storage_quota_ret_str_right}
Log ${storage_quota_ret_str_left}${storage_quota_ret_str_right}
Should Be Equal As Strings ${storage_quota_ret} ${image_a_size} of ${storage_quota}${storage_quota_unit}
Close Browser
@ -603,7 +608,7 @@ Test Case - Update Webhook
Create An New Project project${d}
Go Into Project project${d} has_image=${false}
Switch To Project Webhooks
Create A New Webhook ${HARBOR_URL} auth_header=auth_header${d}
Create A New Webhook ${HARBOR_URL} auth_header=auth_header${d}
Sleep 3
${d1}= Get Current Date
Update A Webhook 101.17.109.20 auth_header=auth_header${d1}