Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CVE allowlist UI test case #16980

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tests/resources/Harbor-Pages/Configuration.robot
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,15 @@ Switch To System Labels
Sleep 1
Retry Element Click xpath=//clr-main-container//clr-vertical-nav//a[contains(.,'Labels')]

## System labels
Switch To Configuration System Setting
Sleep 1
Retry Element Click xpath=${configuration_xpath}
Retry Element Click xpath=${configuration_system_tabsheet_id}

Switch To Configuration Security
Retry Element Click xpath=${configuration_xpath}
Retry Double Keywords When Error Retry Element Click xpath=${configuration_security_tabsheet_id} Retry Wait Until Page Contains Deployment security

Switch To Configuration Project Quotas
Sleep 1
Retry Element Click xpath=//clr-main-container//clr-vertical-nav//a[contains(.,'Project Quotas')]
Expand Down Expand Up @@ -330,14 +333,14 @@ Add Items To System CVE Allowlist
Retry Element Click ${configuration_system_wl_add_btn}
Retry Text Input ${configuration_system_wl_textarea} ${cve_id}
Retry Element Click ${configuration_system_wl_add_confirm_btn}
Retry Element Click ${config_system_save_button_xpath}
Retry Element Click ${config_security_save_button_xpath}

Delete Top Item In System CVE Allowlist
[Arguments] ${count}=1
FOR ${idx} IN RANGE 1 ${count}
Retry Element Click ${configuration_system_wl_delete_a_cve_id_icon}
Retry Element Click ${configuration_system_wl_delete_a_cve_id_icon}
END
Retry Element Click ${config_system_save_button_xpath}
Retry Element Click ${config_security_save_button_xpath}

Get Project Count Quota Text From Project Quotas List
[Arguments] ${project_name}
Expand Down
8 changes: 4 additions & 4 deletions tests/resources/Harbor-Pages/Configuration_Elements.robot
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ${config_save_button_xpath} //config//div/button[contains(.,'SAVE')]
${config_email_save_button_xpath} //*[@id='config_email_save']
${config_auth_save_button_xpath} //*[@id='config_auth_save']
${config_system_save_button_xpath} //*[@id='config_system_save']
${config_security_save_button_xpath} //*[@id='security_save']
${vulnerbility_save_button_xpath} //*[@id='config-save']
${configuration_xpath} //clr-main-container//clr-vertical-nav//a[contains(.,' Configuration ')]
${garbage_collection_xpath} //*[@id='config-gc']
Expand All @@ -31,12 +32,13 @@ ${gc_config_page} //clr-vertical-nav-group-children/a[contains(.,'Garbage')]
${gc_now_xpath} //*[@id='gc']/gc-config//button[contains(.,'GC')]
${gc_log_details_xpath} //*[@id='clr-dg-row26']/clr-dg-cell[6]/a
${configuration_system_tabsheet_id} //*[@id='config-system']
${configuration_security_tabsheet_id} //*[@id='config-security']
${configuration_authentication_tabsheet_id} //*[@id="config-auth"]
${configuration_project_quotas_tabsheet_id} //*[@id='config-quotas']
${configuration_system_wl_add_btn} //*[@id='show-add-modal-button']
${configuration_system_wl_textarea} //*[@id='allowlist-textarea']
${configuration_system_wl_add_confirm_btn} //*[@id='add-to-system']
${configuration_system_wl_delete_a_cve_id_icon} //system-settings/form/section//ul/li[1]/a[2]/clr-icon
${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']
${checkbox_delete_untagged_artifacts} //gc-config//clr-toggle-wrapper/label[contains(@for,'delete_untagged')]
${cfg_auth_automatic_onboarding_checkbox} //clr-checkbox-wrapper//label[contains(@for,'oidcAutoOnboard')]
Expand Down Expand Up @@ -64,6 +66,4 @@ ${filter_dist_input} //hbr-filter//input

${GC_schedule_edit_btn} //*[@id='editSchedule']
${GC_schedule_select} //*[@id='selectPolicy']
${GC_schedule_save_btn} //*[@id='config-save']


${GC_schedule_save_btn} //*[@id='config-save']
3 changes: 1 addition & 2 deletions tests/resources/Harbor-Pages/Verify.robot
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ Verify System Setting Allowlist
@{cve_ids}= Get Value From Json ${json} $.configuration..cve..id
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure
Switch To System Settings
Switch To Configuration Security
Log To Console "@{cve_ids}"
Loop Verifiy CVE_IDs @{cve_ids}
Close Browser
Expand Down
8 changes: 3 additions & 5 deletions tests/resources/TestCaseBody.robot
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ Body Of Verfiy System Level CVE Allowlist

Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Check Listed In CVE Allowlist project${d} ${image} ${sha256} ${single_cve} is_in=No
Switch To Configure
Switch To Configuration System Setting
Switch To Configuration Security
# Add Items To System CVE Allowlist CVE-2021-36222\nCVE-2021-43527 \nCVE-2021-4044 \nCVE-2021-36084 \nCVE-2021-36085 \nCVE-2021-36086 \nCVE-2021-37750 \nCVE-2021-40528
Add Items To System CVE Allowlist ${most_cve_list}
Cannot Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} err_msg=cannot be pulled due to configured policy
Expand Down Expand Up @@ -326,9 +325,8 @@ Body Of Verfiy Project Level CVE Allowlist By Quick Way of Add System
${signin_user}= Set Variable user025
${signin_pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Configure
Switch To Configuration System Setting
Add Items To System CVE Allowlist ${cve_list}
Switch To Configuration Security
Add Items To System CVE Allowlist ${cve_list}
Logout Harbor
Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd}
Create An New Project And Go Into Project project${d}
Expand Down