Test case <List Helm Charts> failed occasionally, due to lacking of wail and retry for action word, so this case need to be refected. (#7165)

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-03-18 18:06:46 +08:00 committed by GitHub
parent 7ae7f9f23f
commit d9eb519e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 28 deletions

View File

@ -5,9 +5,8 @@ Resource ../../resources/Util.robot
*** Keywords ***
Switch To Project Charts
Click Element xpath=//project-detail//a[contains(.,'Charts')]
Sleep 1
Page Should Contain Element xpath=//hbr-helm-chart
Retry Element Click ${project_chart_tabpage}
Retry Wait Until Page Contains Element ${project_chart_list}
Upload Chart files
${current_dir}= Run pwd
@ -15,32 +14,29 @@ Upload Chart files
Run wget ${harbor_chart_prov_file_url}
Run wget ${prometheus_chart_file_url}
Click Element xpath=${upload_chart_button}
Retry Double Keywords When Error Retry Element Click xpath=${upload_chart_button} Retry Wait Until Page Contains Element xpath=${upload_action_button}
${prometheus_file_path} Set Variable ${current_dir}/${prometheus_chart_filename}
Choose File xpath=${chart_file_browse} ${prometheus_file_path}
Click Element xpath=${upload_action_button}
Wait Until Page Does Not Contain Element xpath=${upload_action_button}
Retry Double Keywords When Error Retry Element Click xpath=${upload_action_button} Retry Wait Until Page Not Contains Element xpath=${upload_action_button}
Click Element xpath=${upload_chart_button}
Retry Double Keywords When Error Retry Element Click xpath=${upload_chart_button} Retry Wait Until Page Contains Element xpath=${upload_action_button}
${harbor_file_path} Set Variable ${current_dir}/${harbor_chart_filename}
${harbor_prov_file_path} Set Variable ${current_dir}/${harbor_chart_prov_filename}
Choose File xpath=${chart_file_browse} ${harbor_file_path}
Choose File xpath=${chart_prov_browse} ${harbor_prov_file_path}
Click Element xpath=${upload_action_button}
Sleep 2
Retry Double Keywords When Error Retry Element Click xpath=${upload_action_button} Retry Wait Until Page Not Contains Element xpath=${upload_action_button}
Wait Until Page Contains ${prometheus_chart_name}
Retry Wait Until Page Contains ${prometheus_chart_name}
Go Into Chart Version
[Arguments] ${chart_name}
Click Element xpath=//hbr-helm-chart//a[contains(., '${chart_name}')]
Retry Element Click xpath=//hbr-helm-chart//a[contains(., '${chart_name}')]
Capture Page Screenshot viewchartversion.png
Go Into Chart Detail
[Arguments] ${version_name}
Click Element xpath=//hbr-helm-chart-version//a[contains(., '${version_name}')]
Sleep 2
Page Should Contain Element ${chart_detail}
Retry Element Click xpath=//hbr-helm-chart-version//a[contains(., '${version_name}')]
Retry Wait Until Page Contains Element ${chart_detail}
Go Back To Versions And Delete
Retry Element Click xpath=${version_bread_crumbs}

View File

@ -2,7 +2,8 @@
Documentation This resource provides any keywords related to the Harbor private registry appliance
*** Variables ***
${project_chart_tabpage} xpath=//project-detail//a[contains(.,'Charts')]
${project_chart_list} xpath=//hbr-helm-chart
${upload_chart_button} //button[contains(.,'Upload')]
${chart_file_browse} //*[@id='chart']
${chart_prov_browse} //*[@id='prov']

View File

@ -603,7 +603,7 @@ Test Case - View Scan Error
${d}= get current date result_format=%m%s
Sign In Harbor ${HARBOR_URL} user026 Test1@34
Create An New Project project${d}
Create An New Project project${d}
Push Image ${ip} user026 Test1@34 project${d} vmware/photon:1.0
Go Into Project project${d}
Go Into Repo project${d}/vmware/photon
@ -618,27 +618,22 @@ Test Case - List Helm Charts
Sign In Harbor ${HARBOR_URL} user027 Test1@34
Create An New Project project${d}
Go Into Project project${d} has_image=${false}
Sleep 2
Switch To Project Charts
Upload Chart files
Go Into Chart Version ${prometheus_chart_name}
Wait Until Page Contains ${prometheus_chart_version}
Retry Wait Until Page Contains ${prometheus_chart_version}
Go Into Chart Detail ${prometheus_chart_version}
# Summary tab
Page Should Contain Element ${summary_markdown}
Page Should Contain Element ${summary_container}
Retry Wait Until Page Contains Element ${summary_markdown}
Retry Wait Until Page Contains Element ${summary_container}
# Dependency tab
Click Element xpath=${detail_dependency}
Sleep 1
Page Should Contain Element ${dependency_content}
Retry Double Keywords When Error Retry Element Click xpath=${detail_dependency} Retry Wait Until Page Contains Element ${dependency_content}
# Values tab
Click Element xpath=${detail_value}
Sleep 1
Page Should Contain Element ${value_content}
Retry Double Keywords When Error Retry Element Click xpath=${detail_value} Retry Wait Until Page Contains Element ${value_content}
Go Back To Versions And Delete
Close Browser
@ -667,7 +662,7 @@ Test Case - Retag A Image Tag
Sign In Harbor ${HARBOR_URL} user028 Test1@34
Create An New Project project${random_num1}
Create An New Project project${random_num2}
Go Into Project project${random_num1} has_image=${false}
Sleep 1
Push Image With Tag ${ip} user028 Test1@34 project${random_num1} redis ${image_tag}