mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-16 20:01:35 +01:00
Nightly case for tag-retention
Signed-off-by: sshijun <sshijun@vmware.com>
This commit is contained in:
parent
bb8fe1d059
commit
14364727ae
@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="clr-col-5">
|
||||
<div class="w-100">
|
||||
<input required [(ngModel)]="repositories" class="clr-input w-100">
|
||||
<input id="repos" required [(ngModel)]="repositories" class="clr-input w-100">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="clr-col-5">
|
||||
<div class="over-line"></div>
|
||||
<div class="clr-select-wrapper w-100">
|
||||
<select [(ngModel)]="template" class="clr-select w-100">
|
||||
<select id="template" [(ngModel)]="template" class="clr-select w-100">
|
||||
<option class="display-none" value=""></option>
|
||||
<option *ngFor="let t of metadata?.templates"
|
||||
value="{{t?.rule_template}}">{{getI18nKey(t?.action)|translate}}{{getI18nKey(t?.display_text)|translate}}</option>
|
||||
@ -52,7 +52,7 @@
|
||||
<span *ngIf="hasParam()">{{getI18nKey(unit)|translate}}</span>
|
||||
</div>
|
||||
<div class="w-100 disabled">
|
||||
<input *ngIf="hasParam()" [(ngModel)]="num" class="clr-input w-100">
|
||||
<input id="param" *ngIf="hasParam()" [(ngModel)]="num" class="clr-input w-100">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -72,7 +72,7 @@
|
||||
</div>
|
||||
<div class="clr-col-5">
|
||||
<div class="w-100">
|
||||
<input required [(ngModel)]="tagsInput" class="clr-input w-100">
|
||||
<input id="tags" required [(ngModel)]="tagsInput" class="clr-input w-100">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -86,9 +86,9 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="cancel()">{{'BUTTON.CANCEL' | translate}}</button>
|
||||
<button [disabled]="canNotAdd()" type="button" class="btn btn-primary" (click)="add()">
|
||||
<button id="save-add" [disabled]="canNotAdd()" type="button" class="btn btn-primary" (click)="add()">
|
||||
<span *ngIf="isAdd">{{'BUTTON.ADD' | translate}}</span>
|
||||
<span *ngIf="!isAdd">{{'BUTTON.SAVE' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</clr-modal>
|
||||
</clr-modal>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<div class="v-center clr-row" [ngClass]="{'pt-1':retention?.rules?.length > 0}">
|
||||
<div class="clr-col-2 flex-150"></div>
|
||||
<div class="flex-8p">
|
||||
<button [disabled]="retention?.rules?.length >= 15" class="btn btn-primary btn-sm" (click)="openAddRule()">{{'TAG_RETENTION.ADD_RULE' | translate}}</button>
|
||||
<button id="add-rule" [disabled]="retention?.rules?.length >= 15" class="btn btn-primary btn-sm" (click)="openAddRule()">{{'TAG_RETENTION.ADD_RULE' | translate}}</button>
|
||||
</div>
|
||||
<div class="clr-col-6 color-97 font-size-54">
|
||||
{{'TAG_RETENTION.ADD_RULE_HELP_1' | translate}}
|
||||
@ -73,11 +73,11 @@
|
||||
<div class="clr-col-2 pt-2 flex-150"><label class="label-left font-size-54">{{'TAG_RETENTION.RETENTION_RUNS' | translate}}</label></div>
|
||||
<div class="clr-col-10">
|
||||
<clr-dg-action-bar>
|
||||
<button [disabled]="!(retention?.rules?.length > 0)" class="btn btn-outline"
|
||||
<button id="run-now" [disabled]="!(retention?.rules?.length > 0)" class="btn btn-outline"
|
||||
(click)="isRetentionRunOpened=true">
|
||||
<clr-icon shape="play"></clr-icon>
|
||||
<span class="ml-5">{{'TAG_RETENTION.RUN_NOW' | translate}}</span></button>
|
||||
<button [disabled]="!(retention?.rules?.length > 0)" class="btn btn-outline"
|
||||
<button id="dry-run" [disabled]="!(retention?.rules?.length > 0)" class="btn btn-outline"
|
||||
(click)="whatIfRun()">{{'TAG_RETENTION.WHAT_IF_RUN' | translate}}</button>
|
||||
<button [disabled]="!(selectedItem && (selectedItem.status ==='InProgress' || selectedItem.status ==='Running'))"
|
||||
class="btn btn-outline" (click)="abortRun()">
|
||||
@ -188,7 +188,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline"
|
||||
(click)="isRetentionRunOpened=false">{{'BUTTON.CANCEL' | translate}}</button>
|
||||
<button type="button" class="btn btn-primary" (click)="runRetention()">{{'BUTTON.RUN' | translate}}</button>
|
||||
<button id="execute-run" type="button" class="btn btn-primary" (click)="runRetention()">{{'BUTTON.RUN' | translate}}</button>
|
||||
</div>
|
||||
</clr-modal>
|
||||
<clr-modal [(clrModalOpen)]="isAbortedOpened"
|
||||
@ -220,7 +220,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" (click)="closeConfirm()" class="btn btn-primary">{{'BUTTON.OK' | translate}}</button>
|
||||
<button id="schedule-ok" type="button" (click)="closeConfirm()" class="btn btn-primary">{{'BUTTON.OK' | translate}}</button>
|
||||
</div>
|
||||
</clr-modal>
|
||||
<div class="backdrop-transparent" (click)="ruleIndex = -1" *ngIf="ruleIndex !== -1"></div>
|
||||
|
70
tests/resources/Harbor-Pages/Project-Tag-Retention.robot
Normal file
70
tests/resources/Harbor-Pages/Project-Tag-Retention.robot
Normal file
@ -0,0 +1,70 @@
|
||||
# Copyright Project Harbor Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License
|
||||
|
||||
*** Settings ***
|
||||
Documentation This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
|
||||
*** Keywords ***
|
||||
|
||||
Add A Tag Retention Rule
|
||||
Retry Element Click xpath=${project_tag_retention_add_rule_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_template_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_option_always_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_save_add_button_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
|
||||
Delete A Tag Retention Rule
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_delete_button_xpath}
|
||||
Retry Wait Until Page Not Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
|
||||
Edit A Tag Retention Rule
|
||||
[Arguments] ${repos} ${tags}
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_edit_button_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_modal_title_edit_xpath}
|
||||
Input Text ${project_tag_retention_repo_input_xpath} ${repos}
|
||||
Input Text ${project_tag_retention_tags_input_xpath} ${tags}
|
||||
Retry Element Click xpath=${project_tag_retention_save_add_button_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=//span[contains(@class, 'rule-name')]//span[contains(.,'${tags}')]
|
||||
|
||||
Set Daily Schedule
|
||||
Retry Element Click xpath=${project_tag_retention_edit_schedule_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_select_policy_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_option_daily_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_config_save_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_schedule_ok_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_schedule_ok_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_span_daily_xpath}
|
||||
|
||||
Execute Dry Run
|
||||
Retry Element Click xpath=${project_tag_retention_dry_run_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_record_yes_xpath}
|
||||
Sleep 5
|
||||
Retry Element Click xpath=${project_tag_retention_record_yes_xpath}
|
||||
# memcached:123 should be deleted and hello-world:latest should be retained
|
||||
Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '0/1')]
|
||||
|
||||
|
||||
Execute Run
|
||||
Retry Element Click xpath=${project_tag_retention_run_now_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_execute_run_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_record_no_xpath}
|
||||
Sleep 5
|
||||
Retry Element Click xpath=${project_tag_retention_record_no_xpath}
|
||||
# memcached:123 should be deleted and hello-world:latest should be retained
|
||||
Retry Wait Until Page Contains Element xpath=//clr-dg-cell[contains(., '0/1')]
|
@ -0,0 +1,41 @@
|
||||
# Copyright Project Harbor Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License
|
||||
|
||||
*** Settings ***
|
||||
Documentation This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${project_tag_retention_add_rule_xpath} //*[@id='add-rule']
|
||||
${project_tag_retention_repo_input_xpath} //*[@id='repos']
|
||||
${project_tag_retention_param_input_xpath} //*[@id='param']
|
||||
${project_tag_retention_tags_input_xpath} //*[@id='tags']
|
||||
${project_tag_retention_save_add_button_xpath} //*[@id='save-add']
|
||||
${project_tag_retention_template_xpath} //*[@id='template']
|
||||
${project_tag_retention_option_always_xpath} //option[@value='always']
|
||||
${project_tag_retention_rule_name_xpath} //ul//span[@class='rule-name ml-5']
|
||||
${project_tag_retention_edit_schedule_xpath} //*[@id='editSchedule']
|
||||
${project_tag_retention_select_policy_xpath} //*[@id='selectPolicy']
|
||||
${project_tag_retention_option_daily_xpath} //option[@value='Daily']
|
||||
${project_tag_retention_config_save_xpath} //*[@id='config-save']
|
||||
${project_tag_retention_schedule_ok_xpath} //*[@id='schedule-ok']
|
||||
${project_tag_retention_span_daily_xpath} //cron-selection//div//span[contains(.,'0 0 0 * * *')]
|
||||
${project_tag_retention_dry_run_xpath} //*[@id='dry-run']
|
||||
${project_tag_retention_record_yes_xpath} //clr-datagrid[contains(.,'YES')]
|
||||
${project_tag_retention_run_now_xpath} //*[@id='run-now']
|
||||
${project_tag_retention_execute_run_xpath} //*[@id='execute-run']
|
||||
${project_tag_retention_record_no_xpath} //clr-datagrid[contains(.,'NO')]
|
||||
${project_tag_retention_action_button_xpath} //button[contains(.,'ACTION')]
|
||||
${project_tag_retention_delete_button_xpath} //div[contains(@class,'dropdown-menu')]//button[contains(.,'Delete')]
|
||||
${project_tag_retention_edit_button_xpath} //div[contains(@class,'dropdown-menu')]//button[contains(.,'Edit')]
|
||||
${project_tag_retention_modal_title_edit_xpath} //h3[contains(.,'Edit Tag Retention Rule')]
|
@ -65,6 +65,10 @@ Switch To Project Configuration
|
||||
Retry Element Click ${project_config_tabsheet}
|
||||
Sleep 1
|
||||
|
||||
Switch To Tag Retention
|
||||
Retry Element Click xpath=${project_tag_retention_xpath}
|
||||
Sleep 1
|
||||
|
||||
Navigate To Projects
|
||||
Retry Element Click xpath=${projects_xpath}
|
||||
Sleep 2
|
||||
|
@ -26,6 +26,7 @@ ${project_replication_xpath} //project-detail//a[contains(.,'Replication')]
|
||||
${project_log_xpath} //project-detail//li[contains(.,'Logs')]
|
||||
${project_member_xpath} //project-detail//li[contains(.,'Members')]
|
||||
${project_config_tabsheet} xpath=//project-detail//a[contains(.,'Configuration')]
|
||||
${project_tag_retention_xpath} //nav//li//a[contains(.,'Tag')]
|
||||
|
||||
${create_project_CANCEL_button_xpath} xpath=//button[contains(.,'CANCEL')]
|
||||
${create_project_OK_button_xpath} xpath=//button[contains(.,'OK')]
|
||||
|
28
tests/resources/Test-Example/Test.robot
Normal file
28
tests/resources/Test-Example/Test.robot
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
*** Settings ***
|
||||
Documentation Harbor BATs
|
||||
Resource ../Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_URL} https://${ip}
|
||||
${HARBOR_ADMIN} admin
|
||||
${HARBOR_PASSWORD} Harbor12345
|
||||
|
||||
*** Test Cases ***
|
||||
# For Windows
|
||||
Test Case - Example For Windows
|
||||
Open Browser https://localhost:4200 Chrome
|
||||
Retry Element Click xpath=//clr-dropdown/button
|
||||
Retry Element Click xpath=//clr-dropdown/clr-dropdown-menu/a[contains(., 'English')]
|
||||
# your case starts =====================================
|
||||
|
||||
# your case ends ======================================
|
||||
Close Browser
|
||||
|
||||
# For Linux
|
||||
Test Case - Example For Linux
|
||||
init chrome driver
|
||||
# your case starts =====================================
|
||||
|
||||
# your case ends ======================================
|
||||
Close Browser
|
@ -45,6 +45,8 @@ Resource Harbor-Pages/Project-Helmcharts.robot
|
||||
Resource Harbor-Pages/Project-Helmcharts_Elements.robot
|
||||
Resource Harbor-Pages/Project-Retag.robot
|
||||
Resource Harbor-Pages/Project-Retag_Elements.robot
|
||||
Resource Harbor-Pages/Project-Tag-Retention.robot
|
||||
Resource Harbor-Pages/Project-Tag-Retention_Elements.robot
|
||||
Resource Harbor-Pages/Replication.robot
|
||||
Resource Harbor-Pages/Replication_Elements.robot
|
||||
Resource Harbor-Pages/UserProfile.robot
|
||||
@ -264,4 +266,4 @@ Run Curl And Return Json
|
||||
Should Be Equal As Integers 0 ${rc}
|
||||
Create File ${json_data_file} ${output}
|
||||
${json}= Load Json From File ${json_data_file}
|
||||
[Return] ${json}
|
||||
[Return] ${json}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user