Due to replication NG feature already in master branch, old replication UI test cases have been moved out of Jenkins pipeline, and here test case add-replication-test-case-Endpoint-Verification has been finished and ready for duty. (#7472)

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-04-23 15:33:04 +08:00 committed by GitHub
parent d022ad4cd4
commit c3c10a87b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 57 deletions

View File

@ -28,119 +28,120 @@ Check New Rule UI Without Endpoint
Retry Wait Element ${new_endpoint_button}
Create A New Endpoint
[Arguments] ${name} ${url} ${username} ${pwd} ${save}=Y
[Arguments] ${provider} ${name} ${url} ${username} ${pwd} ${save}=Y
#click new button
Click Element xpath=${new_endpoint_button}
Retry Element Click xpath=${new_endpoint_button}
#input necessary info
Input Text xpath=${destination_name_xpath} ${name}
Input Text xpath=${destination_url_xpath} ${url}
Input Text xpath=${destination_username_xpath} ${username}
Input Text xpath=${destination_password_xpath} ${pwd}
Select From List By Value ${provider_selector} ${provider}
Retry Text Input xpath=${destination_name_xpath} ${name}
Run Keyword If '${provider}' != 'dockerHub' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url}
Retry Text Input xpath=${destination_username_xpath} ${username}
Retry Text Input xpath=${destination_password_xpath} ${pwd}
#cancel verify cert since we use a selfsigned cert
Click Element ${destination_insecure_xpath}
Run Keyword If '${save}' == 'Y' Run keyword Click Element ${replication_save_xpath}
Retry Element Click ${destination_insecure_xpath}
Run Keyword If '${save}' == 'Y' Run keyword Retry Double Keywords When Error Retry Element Click ${replication_save_xpath} Retry Wait Until Page Not Contains Element ${replication_save_xpath}
Run Keyword If '${save}' == 'N' No Operation
Create A Rule With Existing Endpoint
# day 1=Monday..7=Sunday timeformat 12hour+am/pm
[Arguments] ${name} ${project_name} ${endpoint} ${mode} ${plan}=Daily ${weekday}=1 ${time}=0800a
#click new
Click Element ${new_name_xpath}
Retry Element Click ${new_name_xpath}
#input name
Input Text ${rule_name} ${name}
#input descripiton,here skip, leave it blank
#source projects, input
Input Text ${source_project} ${project_name}
#set filter
Click Element ${source_image_filter_add}
Retry Element Click ${source_image_filter_add}
Input Text ${source_iamge_repo_filter} *
Click Element ${source_image_filter_add}
Retry Element Click ${source_image_filter_add}
Input Text ${source_image_tag_filter} *
#select endpoint
Click Element ${rule_target_select}
Retry Element Click ${rule_target_select}
Wait Until Element Is Visible //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
Click Element //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
#set trigger
Click Element ${rule_trigger_select}
Retry Element Click //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
#set trigger
Retry Element Click ${rule_trigger_select}
Wait Until Element Is Visible //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Click Element //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Retry Element Click //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Run Keyword If '${mode}' == 'Scheduled' Setting Replicaiton Schedule ${plan} ${weekday} ${time}
#click save
Click Element ${rule_save_button}
Retry Element Click ${rule_save_button}
Project Create A Rule With Existing Endpoint
# day 1=Monday..7=Sunday timeformat 12hour+am/pm
# day 1=Monday..7=Sunday timeformat 12hour+am/pm
[Arguments] ${name} ${project_name} ${endpoint} ${mode} ${plan}=Daily ${weekday}=1 ${time}=0800a
#click new
Click Element ${new_name_xpath}
Retry Element Click ${new_name_xpath}
#input name
Input Text ${rule_name} ${name}
#input descripiton,here skip, leave it blank
#in this keyword, source project is not need to input
#set filter
Click Element ${source_image_filter_add}
Retry Element Click ${source_image_filter_add}
Input Text ${source_iamge_repo_filter} *
Click Element ${source_image_filter_add}
Retry Element Click ${source_image_filter_add}
Input Text ${source_image_tag_filter} *
#select endpoint
Click Element ${rule_target_select}
Retry Element Click ${rule_target_select}
Wait Until Element Is Visible //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
Click Element //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
Retry Element Click //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
#set trigger
Click Element ${rule_trigger_select}
Retry Element Click ${rule_trigger_select}
Wait Until Element Is Visible //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Click Element //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Retry Element Click //select[@id='ruleTrigger']//option[contains(.,'${mode}')]
Run Keyword If '${mode}' == 'Scheduled' Setting Replicaiton Schedule ${plan} ${weekday} ${time}
#click save
Click Element ${rule_save_button}
Retry Element Click ${rule_save_button}
Setting Replication Schedule
[Arguments] ${plan} ${weekday}=1 ${time}=0800a
Click Element ${schedule_type_select}
Retry Element Click ${schedule_type_select}
Wait Until Element Is Visible //select[@name='scheduleType']/option[@value='${plan}']
Click Element //select[@name='scheduleType']/option[@value='${plan}']
Retry Element Click //select[@name='scheduleType']/option[@value='${plan}']
Run Keyword If '${plan}' == 'Weekly' Setting Replication Weekday ${weekday}
Input Text ${shcedule_time} ${time}
Setting Replication Weekday
[arguments] ${day}
Click Element ${schedule_day_select}
Retry Element Click ${schedule_day_select}
Wait Until Element Is Visible //select[@name='scheduleDay']/option[@value='${day}']
Click Element //select[@name='scheduleDay']/option[@value='${day}']
Retry Element Click //select[@name='scheduleDay']/option[@value='${day}']
Endpoint Is Unpingable
Click Element ${ping_test_button}
Retry Element Click ${ping_test_button}
Wait Until Page Contains Failed
Endpoint Is Pingable
Click Element ${ping_test_button}
Retry Element Click ${ping_test_button}
Wait Until Page Contains successfully
Disable Certificate Verification
Checkbox Should Be Selected ${destination_insecure_checkbox}
Click Element ${destination_insecure_xpath}
Retry Element Click ${destination_insecure_xpath}
Sleep 1
Enable Certificate Verification
Checkbox Should Not Be Selected ${destination_insecure_checkbox}
Click Element ${destination_insecure_xpath}
Retry Element Click ${destination_insecure_xpath}
Sleep 1
Switch To Registries
Click Element ${nav_to_registries}
Retry Element Click ${nav_to_registries}
Sleep 1
Switch To Replication Manage
Click Element ${nav_to_replications}
Retry Element Click ${nav_to_replications}
Sleep 1
Trigger Replication Manual
[Arguments] ${rule}
Click Element ${rule_filter_search}
Retry Element Click ${rule_filter_search}
Input Text ${rule_filter_input} ${rule}
Sleep 1
Click Element //clr-dg-row[contains(.,'${rule}')]//label
Click Element ${action_bar_replicate}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_replicate}
Wait Until Page Contains Element ${dialog_replicate}
#change from click to mouse down and up
Mouse Down ${dialog_replicate}
@ -151,21 +152,21 @@ Trigger Replication Manual
Rename Rule
[Arguments] ${rule} ${newname}
Click Element ${rule_filter_search}
Retry Element Click ${rule_filter_search}
Input Text ${rule_filter_input} ${rule}
Sleep 1
Click Element //clr-dg-row[contains(.,'${rule}')]//label
Click Element ${action_bar_edit}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_edit}
Input Text ${rule_name} ${newname}
Click Element ${rule_save_button}
Retry Element Click ${rule_save_button}
Delete Rule
[Arguments] ${rule}
Click Element ${rule_filter_search}
Retry Element Click ${rule_filter_search}
Input Text ${rule_filter_input} ${rule}
Sleep 1
Click Element //clr-dg-row[contains(.,'${rule}')]//label
Click Element ${action_bar_delete}
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click ${action_bar_delete}
Wait Until Page Contains Element ${dialog_delete}
#change from click to mouse down and up
Mouse Down ${dialog_delete}
@ -174,21 +175,21 @@ Delete Rule
Filter Rule
[Arguments] ${rule}
Click Element ${rule_filter_search}
Retry Element Click ${rule_filter_search}
Input Text ${rule_filter_input} ${rule}
Sleep 1
Select Rule
[Arguments] ${rule}
Sleep 1
Click Element //clr-dg-row[contains(.,'${rule}')]//label
Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label
Stop Jobs
Click Element ${stop_jobs_button}
Retry Element Click ${stop_jobs_button}
View Job Log
[arguments] ${job}
Click Element ${job_filter_search}
Retry Element Click ${job_filter_search}
Input Text ${job_filter_input} ${job}
Click Link //clr-dg-row[contains(.,'${job}')]//a
@ -196,19 +197,19 @@ Rename Endpoint
[arguments] ${name} ${newname}
Filter Object ${name}
Select Object ${name}
Click Element ${action_bar_edit}
Retry Element Click ${action_bar_edit}
Wait Until Page Contains Element ${destination_name_xpath}
Input Text ${destination_name_xpath} ${newname}
Click Element ${replication_save_xpath}
Retry Element Click ${replication_save_xpath}
Delete Endpoint
[Arguments] ${name}
Click Element ${endpoint_filter_search}
Retry Element Click ${endpoint_filter_search}
Input Text ${endpoint_filter_input} ${name}
Sleep 1
#click checkbox before target endpoint
Click Element //clr-dg-row[contains(.,'${name}')]//label
Retry Element Click //clr-dg-row[contains(.,'${name}')]//label
Sleep 1
Click Element ${action_bar_delete}
Retry Element Click ${action_bar_delete}
Wait Until Page Contains Element ${dialog_delete}
Click Element ${dialog_delete}
Retry Element Click ${dialog_delete}

View File

@ -23,7 +23,7 @@ ${policy_enable_checkbox} //input[@id='policy_enable']/../label
${policy_endpoint_checkbox} //input[@id='check_new']/../label
${destination_name_xpath} //*[@id='destination_name']
${destination_url_xpath} //*[@id='destination_url']
${destination_username_xpath} //*[@id='destination_username']
${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')]
@ -60,3 +60,4 @@ ${dialog_delete} //clr-modal//button[contains(.,'DELETE')]
${dialog_replicate} //clr-modal//button[contains(.,'REPLICATE')]
${action_bar_replicate} //button[contains(.,'Replicate')]
${rule_save_button} //button[contains(.,'SAVE')]
${provider_selector} //*[@id='adapter']

View File

@ -41,3 +41,24 @@ Test Case - Pro Replication Rules Add
Switch To Replication Manage
Check New Rule UI Without Endpoint
Close Browser
Test Case - Harbor Endpoint Verification
#This case need vailid info and selfsign cert
Init Chrome Driver
${d}= Get Current Date result_format=%M%S
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries
Create A New Endpoint harbor edp1${d} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} N
Endpoint Is Pingable
Enable Certificate Verification
Endpoint Is Unpingable
Close Browser
Test Case - DockerHub Endpoint Verification
#This case need vailid info and selfsign cert
Init Chrome Driver
${d}= Get Current Date result_format=%M%S
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries
Create A New Endpoint dockerHub edp1${d} https://hub.docker.com/ danfengliu Aa123456 Y
Close Browser