Replace keyword without waiting to one which had waiting

1. Replace all keywords without using waiting;
2. Add a debug line in Go Into Repo for UI hung trouble shooting.

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-12-24 11:40:10 +08:00
parent fe7fdeb723
commit de2ec7d063
13 changed files with 33 additions and 27 deletions

View File

@ -21,28 +21,28 @@ Resource ../../resources/Util.robot
*** Keywords *** *** Keywords ***
Assign User Admin Assign User Admin
[Arguments] ${user} [Arguments] ${user}
Click Element xpath=//harbor-user//hbr-filter//clr-icon Retry Element Click xpath=//harbor-user//hbr-filter//clr-icon
Input Text xpath=//harbor-user//hbr-filter//input ${user} Input Text xpath=//harbor-user//hbr-filter//input ${user}
Sleep 2 Sleep 2
#select checkbox #select checkbox
Click Element //clr-dg-row[contains(.,'${user}')]//label Retry Element Click //clr-dg-row[contains(.,'${user}')]//label
#click assign admin #click assign admin
Click Element //*[@id='set-admin'] Retry Element Click //*[@id='set-admin']
Sleep 1 Sleep 1
Switch to User Tag Switch to User Tag
Click Element xpath=${administration_user_tag_xpath} Retry Element Click xpath=${administration_user_tag_xpath}
Sleep 1 Sleep 1
Administration Tag Should Display Administration Tag Should Display
Page Should Contain Element xpath=${administration_tag_xpath} Retry Wait Until Page Contains Element xpath=${administration_tag_xpath}
User Email Should Exist User Email Should Exist
[Arguments] ${email} [Arguments] ${email}
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Switch to User Tag Switch to User Tag
Page Should Contain Element xpath=//clr-dg-cell[contains(., '${email}')] Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '${email}')]
Add User Button Should Be Disabled Add User Button Should Be Disabled
Sleep 1 Sleep 1
Page Should Contain Element //button[contains(.,'New') and @disabled=''] Retry Wait Until Page Contains Element //button[contains(.,'New') and @disabled='']

View File

@ -140,10 +140,10 @@ Self Reg Should Be Enabled
Checkbox Should Be Selected xpath=${self_reg_xpath} Checkbox Should Be Selected xpath=${self_reg_xpath}
Project Creation Should Display Project Creation Should Display
Page Should Contain Element xpath=${project_create_xpath} Retry Wait Until Page Contains Element xpath=${project_create_xpath}
Project Creation Should Not Display Project Creation Should Not Display
Page Should Not Contain Element xpath=${project_create_xpath} Retry Wait Until Page Not Contains Element xpath=${project_create_xpath}
## System settings ## System settings
Switch To System Settings Switch To System Settings

View File

@ -37,7 +37,7 @@ Capture Screenshot And Source
Log Source Log Source
Sign Up Should Not Display Sign Up Should Not Display
Page Should Not Contain Element xpath=${sign_up_button_xpath} Retry Wait Until Page Not Contains Element xpath=${sign_up_button_xpath}
Create An New User Create An New User
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} [Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment}

View File

@ -21,8 +21,8 @@ Resource ../../resources/Util.robot
*** Keywords *** *** Keywords ***
Ldap User Should Not See Change Password Ldap User Should Not See Change Password
Click Element //clr-header//clr-dropdown[2]//button Retry Element Click //clr-header//clr-dropdown[2]//button
Sleep 1 Sleep 2
Page Should Not Contain Password Page Should Not Contain Password

View File

@ -42,7 +42,7 @@ Public Should Be Selected
Project Should Be Public Project Should Be Public
[Arguments] ${projectName} [Arguments] ${projectName}
Page Should Contain Element //clr-dg-row[contains(.,'${projectName}')]//clr-dg-cell[contains(.,'Public')] Retry Wait Until Page Contains Element //clr-dg-row[contains(.,'${projectName}')]//clr-dg-cell[contains(.,'Public')]
Content Trust Should Be Selected Content Trust Should Be Selected
Checkbox Should Be Selected //hbr-project-policy-config//input[@name='content-trust'] Checkbox Should Be Selected //hbr-project-policy-config//input[@name='content-trust']

View File

@ -70,13 +70,13 @@ User Can Change Role
[arguments] ${username} [arguments] ${username}
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
Retry Element Click xpath=//*[@id='member-action'] Retry Element Click xpath=//*[@id='member-action']
Page Should Not Contain Element xpath=//button[@disabled='' and contains(.,'Admin')] Retry Wait Until Page Not Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
User Can Not Change Role User Can Not Change Role
[arguments] ${username} [arguments] ${username}
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
Retry Element Click xpath=//*[@id='member-action'] Retry Element Click xpath=//*[@id='member-action']
Page Should Contain Element xpath=//button[@disabled='' and contains(.,'Admin')] Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
#this keyworkd seems will not use any more, will delete in the future #this keyworkd seems will not use any more, will delete in the future
Non-admin View Member Account Non-admin View Member Account
@ -84,7 +84,7 @@ Non-admin View Member Account
Xpath Should Match X Times //clr-dg-row-master ${times} Xpath Should Match X Times //clr-dg-row-master ${times}
User Can Not Add Member User Can Not Add Member
Page Should Contain Element xpath=//button[@disabled='' and contains(.,'User')] Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'User')]
Add Guest Member To Project Add Guest Member To Project
[arguments] ${member} [arguments] ${member}
@ -153,7 +153,7 @@ User Should Be Guest
Go Into Project ${project} Go Into Project ${project}
Switch To Member Switch To Member
User Can Not Add Member User Can Not Add Member
Page Should Contain Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Guest')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Guest')]
Logout Harbor Logout Harbor
Pull image ${ip} ${user} ${password} ${project} hello-world Pull image ${ip} ${user} ${password} ${project} hello-world
Cannot Push image ${ip} ${user} ${password} ${project} hello-world Cannot Push image ${ip} ${user} ${password} ${project} hello-world
@ -168,7 +168,7 @@ User Should Be Developer
Go Into Project ${project} Go Into Project ${project}
Switch To Member Switch To Member
User Can Not Add Member User Can Not Add Member
Page Should Contain Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Developer')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Developer')]
Logout Harbor Logout Harbor
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v1 Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v1
@ -183,7 +183,7 @@ User Should Be Admin
Switch To Member Switch To Member
Add Guest Member To Project ${guest} Add Guest Member To Project ${guest}
User Can Change Role ${guest} User Can Change Role ${guest}
Page Should Contain Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Admin')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Admin')]
Logout Harbor Logout Harbor
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v2 Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v2
@ -197,7 +197,7 @@ User Should Be Master
Go Into Project ${project} Go Into Project ${project}
Delete Repo ${project} Delete Repo ${project}
Switch To Member Switch To Member
Page Should Contain Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Master')] Retry Wait Until Page Contains Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Master')]
Logout Harbor Logout Harbor
Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v3 Push Image With Tag ${ip} ${user} ${password} ${project} hello-world v3
@ -206,5 +206,5 @@ Project Should Have Member
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Go Into Project ${project} Go Into Project ${project}
Switch To Member Switch To Member
Page Should Contain Element xpath=//clr-dg-cell[contains(., '${user}')] Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '${user}')]
Logout Harbor Logout Harbor

View File

@ -21,3 +21,6 @@ ${first_cve_xpath} //clr-dg-row[1]//clr-dg-cell//a
${view_log_xpath} //clr-dg-row[1]//clr-dg-cell[4]//a ${view_log_xpath} //clr-dg-row[1]//clr-dg-cell[4]//a
${build_history_btn} //button[contains(.,'Build History')] ${build_history_btn} //button[contains(.,'Build History')]
${build_history_data} //clr-dg-row ${build_history_data} //clr-dg-row
${push_image_command_btn} //hbr-push-image-button//button

View File

@ -27,7 +27,7 @@ Create An New Project
Capture Page Screenshot Capture Page Screenshot
Retry Text Input xpath=${project_name_xpath} ${projectname} Retry Text Input xpath=${project_name_xpath} ${projectname}
${element_project_public}= Set Variable xpath=${project_public_xpath} ${element_project_public}= Set Variable xpath=${project_public_xpath}
Run Keyword If '${public}' == 'true' Run Keywords Wait Until Element Is Visible And Enabled ${element_project_public} AND Click Element ${element_project_public} Run Keyword If '${public}' == 'true' Run Keywords Wait Until Element Is Visible And Enabled ${element_project_public} AND Retry Element Click ${element_project_public}
Run Keyword If '${count_quota}'!='${null}' Input Count Quota ${count_quota} Run Keyword If '${count_quota}'!='${null}' Input Count Quota ${count_quota}
Run Keyword If '${storage_quota}'!='${null}' Input Storage Quota ${storage_quota} ${storage_quota_unit} Run Keyword If '${storage_quota}'!='${null}' Input Storage Quota ${storage_quota} ${storage_quota_unit}
Capture Page Screenshot Capture Page Screenshot

View File

@ -43,4 +43,4 @@ Logout Harbor
Retry Link Click Log Out Retry Link Click Log Out
Capture Page Screenshot Logout.png Capture Page Screenshot Logout.png
Sleep 2 Sleep 2
Wait Until Keyword Succeeds 5x 1 Page Should Contain Element ${sign_in_title_xpath} Wait Until Keyword Succeeds 5x 1 Retry Wait Until Page Contains Element ${sign_in_title_xpath}

View File

@ -406,7 +406,7 @@ Test Case - Developer Operate Labels
Sign In Harbor ${HARBOR_URL} user022 Test1@34 Sign In Harbor ${HARBOR_URL} user022 Test1@34
Go Into Project project${d} has_image=${false} Go Into Project project${d} has_image=${false}
Sleep 3 Sleep 3
Page Should Not Contain Element xpath=//a[contains(.,'Labels')] Retry Wait Until Page Not Contains Element xpath=//a[contains(.,'Labels')]
Close Browser Close Browser
Test Case - Retag A Image Tag Test Case - Retag A Image Tag
@ -431,7 +431,7 @@ Test Case - Retag A Image Tag
Page Should Contain ${target_image_name} Page Should Contain ${target_image_name}
Go Into Repo project${random_num1}${random_num2}/${target_image_name} Go Into Repo project${random_num1}${random_num2}/${target_image_name}
Sleep 1 Sleep 1
Page Should Contain Element xpath=${tag_value_xpath} Retry Wait Until Page Contains Element xpath=${tag_value_xpath}
Close Browser Close Browser
Test Case - Create An New Project With Quotas Set Test Case - Create An New Project With Quotas Set

View File

@ -44,6 +44,7 @@ Test Case - System Admin On-board New Member
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To User Tag Switch To User Tag
Sleep 2
Page Should Not Contain mike02 Page Should Not Contain mike02
Navigate To Projects Navigate To Projects
Create An New Project project${d} Create An New Project project${d}
@ -60,8 +61,10 @@ Test Case - LDAP User On-borad New Member
Create An New Project project${d} Create An New Project project${d}
Go Into Project project${d} has_image=${false} Go Into Project project${d} has_image=${false}
Switch To Member Switch To Member
Sleep 2
Page Should Not Contain mike04 Page Should Not Contain mike04
Add Guest Member To Project mike04 Add Guest Member To Project mike04
Sleep 2
Page Should Contain mike04 Page Should Contain mike04
Close Browser Close Browser

View File

@ -393,7 +393,7 @@ TestCase - Developer Operate Labels
Sign In Harbor ${HARBOR_URL} bob${d} Test1@34 Sign In Harbor ${HARBOR_URL} bob${d} Test1@34
Go Into Project project${d} has_image=${false} Go Into Project project${d} has_image=${false}
Sleep 3 Sleep 3
Page Should Not Contain Element xpath=//a[contains(.,'Labels')] Retry Wait Until Page Not Contains Element xpath=//a[contains(.,'Labels')]
Close Browser Close Browser
Test Case - Scan A Tag In The Repo Test Case - Scan A Tag In The Repo