Skip to content

Commit

Permalink
[cherry-pick]Add Retain image last pull time UI test case (#18696)
Browse files Browse the repository at this point in the history
Add Retain image last pull time UI test case

Fix #18690

Signed-off-by: Yang Jiao <[email protected]>
  • Loading branch information
YangJiao0817 authored May 19, 2023
1 parent 6f51863 commit 96cb84a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/resources/Harbor-Pages/Configuration.robot
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,10 @@ Set Audit Log Forward
Enable Skip Audit Log Database
Switch To System Settings
Retry Double Keywords When Error Click Element ${skip_audit_log_database_label} Checkbox Should Be Selected ${skip_audit_log_database_checkbox}
Retry Double Keywords When Error Retry Element Click ${config_save_button_xpath} Retry Wait Until Page Contains Configuration has been successfully saved.
Retry Double Keywords When Error Retry Element Click ${config_save_button_xpath} Retry Wait Until Page Contains Configuration has been successfully saved.

Set Up Retain Image Last Pull Time
[Arguments] ${action}
Run Keyword If '${action}'=='enable' Retry Double Keywords When Error Click Element ${retain_image_last_pull_time_label} Checkbox Should Be Selected ${retain_image_last_pull_time_checkbox}
... ELSE Retry Double Keywords When Error Click Element ${retain_image_last_pull_time_label} Checkbox Should Not Be Selected ${retain_image_last_pull_time_checkbox}
Retry Double Keywords When Error Retry Element Click ${config_save_button_xpath} Retry Wait Until Page Contains Configuration has been successfully saved.
4 changes: 3 additions & 1 deletion tests/resources/Harbor-Pages/Configuration_Elements.robot
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,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')]
${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')]
${retain_image_last_pull_time_checkbox} //*[@id='scannerSkipUpdatePullTime']
32 changes: 32 additions & 0 deletions tests/robot-cases/Group1-Nightly/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -1133,3 +1133,35 @@ Test Case - Job Service Dashboard Workers
Retry Wait Until Page Not Contains Element //clr-datagrid[.//button[text()='Worker ID']]//clr-dg-row//clr-dg-cell[text()='REPLICATION']
Retry Wait Until Page Contains Element //app-donut-chart//div[text()=' 0/10 ']
Close Browser

Test Case - Retain Image Last Pull Time
[Tags] retain_image_last_pull_time
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
${image}= Set Variable alpine
${tag}= Set Variable 3.10
${project_name}= Set Variable project${d}
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project ${project_name}
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_name} ${image} ${tag} ${tag}
Switch To Configuration System Setting
Set Up Retain Image Last Pull Time enable
Go Into Project ${project_name}
Go Into Repo ${project_name}/${image}
Scan Repo ${tag} Succeed
Sleep 15
Reload Page
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[10]
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[10]
Should Be Empty ${last_pull_time}
Switch To Configuration System Setting
Set Up Retain Image Last Pull Time disable
Go Into Project ${project_name}
Go Into Repo ${project_name}/${image}
Scan Repo ${tag} Succeed
Sleep 15
Reload Page
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[10]
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[10]
Should Not Be Empty ${last_pull_time}
Close Browser

0 comments on commit 96cb84a

Please sign in to comment.