mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
Button was not clicked successfully in keyword < Delete Repo>, but the click action returned pass, so I add a checkpoint after clicking the delete button, make sure the pop info had disappeared, it means delete button was clicked successfully. (#7071)
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
0b4c589133
commit
a618a2c2ac
@ -111,17 +111,9 @@ Make Project Public
|
||||
Delete Repo
|
||||
[Arguments] ${projectname}
|
||||
${element_repo_checkbox}= Set Variable xpath=//clr-dg-row[contains(.,'${projectname}')]//clr-checkbox-wrapper//label
|
||||
:For ${n} IN RANGE 1 6
|
||||
\ Log To Console Trying Delete Repo ${n} times ...
|
||||
\ ${out1} Run Keyword And Ignore Error Retry Element Click ${element_repo_checkbox}
|
||||
\ Capture Page Screenshot
|
||||
\ ${out2} Run Keyword And Ignore Error Retry Element Click ${repo_delete_btn}
|
||||
\ Capture Page Screenshot
|
||||
\ Log To Console Return value is ${out1[0]} ${out2[0]}
|
||||
\ Exit For Loop If '${out1[0]}'=='PASS' and '${out2[0]}'=='PASS'
|
||||
\ Sleep 2
|
||||
Retry Element Click ${repo_delete_confirm_btn}
|
||||
Sleep 2
|
||||
Retry Double Keywords When Error Retry Element Click ${element_repo_checkbox} Wait Until Element Is Visible And Enabled ${repo_delete_btn}
|
||||
Retry Double Keywords When Error Retry Element Click ${repo_delete_btn} Wait Until Element Is Visible And Enabled ${delete_confirm_btn}
|
||||
Retry Double Keywords When Error Retry Element Click ${delete_confirm_btn} Retry Wait Until Page Not Contains Element ${delete_confirm_btn}
|
||||
|
||||
Delete Repo on CardView
|
||||
[Arguments] ${reponame}
|
||||
|
@ -26,11 +26,15 @@ ${project_replication_xpath} //project-detail//a[contains(.,'Replication')]
|
||||
${project_log_xpath} //project-detail//li[contains(.,'Logs')]
|
||||
${project_member_xpath} //project-detail//li[contains(.,'Members')]
|
||||
|
||||
${create_project_OK_button_xpath} xpath=//button[contains(.,'OK')]
|
||||
${create_project_CANCEL_button_xpath} xpath=//button[contains(.,'CANCEL')]
|
||||
${create_project_OK_button_xpath} xpath=//button[contains(.,'OK')]
|
||||
${delete_confirm_btn} xpath=//confirmation-dialog//button[contains(.,'DELETE')]
|
||||
${project_statistics_private_repository_icon} xpath=//project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[2]/statistics/div/span[1]
|
||||
${repo_delete_btn} xpath=//button[contains(.,'Delete')]
|
||||
${repo_delete_confirm_btn} xpath=//clr-modal//button[2]
|
||||
${repo_retag_confirm_dlg} css=${modal-dialog}
|
||||
${repo_delete_on_card_view_btn} //clr-modal//button[contains(.,'DELETE')]
|
||||
${delete_btn} //button[contains(.,'Delete')]
|
||||
${repo_delete_btn} xpath=//repository//button[contains(.,'Delete')]
|
||||
${project_delete_btn} xpath=//list-project//clr-datagrid//button[contains(.,'Delete')]
|
||||
${tag_delete_btn} xpath=//tag-repository//clr-datagrid//button[contains(.,'Delete')]
|
||||
${user_delete_btn} xpath=/clr-dropdown-menu//button[contains(.,'Delete')]
|
||||
|
@ -50,13 +50,13 @@ Select Object
|
||||
|
||||
# This func cannot support as the delete user flow changed.
|
||||
Multi-delete Object
|
||||
[Arguments] @{obj}
|
||||
[Arguments] ${delete_btn} @{obj}
|
||||
:For ${obj} in @{obj}
|
||||
\ ${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label
|
||||
\ Retry Element Click ${element}
|
||||
Sleep 1
|
||||
Capture Page Screenshot
|
||||
Retry Element Click ${repo_delete_btn}
|
||||
Retry Element Click ${delete_btn}
|
||||
Sleep 1
|
||||
Capture Page Screenshot
|
||||
Retry Element Click ${repo_delete_on_card_view_btn}
|
||||
|
@ -106,6 +106,11 @@ Retry Wait Until Page Contains Element
|
||||
@{param} Create List ${element_xpath}
|
||||
Retry Action Keyword Wait Until Page Contains Element @{param}
|
||||
|
||||
Retry Wait Until Page Not Contains Element
|
||||
[Arguments] ${element_xpath}
|
||||
@{param} Create List ${element_xpath}
|
||||
Retry Action Keyword Wait Until Page Does Not Contain Element @{param}
|
||||
|
||||
Element Click
|
||||
[Arguments] ${element_xpath}
|
||||
Wait Until Element Is Visible And Enabled ${element_xpath}
|
||||
@ -156,3 +161,17 @@ Retry Keyword When Error
|
||||
\ Sleep 2
|
||||
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot
|
||||
Should Be Equal As Strings '${out[0]}' 'PASS'
|
||||
|
||||
Retry Double Keywords When Error
|
||||
[Arguments] ${keyword1} ${element1} ${keyword2} ${element2}
|
||||
:For ${n} IN RANGE 1 6
|
||||
\ Log To Console Trying Delete Repo ${n} times ...
|
||||
\ ${out1} Run Keyword And Ignore Error ${keyword1} ${element1}
|
||||
\ Capture Page Screenshot
|
||||
\ ${out2} Run Keyword And Ignore Error ${keyword2} ${element2}
|
||||
\ Capture Page Screenshot
|
||||
\ Log To Console Return value is ${out1[0]} ${out2[0]}
|
||||
\ Exit For Loop If '${out1[0]}'=='PASS' and '${out2[0]}'=='PASS'
|
||||
\ Sleep 2
|
||||
Should Be Equal As Strings '${out1[0]}' 'PASS'
|
||||
Should Be Equal As Strings '${out2[0]}' 'PASS'
|
@ -426,7 +426,8 @@ Test Case - Delete Multi Project
|
||||
Navigate To Projects
|
||||
Filter Object project
|
||||
Retry Wait Element Not Visible //clr-datagrid/div/div[2]
|
||||
Multi-delete Object projecta projectb
|
||||
@{project_list} Create List projecta projectb
|
||||
Multi-delete Object ${project_delete_btn} @{project_list}
|
||||
# Verify delete project with image should not be deleted directly
|
||||
Delete Fail projecta${d}
|
||||
Delete Success projectb${d}
|
||||
@ -442,7 +443,8 @@ Test Case - Delete Multi Repo
|
||||
Push Image ${ip} user013 Test1@34 project${d} busybox
|
||||
Sleep 2
|
||||
Go Into Project project${d}
|
||||
Multi-delete Object hello-world busybox
|
||||
@{repo_list} Create List hello-world busybox
|
||||
Multi-delete Object ${repo_delete_btn} @{repo_list}
|
||||
# Verify
|
||||
Delete Success hello-world busybox
|
||||
Close Browser
|
||||
@ -457,7 +459,8 @@ Test Case - Delete Multi Tag
|
||||
Push Image With Tag ${ip} user014 Test1@34 project${d} redis 4.0.7-alpine 4.0.7-alpine
|
||||
Go Into Project project${d}
|
||||
Go Into Repo redis
|
||||
Multi-delete object 3.2.10-alpine 4.0.7-alpine
|
||||
@{tag_list} Create List 3.2.10-alpine 4.0.7-alpine
|
||||
Multi-delete object ${tag_delete_btn} @{tag_list}
|
||||
# Verify
|
||||
Delete Success 3.2.10-alpine 4.0.7-alpine
|
||||
Close Browser
|
||||
|
@ -536,7 +536,8 @@ Test Case - Delete Multi Project
|
||||
Create An New Project projectb${d}
|
||||
Push Image ${ip} test${d} Test1@34 projecta${d} hello-world
|
||||
Filter Object project
|
||||
Multi-delete Object projecta projectb
|
||||
@{project_list} Create List projecta projectb
|
||||
Multi-delete Object ${project_delete_btn} @{project_list}
|
||||
# Verify delete project with image should not be deleted directly
|
||||
Delete Fail projecta${d}
|
||||
Delete Success projectb${d}
|
||||
@ -554,7 +555,8 @@ Test Case - Delete Multi User
|
||||
Sign In Harbor ${HARBOR_URL} admin Harbor12345
|
||||
Switch To User Tag
|
||||
Filter Object delete
|
||||
Multi-delete Object deletea deleteb deletec
|
||||
@{user_list} Create List deletea deleteb deletec
|
||||
Multi-delete Object ${user_delete_btn} @{user_list}
|
||||
# Assert delete
|
||||
Delete Success deletea deleteb deletec
|
||||
Sleep 1
|
||||
@ -569,7 +571,8 @@ Test Case - Delete Multi Repo
|
||||
Push Image ${ip} test${d} Test1@34 project${d} busybox
|
||||
Sleep 2
|
||||
Go Into Project project${d}
|
||||
Multi-delete Object hello-world busybox
|
||||
@{repo_list} Create List hello-world busybox
|
||||
Multi-delete Object ${repo_delete_btn} @{repo_list}
|
||||
# Verify
|
||||
Delete Success hello-world busybox
|
||||
Close Browser
|
||||
@ -584,7 +587,8 @@ Test Case - Delete Multi Tag
|
||||
Sleep 2
|
||||
Go Into Project project${d}
|
||||
Go Into Repo redis
|
||||
Multi-delete object 3.2.10-alpine 4.0.7-alpine
|
||||
@{tag_list} Create List 3.2.10-alpine 4.0.7-alpine
|
||||
Multi-delete object ${tag_delete_btn} @{tag_list}
|
||||
# Verify
|
||||
Delete Success 3.2.10-alpine 4.0.7-alpine
|
||||
Close Browser
|
||||
|
Loading…
Reference in New Issue
Block a user