Refactor unstable test cases (#19350)

Fix #19282

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
Yang Jiao 2023-09-13 16:14:34 +08:00 committed by GitHub
parent 12ce91594f
commit 97b285168a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 70 additions and 69 deletions

View File

@ -25,7 +25,7 @@ Assign User Admin
Input Text xpath=//harbor-user//hbr-filter//input ${user}
Sleep 2
#select checkbox
Retry Element Click //clr-dg-row[contains(.,'${user}')]//label
Retry Element Click //clr-dg-row[contains(.,'${user}')]//label[contains(@class,'clr-control-label')]
#click assign admin
Retry Element Click //*[@id='set-admin']
Sleep 1

View File

@ -245,7 +245,7 @@ Create New Labels
Update A Label
[Arguments] ${labelname}
Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label[contains(@class,'clr-control-label')]
Sleep 1
Retry Element Click xpath=//button[contains(.,'Edit')]
Sleep 1
@ -256,7 +256,7 @@ Update A Label
Delete A Label
[Arguments] ${labelname}
Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label[contains(@class,'clr-control-label')]
Sleep 1
Retry Element Click xpath=//button[contains(.,'Delete')]
Sleep 3
@ -312,7 +312,7 @@ Set User Name Claim And Save
Select Distribution
[Arguments] ${name}
Retry Element Click //clr-dg-row[contains(.,'${name}')]//div[contains(@class,'clr-checkbox-wrapper')]/label
Retry Element Click //clr-dg-row[contains(.,'${name}')]//div[contains(@class,'clr-checkbox-wrapper')]/label[contains(@class,'clr-control-label')]
Distribution Exist
[Arguments] ${name} ${endpoint}
@ -349,7 +349,7 @@ Delete A Distribution
${is_exsit} evaluate not ${deletable}
Switch To Distribution
Filter Distribution List ${name} ${endpoint}
Retry Double Keywords When Error Select Distribution ${name} Wait Until Element Is Visible //clr-datagrid//clr-dg-footer//clr-checkbox-wrapper/label
Retry Double Keywords When Error Select Distribution ${name} Wait Until Element Is Visible //clr-datagrid//clr-dg-footer//clr-checkbox-wrapper/label[contains(@class,'clr-control-label')]
Retry Double Keywords When Error Retry Element Click ${distribution_action_btn_id} Wait Until Element Is Visible And Enabled ${distribution_del_btn_id}
Retry Double Keywords When Error Retry Element Click ${distribution_del_btn_id} 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}
@ -359,7 +359,7 @@ Edit A Distribution
[Arguments] ${name} ${endpoint} ${new_endpoint}=${null}
Switch To Distribution
Filter Distribution List ${name} ${endpoint}
Retry Double Keywords When Error Select Distribution ${name} Wait Until Element Is Visible //clr-datagrid//clr-dg-footer//clr-checkbox-wrapper/label times=9
Retry Double Keywords When Error Select Distribution ${name} Wait Until Element Is Visible //clr-datagrid//clr-dg-footer//clr-checkbox-wrapper/label[contains(@class,'clr-control-label')] times=9
Retry Double Keywords When Error Retry Element Click ${distribution_action_btn_id} Wait Until Element Is Visible And Enabled ${distribution_edit_btn_id}
Retry Double Keywords When Error Retry Element Click ${distribution_edit_btn_id} Wait Until Element Is Visible And Enabled ${distribution_name_input_id}
Retry Text Input ${distribution_endpoint_id} ${new_endpoint}

View File

@ -35,9 +35,9 @@ ${configuration_system_wl_add_confirm_btn} //*[@id='add-to-system']
${configuration_system_wl_delete_a_cve_id_icon} //app-security//form/section//ul/li[1]/a[2]/clr-icon
${configuration_sys_repo_readonly_chb_id} //*[@id='repo_read_only_lbl']
${cve_allowlist_expires_btn} //clr-date-container[.//div[@class='clr-input-group' and not(@hidden)]]//button
${cve_allowlist_expires_yesterday} //td[.//button[@class='day-btn is-today']]/preceding-sibling::td[1]
${cve_allowlist_expires_tomorrow} //td[.//button[@class='day-btn is-today']]/following-sibling::td[1]
${cfg_auth_automatic_onboarding_checkbox} //clr-checkbox-wrapper//label[contains(@for,'oidcAutoOnboard')]
${cve_allowlist_expires_yesterday} //td[.//button[@class='day-btn is-today']]/preceding::td[1]
${cve_allowlist_expires_tomorrow} //td[.//button[@class='day-btn is-today']]/following::td[1]
${cfg_auth_automatic_onboarding_checkbox} //clr-checkbox-wrapper//label[contains(@class,'clr-control-label') and contains(@for,'oidcAutoOnboard')]
${cfg_auth_user_name_claim_input} //*[@id='oidcUserClaim']
${cfg_auth_ldap_group_admin_dn} //*[@id='ldapGroupAdminDN']
@ -62,6 +62,6 @@ ${filter_dist_input} //hbr-filter//input
${audit_log_forward_syslog_endpoint_input_id} //*[@id='auditLogForwardEndpoint']
${skip_audit_log_database_checkbox} //*[@id='skipAuditLogDatabase']
${skip_audit_log_database_label} //clr-checkbox-wrapper//label[contains(@for,'skipAuditLogDatabase')]
${retain_image_last_pull_time_label} //clr-checkbox-wrapper//label[contains(@for,'scannerSkipUpdatePullTime')]
${skip_audit_log_database_label} //clr-checkbox-wrapper//label[contains(@class,'clr-control-label') and contains(@for,'skipAuditLogDatabase')]
${retain_image_last_pull_time_label} //clr-checkbox-wrapper//label[contains(@class,'clr-control-label') and contains(@for,'scannerSkipUpdatePullTime')]
${retain_image_last_pull_time_checkbox} //*[@id='scannerSkipUpdatePullTime']

View File

@ -19,7 +19,7 @@ Documentation This resource provides any keywords related to the Harbor private
${gc_page_xpath} //clr-main-container//clr-vertical-nav-group//span[contains(.,'Clean Up')]
${gc_now_button} //*[@id='gc-now']
${dry_run_button} //*[@id='gc-dry-run']
${checkbox_delete_untagged_artifacts} //gc-config//clr-toggle-wrapper/label[contains(@for,'delete_untagged')]
${checkbox_delete_untagged_artifacts} //gc-config//clr-toggle-wrapper/label[contains(@class,'clr-control-label') and contains(@for,'delete_untagged')]
${latest_job_id_xpath} //clr-datagrid//div//clr-dg-row[1]//clr-dg-cell[1]
${gc_schedule_edit_btn} //*[@id='editSchedule']
${gc_schedule_select} //*[@id='selectPolicy']

View File

@ -32,7 +32,7 @@ Purge Now
Click Exclude Operation
[Arguments] @{exclude_operations}
FOR ${element} IN @{exclude_operations}
Retry Element Click //form//div//label[contains(.,'${element}')]
Retry Element Click //form//div//label[contains(@class,'clr-control-label') and contains(.,'${element}')]
END
Verify Last completed Time

View File

@ -8,7 +8,7 @@ Resource ../../resources/Util.robot
Goto Project Config
Retry Element Click //project-detail//ul/li[contains(.,'Summary')]
Retry Double Keywords When Error Retry Element Click //project-detail//ul/li[contains(.,'Configuration')] Retry Wait Element //clr-checkbox-wrapper/label[contains(.,'Prevent vulnerable images from running.')]
Retry Double Keywords When Error Retry Element Click //project-detail//ul/li[contains(.,'Configuration')] Retry Wait Element //clr-checkbox-wrapper/label[contains(@class,'clr-control-label') and contains(.,'Prevent vulnerable images from running.')]
Click Project Public
Mouse Down //hbr-project-policy-config//input[@name='public']

View File

@ -4,7 +4,7 @@ Resource ../../resources/Util.robot
*** Keywords ***
Copy Image
[Arguments] ${tag} ${projectname} ${reponame} ${is_success}=${true}
Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//label[contains(@class,'clr-control-label')]
Retry Action Keyword Copy Image Action ${projectname} ${reponame} ${is_success}
Copy Image Action

View File

@ -56,13 +56,13 @@ Change Member Role
User Can Change Role
[arguments] ${username}
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label[contains(@class,'clr-control-label')]
Retry Element Click xpath=//*[@id='member-action']
Retry Wait Until Page Not Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
User Can Not Change Role
[arguments] ${username}
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label
Retry Element Click xpath=//clr-dg-row[contains(.,'${username}')]//input/../label[contains(@class,'clr-control-label')]
Retry Element Click xpath=//*[@id='member-action']
Retry Wait Until Page Contains Element xpath=//button[@disabled='' and contains(.,'Admin')]
@ -85,7 +85,7 @@ Add Guest Member To Project
Delete Project Member
[arguments] ${member}
Retry Element Click xpath=//clr-dg-row[contains(.,'${member}')]//input/../label
Retry Element Click xpath=//clr-dg-row[contains(.,'${member}')]//input/../label[contains(@class,'clr-control-label')]
Retry Double Keywords When Error Retry Element Click ${member_action_xpath} Retry Wait Until Page Contains Element ${delete_action_xpath}
Retry Double Keywords When Error Retry Element Click ${delete_action_xpath} Retry Wait Until Page Contains Element ${repo_delete_on_card_view_btn}
Retry Double Keywords When Error Retry Element Click ${repo_delete_on_card_view_btn} Retry Wait Element xpath=${project_member_xpath}

View File

@ -19,7 +19,7 @@ Documentation This resource provides any keywords related to the Harbor private
${project_member_tag_xpath} //clr-main-container//project-detail/clr-tabs//a[contains(.,'Members')]
${project_member_add_button_xpath} //project-detail//button[contains(.,'User')]
${project_member_add_username_xpath} //*[@id='member_name']
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label[contains(@class,'clr-control-label')]
${project_member_add_save_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
${project_member_search_button_xpath} //project-detail//hbr-filter/span/clr-icon
${project_member_search_text_xpath} //project-detail//hbr-filter/span/input

View File

@ -29,7 +29,7 @@ Select Distribution For P2P Preheat
Select P2P Preheat Policy
[Arguments] ${name}
Retry Element Click //clr-dg-row[contains(.,'${name}')]//clr-radio-wrapper/label
Retry Element Click //clr-dg-row[contains(.,'${name}')]//clr-radio-wrapper/label[contains(@class,'clr-control-label')]
P2P Preheat Policy Exist
[Arguments] ${name} ${repo}=${null}

View File

@ -31,7 +31,7 @@ View Scan Error Log
Retry Element Click xpath=${view_log_xpath}
Scan Artifact
[Arguments] ${project} ${repo} ${label_xpath}=//clr-dg-row//label[1]
[Arguments] ${project} ${repo} ${label_xpath}=//clr-dg-row//label[contains(@class,'clr-control-label')][1]
Go Into Repo ${project} ${repo}
Retry Element Click ${label_xpath}
Retry Element Click ${scan_artifact_btn}

View File

@ -25,12 +25,12 @@ Select Payload Format
Select Event Type
[Arguments] @{event_type}
${elements}= Get WebElements //form//div[contains(@class,'clr-control-inline')]//label
${elements}= Get WebElements //form//div[contains(@class,'clr-control-inline')]//label[contains(@class,'clr-control-label')]
FOR ${element} IN @{elements}
Retry Element Click ${element}
END
FOR ${element} IN @{event_type}
Retry Element Click //form//div[contains(@class,'clr-control-inline')]//label[contains(.,'${element}')]
Retry Element Click //form//div[contains(@class,'clr-control-inline')]//label[contains(@class,'clr-control-label') and contains(.,'${element}')]
END
Update A Webhook

View File

@ -128,7 +128,7 @@ Filter Repo
Delete Repo
[Arguments] ${pro_name} ${repo_name}
${element_repo_checkbox}= Set Variable xpath=//clr-dg-row[contains(.,'${pro_name}/${repo_name}')]//div[contains(@class,'clr-checkbox-wrapper')]//label
${element_repo_checkbox}= Set Variable xpath=//clr-dg-row[contains(.,'${pro_name}/${repo_name}')]//div[contains(@class,'clr-checkbox-wrapper')]//label[contains(@class,'clr-control-label')]
Filter Repo ${pro_name} ${repo_name}
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}
@ -145,7 +145,7 @@ Delete Repo on CardView
Delete Project
[Arguments] ${projectname}
Navigate To Projects
Retry Element Click xpath=//clr-dg-row[contains(.,'${projectname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${projectname}')]//div[contains(@class,'clr-checkbox-wrapper')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${project_action_xpath}
Retry Element Click xpath=//*[@id='delete-project']
Retry Element Click //clr-modal//button[contains(.,'DELETE')]
@ -292,7 +292,7 @@ Switch To Project Repo
Add Labels To Tag
[Arguments] ${tagName} ${labelName}
Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${tagName}')]//label[contains(@class,'clr-control-label')]
Retry Element Click xpath=//clr-dg-action-bar//clr-dropdown//span
Retry Element Click xpath=//clr-dropdown-menu//clr-dropdown//button[contains(.,'Add Labels')]
Retry Element Click xpath=//clr-dropdown//div//label[contains(.,'${labelName}')]
@ -317,6 +317,7 @@ Filter Labels In Tags
Get Statics
[Arguments] ${locator}
Reload Page
Wait Until Element Is Visible And Enabled ${locator}
${privaterepo}= Get Text ${locator}
[Return] ${privaterepo}
@ -393,7 +394,7 @@ Should be Accessory deleted
Export CVEs
[Arguments] ${project} ${repositories} ${tags} ${labels} ${cve_ids}
Filter Project ${project}
Retry Element Click //clr-dg-row[contains(.,'${project}')]//div[contains(@class,'clr-checkbox-wrapper')]//label
Retry Element Click //clr-dg-row[contains(.,'${project}')]//div[contains(@class,'clr-checkbox-wrapper')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${project_action_xpath}
Retry Button Click ${export_cve_btn}
Retry Text Input ${export_cve_filter_repo_input} ${repositories}

View File

@ -18,7 +18,7 @@ Documentation This resource provides any keywords related to the Harbor private
*** Variables ***
${create_project_button_xpath} //clr-main-container//button[contains(., 'New Project')]
${project_name_xpath} //*[@id='create_project_name']
${project_public_xpath} //input[@name='public']/..//label
${project_public_xpath} //input[@name='public']/..//label[contains(@class,'clr-control-label')]
${project_save_css} html body.no-scrolling harbor-app harbor-shell clr-main-container.main-container div.content-container div.content-area.content-area-override project div.row div.col-lg-12.col-md-12.col-sm-12.col-xs-12 div.row.flex-items-xs-between div.option-left create-project clr-modal div.modal div.modal-dialog div.modal-content div.modal-footer button.btn.btn-primary
${projects_xpath} //clr-main-container//clr-vertical-nav//a[contains(.,'Projects')]
${project_replication_xpath} //project-detail//a[contains(.,'Replication')]
@ -57,16 +57,16 @@ ${tag_table_column_size} xpath=//clr-dg-column//span[contains(.,'Size')]
${tag_table_column_vulnerability} xpath=//clr-dg-column//span[contains(.,'Vulnerability')]
${tag_images_btn} xpath=//hbr-repository//button[contains(.,'Images')]
${project_member_action_xpath} xpath=//*[@id='member-action']
${project_member_set_role_xpath} xpath=//clr-dropdown-menu//label[contains(.,'Set Role')]
${project_member_set_role_xpath} xpath=//clr-dropdown-menu//label[contains(@class,'clr-control-label') and contains(.,'Set Role')]
${project_config_public_checkbox} xpath=//input[@name='public']
${project_config_content_trust_checkbox} xpath=//input[@name='content-trust']
${project_config_scan_images_on_push_checkbox} xpath=//input[@name='scan-image-on-push']
${project_config_prevent_vulnerable_images_from_running_checkbox} xpath=//input[@name='prevent-vulenrability-image-input']
${project_config_severity_select} xpath=//select[@id='severity']
${project_config_public_checkbox_label} xpath=//*[@id="clr-wrapper-public"]/div/clr-checkbox-wrapper/label
${project_config_prevent_vulenrability_checkbox_label} xpath=//*[@id='prevent-vulenrability-image']//clr-checkbox-wrapper//label
${project_config_system_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(.,'System allowlist')]
${project_config_project_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(.,'Project allowlist')]
${project_config_public_checkbox_label} xpath=//*[@id="clr-wrapper-public"]/div/clr-checkbox-wrapper/label[contains(@class,'clr-control-label')]
${project_config_prevent_vulenrability_checkbox_label} xpath=//*[@id='prevent-vulenrability-image']//clr-checkbox-wrapper//label[contains(@class,'clr-control-label')]
${project_config_system_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(@class,'clr-control-label') and contains(.,'System allowlist')]
${project_config_project_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(@class,'clr-control-label') and contains(.,'Project allowlist')]
${project_config_system_wl_radio_input_id} systemAllowlistOrProjectAllowlist
${project_config_project_wl_radio_input_id} systemAllowlistOrProjectAllowlist
${project_config_project_wl_add_btn} xpath=//*[@id='show-add-modal']

View File

@ -20,7 +20,7 @@ ${delete_btn} //clr-modal//button[contains(.,'DELETE')]
${delete_btn_2} //button[contains(.,'Delete')]
${default_scanner_info_close_icon} /html/body/harbor-app/harbor-shell/clr-main-container/div[1]/div[3]/clr-icon
${back_to_home_link} /html/body/harbor-app/harbor-shell/clr-main-container/div[2]/div/search-result/div/div[2]/a
${select_all_project_box} //label[contains(@for, 'clr-dg-select-all-clr-id-75')]
${select_all_project_box} //label[contains(@class,'clr-control-label') and contains(@for, 'clr-dg-select-all-clr-id-75')]
${export_cve_btn} //button[contains(.,'Export CVEs')]
${export_cve_filter_repo_input} //*[@id='repo']
${export_cve_filter_tag_input} //*[@id='tag']

View File

@ -165,7 +165,7 @@ Trigger Replication Manual
[Arguments] ${rule}
Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${action_bar_replicate}
Retry Wait Until Page Contains Element ${dialog_replicate}
#change from click to mouse down and up
@ -177,7 +177,7 @@ Rename Rule
[Arguments] ${rule} ${newname}
Retry Element Click ${rule_filter_search}
Retry Text Input ${rule_filter_input} ${rule}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${replication_rule_action}
Retry Element Click ${replication_rule_action_bar_edit}
Retry Text Input ${rule_name} ${newname}

View File

@ -19,15 +19,15 @@ Documentation This resource provides any keywords related to the Harbor private
${new_name_xpath} //*[@id='new_replication_rule_id']
${policy_name_xpath} //*[@id='policy_name']
${policy_description_xpath} //*[@id='policy_description']
${policy_enable_checkbox} //input[@id='policy_enable']/../label
${policy_endpoint_checkbox} //input[@id='check_new']/../label
${policy_enable_checkbox} //input[@id='policy_enable']/../label[contains(@class,'clr-control-label')]
${policy_endpoint_checkbox} //input[@id='check_new']/../label[contains(@class,'clr-control-label')]
${destination_name_xpath} //*[@id='destination_name']
${destination_url_xpath} //*[@id='destination_url']
${destination_username_xpath} //*[@id='destination_access_key']
${destination_password_xpath} //*[@id='destination_password']
${replication_save_xpath} //button[contains(.,'OK')]
${replication_xpath} //clr-vertical-nav-group-children/a[contains(.,'Replication')]
${destination_insecure_xpath} //label[@id='destination_insecure_checkbox']
${destination_insecure_xpath} //label[contains(@class,'clr-control-label') and @id='destination_insecure_checkbox']
${new_replication-rule_button} //button[contains(.,'New Replication Rule')]
${link_to_registries} //clr-modal//span[contains(.,'Endpoint')]
${new_endpoint_button} //hbr-endpoint//button[contains(.,'New Endpoint')]
@ -59,8 +59,8 @@ ${dialog_replicate} //clr-modal//button[contains(.,'REPLICATE')]
${action_bar_replicate} //button[contains(.,'Replicate')]
${rule_save_button} //button[contains(.,'SAVE')]
${provider_selector} //*[@id='adapter']
${replication_mode_radio_push} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Push-based')]
${replication_mode_radio_pull} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Pull-based')]
${replication_mode_radio_push} //clr-main-container//hbr-create-edit-rule//label[contains(@class,'clr-control-label') and contains(.,'Push-based')]
${replication_mode_radio_pull} //clr-main-container//hbr-create-edit-rule//label[contains(@class,'clr-control-label') and contains(.,'Pull-based')]
${filter_name_id} //input[@id='filter_name']
${filter_tag_model_select} //div[@class='filterSelect ng-star-inserted'][2]//select
${filter_tag_id} //input[@id='filter_tag']
@ -80,9 +80,9 @@ ${replication_rule_action} //*[@id='rule-action']
${replication_rule_action_bar_edit} //*[@id='edit_replication_rule_id']
${replication_rule_action_bar_delete} //*[@id='delete_replication_rule_id']
${replication_rule_exec_id} //*[@id='replication_exe_id']
${replication_task_line_1} //clr-datagrid//clr-dg-row/div/div[2]//div[contains(@class,'clr-checkbox-wrapper')]/label[1]
${is_overide_xpath} //label[contains(.,'Replace the destination resources if name exists')]
${enable_rule_xpath} //label[contains(.,'Enable rule')]
${replication_task_line_1} //clr-datagrid//clr-dg-row/div/div[2]//div[contains(@class,'clr-checkbox-wrapper')]/label[contains(@class,'clr-control-label')][1]
${is_overide_xpath} //label[contains(@class,'clr-control-label') and contains(.,'Replace the destination resources if name exists')]
${enable_rule_xpath} //label[contains(@class,'clr-control-label') and contains(.,'Enable rule')]
${targetCron_id} //*[@id='targetCron']
${rule_name_input} //*[@id='ruleName']
${src_registry_dropdown_list} //select[@id='src_registry_id']
@ -91,8 +91,8 @@ ${rule_confirm_btn} //*[@id='ruleBtnOk']
${rule_cancel_btn} //*[@id='ruleBtnCancel']
${filter_rules_btn} //*[@id='filter-rules']
${filter_rules_input} //*[@id='filter-rules']//input
${del_remote_checkbox} //label[@for='ruleDeletion']
${del_remote_checkbox} //label[contains(@class,'clr-control-label') and @for='ruleDeletion']
${filter_registry_btn} //hbr-filter
${filter_registry_input} //input[contains(@class,'filter-input')]
${flattening_select} //select[@id='dest_namespace_replace_count']
${copy_by_chunk_checkbox} //label[@for='by-chunk']
${copy_by_chunk_checkbox} //label[contains(@class,'clr-control-label') and @for='by-chunk']

View File

@ -110,7 +110,7 @@ Create A New System Robot Account
${permission_item_list}= Get From Dictionary ${tmp} permission_item_list
Log To Console permission_item_list: ${permission_item_list}
Filter Project In Project Permisstion List ${project_name}
Retry Element Click //clr-dg-row[contains(.,'${project_name}')]//div[contains(@class,'clr-checkbox-wrapper')]/label
Retry Element Click //clr-dg-row[contains(.,'${project_name}')]//div[contains(@class,'clr-checkbox-wrapper')]/label[contains(@class,'clr-control-label')]
Retry Element Click //clr-dg-row[contains(., '${project_name}')]//clr-dropdown/button
Select Project Permission ${project_name} ${permission_item_list}
END

View File

@ -22,7 +22,7 @@ ${sys_robot_account_expiration_type_select} //*[@id='expiration-type']
${sys_robot_account_expiration_input} //*[@id='robotTokenExpiration']
${sys_robot_account_description_textarea} //*[@id='description']
${sys_robot_account_coverall_chb_input} xpath=//input[@id='coverAll']
${sys_robot_account_coverall_chb} //clr-checkbox-wrapper[contains(@class, 'clr-checkbox-wrapper')]/label[contains(@for, 'coverAll')]
${sys_robot_account_coverall_chb} //clr-checkbox-wrapper[contains(@class, 'clr-checkbox-wrapper')]/label[contains(@class,'clr-control-label') and contains(@for, 'coverAll')]
${sys_robot_account_permission_list_btn} //form/section//clr-dropdown/button
${save_sys_robot_account_btn} //*[@id='system-robot-save']
${save_sys_robot_export_to_file_btn} //section//button

View File

@ -51,12 +51,12 @@ Filter Project
Select Object
#select single element such as user project repo tag
[Arguments] ${obj}
Retry Element Click xpath=//clr-dg-row[contains(.,'${obj}')]//label
Retry Element Click xpath=//clr-dg-row[contains(.,'${obj}')]//label[contains(@class,'clr-control-label')]
Multi-delete Object
[Arguments] ${delete_btn} @{obj}
FOR ${obj} IN @{obj}
${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label
${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${element}
END
Sleep 1
@ -70,7 +70,7 @@ Multi-delete Object
Multi-delete Artifact
[Arguments] @{obj}
FOR ${obj} IN @{obj}
${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label
${element}= Set Variable xpath=//clr-dg-row[contains(.,'${obj}')]//label[contains(@class,'clr-control-label')]
Retry Element Click ${element}
END
Sleep 1
@ -85,7 +85,7 @@ Multi-delete Artifact
Multi-delete User
[Arguments] @{obj}
FOR ${obj} IN @{obj}
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//label
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//label[contains(@class,'clr-control-label')]
END
Retry Element Click ${member_action_xpath}
Retry Element Click //*[@id='deleteUser']
@ -95,7 +95,7 @@ Multi-delete User
Multi-delete Member
[Arguments] @{obj}
FOR ${obj} IN @{obj}
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//div[contains(@class,'clr-checkbox-wrapper')]/label
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//div[contains(@class,'clr-checkbox-wrapper')]/label[contains(@class,'clr-control-label')]
END
Retry Double Keywords When Error Retry Element Click ${member_action_xpath} Retry Wait Until Page Contains Element ${delete_action_xpath}
Retry Double Keywords When Error Retry Element Click ${delete_action_xpath} Retry Wait Until Page Contains Element ${delete_btn}
@ -105,10 +105,10 @@ Multi-delete Member
Multi-delete Object Without Confirmation
[Arguments] @{obj}
FOR ${obj} IN @{obj}
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//label
Retry Element Click //clr-dg-row[contains(.,'${obj}')]//label[contains(@class,'clr-control-label')]
END
Retry Double Keywords When Error Retry Element Click ${delete_btn_2} Retry Wait Until Page Not Contains Element ${delete_btn_2}
Select All On Current Page Object
Retry Element Click //div[@class='datagrid-head']//label
Retry Element Click //div[@class='datagrid-head']//label[contains(@class,'clr-control-label')]

View File

@ -397,8 +397,8 @@ Verify System Setting
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure
Page Should Contain ${authtype}[0]
Run Keyword If ${selfreg}[0] == 'True' Checkbox Should Be Checked //clr-checkbox-wrapper[@id='selfReg']//label
Run Keyword If ${selfreg}[0] == 'False' Checkbox Should Not Be Checked //clr-checkbox-wrapper[@id='selfReg']//label
Run Keyword If ${selfreg}[0] == 'True' Checkbox Should Be Checked //clr-checkbox-wrapper[@id='selfReg']//label[contains(@class,'clr-control-label')]
Run Keyword If ${selfreg}[0] == 'False' Checkbox Should Not Be Checked //clr-checkbox-wrapper[@id='selfReg']//label[contains(@class,'clr-control-label')]
Switch To System Settings
${ret} Get Selected List Value xpath=//select[@id='proCreation']
Should Be Equal As Strings ${ret} ${creation}[0]

View File

@ -20,7 +20,7 @@ Set Scan Schedule
Trigger Scan Now And Wait Until The Result Appears
Retry Element Click xpath=${scan_now_button}
Retry Action Keyword Wait Until Element Is Visible And Enabled ${scan_now_button}
Retry Keyword N Times When Error 11 Wait Until Element Is Visible And Enabled ${scan_now_button}
Switch To Vulnerability Page
Retry Element Click xpath=//clr-main-container//clr-vertical-nav//a[contains(.,'Interrogation')]
@ -43,7 +43,7 @@ Scan Is Disabled
Scan Repo
[Arguments] ${tagname} ${status}
Retry Element Click //clr-dg-row[contains(.,'${tagname}')]//label
Retry Element Click //clr-dg-row[contains(.,'${tagname}')]//label[contains(@class,'clr-control-label')]
Retry Element Click //button[@id='scan-btn']
Run Keyword If '${status}' == 'Succeed' Wait Until Element Is Visible //hbr-vulnerability-bar//hbr-result-tip-histogram 300
Run Keyword If '${status}' == 'Fail' Wait Until Element Is Visible //hbr-vulnerability-bar//a 300
@ -55,7 +55,7 @@ Scan Result Should Display In List Row
Enable Scan On Push
Checkbox Should Not Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input
Retry Element Click //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//label
Retry Element Click //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//label[contains(@class,'clr-control-label')]
Checkbox Should Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input
Retry Element Click ${project_config_save_btn}
@ -72,14 +72,14 @@ Should Display The Default Trivy Scanner
Retry Wait Until Page Contains Element //clr-datagrid//clr-dg-row//clr-dg-cell[contains(.,'Trivy')]//span[contains(.,'Default')]
Trivy Is Immutable Scanner
Retry Element Click //clr-dg-row[contains(.,'Trivy')]//clr-radio-wrapper/label
Retry Element Click //clr-dg-row[contains(.,'Trivy')]//clr-radio-wrapper/label[contains(@class,'clr-control-label')]
Retry Double Keywords When Error Retry Element Click ${scanner_action_xpath} Retry Wait Until Page Contains Element ${delete_scanner_action_xpath}
Retry Double Keywords When Error Retry Element Click ${delete_scanner_action_xpath} Retry Wait Until Page Contains Element ${delete_scanner_confirm_btn}
Retry Double Keywords When Error Retry Element Click ${delete_scanner_confirm_btn} Retry Wait Until Page Contains Element ${immutable_trivy_msg_xpath}
Set Default Scanner
[Arguments] ${scanner_name}
Retry Element Click //clr-dg-row[contains(.,'${scanner_name}')]//clr-radio-wrapper/label
Retry Element Click //clr-dg-row[contains(.,'${scanner_name}')]//clr-radio-wrapper/label[contains(@class,'clr-control-label')]
Retry Double Keywords When Error Retry Element Click ${scanner_set_default} Retry Wait Until Page Contains Element ${scanner_set_default_success_xpath}
Check Listed In CVE Allowlist

View File

@ -328,7 +328,7 @@ Test Case - Delete Multi Project
Retry Wait Element Not Visible //clr-datagrid/div/div[2]
@{project_list} Create List projecta projectb
FOR ${project} IN @{project_list}
Retry Element Click //clr-dg-row[contains(.,'${project}')]//label
Retry Element Click //clr-dg-row[contains(.,'${project}')]//label[contains(@class,'clr-control-label')]
END
Retry Element Click ${project_action_xpath}
Retry Element Click ${project_delete_btn}
@ -928,8 +928,8 @@ Test Case - Export CVE
Add Labels To Tag ${images['redis']} ${labels}[1]
Navigate To Projects
Should Not Be Export CVEs
Retry Element Click //clr-dg-row[1]//label
Retry Element Click //clr-dg-row[2]//label
Retry Element Click //clr-dg-row[1]//label[contains(@class,'clr-control-label')]
Retry Element Click //clr-dg-row[2]//label[contains(@class,'clr-control-label')]
Should Not Be Export CVEs
Export CVEs project${d} photon,postgres,nginx,redis ${images['photon']},${images['nginx']},${images['redis']} ${labels} ${cve_ids}[0],${cve_ids}[1],${cve_ids}[2]
${csv_file_path}= Download Latest CVE CSV File
@ -968,7 +968,7 @@ Test Case - Job Service Dashboard Job Queues
${retention_execution2}= Execute Run photon 0/0
# Triggers three IMAGE_SCAN jobs
Go Into Repo project${d} photon
Retry Element Click //clr-datagrid//label[contains(.,'Select All')]
Retry Element Click //clr-datagrid//label[contains(@class,'clr-control-label') and contains(.,'Select All')]
Retry Button Click ${scan_artifact_btn}
# Triggers a GARBAGE_COLLECTION job
${gc_execution1}= GC Now dry_run=${true}
@ -1004,7 +1004,7 @@ Test Case - Job Service Dashboard Job Queues
Purge Now 1 Days Running
# Triggers three IMAGE_SCAN jobs
Go Into Repo project${d} photon
Retry Element Click //clr-datagrid//label[contains(.,'Select All')]
Retry Element Click //clr-datagrid//label[contains(@class,'clr-control-label') and contains(.,'Select All')]
Retry Button Click ${scan_artifact_btn}
# Check job queues
Switch To Job Queues

View File

@ -142,7 +142,7 @@ Test Case - OIDC Group Filter
Retry Wait Until Page Contains Element //clr-dg-pagination//div[contains(@class, 'pagination-description')]
${total}= Get Text //clr-dg-pagination//div[contains(@class, 'pagination-description')]
# Delete all groups
Run Keyword If '${total}' != '0 items' Run Keywords Retry Element Click //div[@class='clr-checkbox-wrapper']//label AND Retry Button Click //button[contains(.,'Delete')] AND Retry Button Click //button[contains(.,'DELETE')]
Run Keyword If '${total}' != '0 items' Run Keywords Retry Element Click //div[@class='clr-checkbox-wrapper']//label[contains(@class,'clr-control-label')] AND Retry Button Click //button[contains(.,'Delete')] AND Retry Button Click //button[contains(.,'DELETE')]
# Set OIDCGroupFilter to .*users
Switch To Configuration Authentication
Retry Text Input //*[@id='OIDCGroupFilter'] .*users