209 lines
10 KiB
Plaintext
209 lines
10 KiB
Plaintext
*** Settings ***
|
|
Library Selenium2Library
|
|
Library DatabaseLibrary
|
|
Library SSHLibrary
|
|
Resource ../RE0_Common/KeyWord.robot
|
|
Resource ElementPath_XC.robot
|
|
|
|
*** Keywords ***
|
|
Ux建表
|
|
[Arguments] ${IP} ${User} ${PWD}
|
|
Open Connection ${IP} 22
|
|
log 用户登录远程测试机器
|
|
SSHLibrary.Login ${User} ${PWD}
|
|
Execute Command ./pg_recovery.sh
|
|
Execute Command ./pg_delete_db_table.sh
|
|
log 删除旧的数据库表
|
|
${out}= Execute Command ./pg_create_db_table.sh
|
|
Should Contain ${out} CREATE TABLE
|
|
Close Connection
|
|
|
|
Ux表删除
|
|
[Arguments] ${IP} ${User} ${PWD}
|
|
Open Connection ${IP} 22
|
|
log 用户登录远程测试机器
|
|
SSHLibrary.Login ${User} ${PWD}
|
|
${out}= Execute Command ./pg_delete_db_table.sh
|
|
Should Contain ${out} DROP TABLE
|
|
Close Connection
|
|
|
|
Ux数据插入
|
|
[Arguments] ${IP} ${User} ${PWD}
|
|
Open Connection ${IP} 22
|
|
log 用户登录远程测试机器
|
|
SSHLibrary.Login ${User} ${PWD}
|
|
${out}= Execute Command ./pg_insert_db_table.sh
|
|
Should Contain ${out} INSERT 0 1
|
|
Close Connection
|
|
|
|
Ux表数据查询
|
|
[Arguments] ${IP} ${User} ${PWD}
|
|
Open Connection ${IP} 22
|
|
log 用户登录远程测试机器
|
|
SSHLibrary.Login ${User} ${PWD}
|
|
${out}= Execute Command ./pg_show_db_table.sh
|
|
Should Contain ${out} (1 行记录)
|
|
Close Connection
|
|
Return From Keyword ${out}
|
|
|
|
Ux备份
|
|
[Arguments] ${agent_name} ${Ux_user} ${Ux_pwd} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${encryption} ${compress} ${deduped}
|
|
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
|
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
|
${random_strategyName}= Catenate SEPARATOR=_ Ux ${date}
|
|
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
|
Set Suite Variable ${random_strategyName}
|
|
Set Suite Variable ${createpolicy}
|
|
Sleep 5s
|
|
元素点击 xpath=//span[text()="${agent_name}"] 点击选择代理 定位代理所在位置失败
|
|
sleep 5s
|
|
元素点击 ${BackupSet} 点击进入备份集页面 定位备份集按钮失败
|
|
元素点击 ${dpm_Protection strategy} 点击进入保护策略页面 定位保护策略按钮失败
|
|
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
|
元素点击 ${Ux_source} 点击Ux组件 定位Ux组件失败
|
|
元素输入 ${Input_celuename} ${random_strategyName} 定位策略名输入框失败
|
|
元素输入 ${Input_Ux_user} ${Ux_user} 定位Ux用户输入框失败
|
|
元素输入 ${Input_Ux_Pwd} ${Ux_pwd} 定位Ux用户密码输入框失败
|
|
元素点击 ${Connection credentials_Next} 进入到目标数据库选择界面 定位下一步按钮失败
|
|
元素点击 ${Target_database_Next_Ux} 进入到任务周期页面 定位下一步按钮失败
|
|
元素点击 ${Add_TaskCycle} 点击添加任务周期 定位添加任务周期按钮失败
|
|
元素点击 ${Full_Backup} 勾选完全备份 定位完全备份元素失败
|
|
Sleep 2s
|
|
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
|
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
|
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
|
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
|
元素点击 ${Select_MDS_Ux} 点击介质选择按钮 定位介质选择按钮失败
|
|
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
|
Run Keyword If ${dedup_attr}==1 重删
|
|
... ELSE Log 不勾选重删
|
|
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
|
log 进入备份高级选项
|
|
Run Keyword If ${encryption_attr}==1 加密
|
|
... ELSE Log 不勾选加密
|
|
Run Keyword If ${compress_attr}==1 压缩
|
|
... ELSE Log 不勾选压缩
|
|
sleep 2s
|
|
循环点击 ${Complete_Policy_Create_No_Info} ${Success_Confirm}
|
|
sleep 2s
|
|
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
|
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
|
Sleep 60s
|
|
Wait Until Page Contains Element xpath=//*[@id="backupSetTable"]//tr[2]/td[text()="已完成"] 300s 备份未完成
|
|
Log 备份完成
|
|
sleep 10s
|
|
循环点击 ${BackupSet} ${View}
|
|
sleep 2s
|
|
元素点击 ${View} 点击进入备份集详情 定位备份集详情失败
|
|
Sleep 10s
|
|
加密属性校验 ${encryption}
|
|
压缩属性校验 ${compress}
|
|
重删属性校验 ${deduped}
|
|
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
|
Log 备份集属性确认完毕
|
|
Sleep 2s
|
|
|
|
Ux恢复
|
|
[Arguments] ${user} ${pwd} ${time}
|
|
${UXBFtime} Get text ${bk_time}
|
|
sleep 5s
|
|
循环点击 ${BackupSet} ${Click_recover}
|
|
循环点击 ${Click_recover} ${Input_Ux_userR}
|
|
元素输入 ${Input_Ux_userR} ${user} 定位Ux用户输入框失败
|
|
元素输入 ${Input_Ux_PwdR} ${pwd} 定位Ux密码输入框失败
|
|
元素点击 ${Recover_Nextstep_Ux} 点击下一步进入到恢复高级选项 恢复目标下一步定位失败
|
|
sleep 2s
|
|
Run Keyword If ${time}==1 指定时间点 ${UXBFtime}
|
|
... ELSE Log 不指定时间点
|
|
循环点击 ${Recover} ${Recover_Confirm}
|
|
元素点击 ${Recover_Confirm} 恢复确定 恢复确定弹窗定位失败
|
|
sleep 2s
|
|
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
|
sleep 2s
|
|
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
|
元素输入 xpath=//input[@ng-model="workPolicyName"] 恢复策略 定位所有策略输入框失败
|
|
元素点击 xpath=//span[@id="dpm_tab_work_workPolicyName_search_btn"] 点击查找筛选恢复策略 定位查找按钮失败
|
|
Sleep 60s
|
|
Wait Until Page Contains Element ${Recover_Success} 180s 恢复失败
|
|
sleep 2s
|
|
Log 恢复成功
|
|
|
|
增量备份
|
|
Sleep 2s
|
|
元素点击 ${Complie_incre_Ux} 点击增量备份 定位增量备份失败
|
|
|
|
Ux立即执行
|
|
[Arguments] ${Ux_backuptype}
|
|
元素点击 ${dpm_Protection strategy} 点击进入定时保护策略一栏 定位保护策略栏失败
|
|
元素点击 ${Complie_execute} 点击策略立即执行按钮 定位立即执行元素失败
|
|
循环点击 ${Select_Srctype_Ux} ${Complie_incre_Ux}
|
|
Run Keyword If "${Ux_backuptype}"=="增量" 增量备份
|
|
循环点击 ${ExecutePolicy_execute} ${Complie_confirm}
|
|
元素点击 ${Complie_confirm} 点击确定按钮 定位确定按钮失败
|
|
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
|
Sleep 60s
|
|
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[5][text()="UXDB${Ux_backuptype}备份"] 100s 定位对应备份集失败
|
|
Log 备份集类型为${Ux_backuptype}
|
|
Sleep 5s
|
|
Wait Until Page Contains Element xpath=//*[@id="backupSetTable"]//*[@class=" ev_dhx_web"]//td[text()="已完成"] 300s 备份未完成
|
|
Log 备份完成
|
|
|
|
加密
|
|
元素点击 ${Type_encrypt} 点击勾选加密选项 定位加密失败
|
|
|
|
压缩
|
|
Log 勾选压缩选项
|
|
元素点击 ${Type_compress} 点击勾选压缩选项 定位压缩失败
|
|
|
|
重删
|
|
元素点击 ${Type_dedup} 重删 定位重删失败
|
|
|
|
取消压缩
|
|
元素点击 ${Type_compress} 点击勾选压缩选项 定位压缩失败
|
|
|
|
备份集属性校验
|
|
[Arguments] ${encryption} ${compress} ${deduped}
|
|
sleep 10s
|
|
循环点击 ${BackupSet} ${View}
|
|
sleep 2s
|
|
元素点击 ${View} 点击进入备份集详情 定位备份集详情失败
|
|
Sleep 10s
|
|
加密属性校验 ${encryption}
|
|
压缩属性校验 ${compress}
|
|
重删属性校验 ${deduped}
|
|
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
|
Log 备份集属性确认完毕
|
|
Sleep 2s
|
|
|
|
压缩属性校验
|
|
[Arguments] ${encryption}
|
|
${get_attr}= Get Text ${Compress_Attr}
|
|
Element Text Should Be ${Compress_Attr} ${encryption}
|
|
Log 压缩属性校验完毕
|
|
|
|
加密属性校验
|
|
[Arguments] ${compress}
|
|
${get_attr}= Get Text ${Encryption_Attr}
|
|
Element Should Contain ${Encryption_Attr} ${compress}
|
|
Log 加密属性校验完毕
|
|
|
|
重删属性校验
|
|
[Arguments] ${deduped}
|
|
${get_attr}= Get Text ${Deduped_Attr_UX}
|
|
Element Should Contain ${Deduped_Attr_UX} ${deduped}
|
|
Log 重删属性校验完毕
|
|
|
|
指定时间点
|
|
[Arguments] ${time}
|
|
元素点击 ${UXappointRecover} 点击指定时间点恢复 定位指定时间点恢复失败
|
|
元素输入 ${select_timeDi_UX} ${time} 定位Ux用户输入框失败
|
|
元素点击 ${UXappointRecover} 点击指定时间点恢复 定位指定时间点恢复失败
|
|
元素点击 ${select_timeDi_UX} 点击时间点恢复 定位时间点恢复失败
|
|
元素点击 ${select_timepoint} 点击选择时间 定位选择时间失败
|
|
${min} Get text ${catch_minute}
|
|
${minute} evaluate ${min}-1
|
|
元素点击 xpath=//p[text()="分"]/../ol/li[text()="${minute}"] 点击分 定位选择分失败
|
|
元素点击 ${select_s} 点击秒 定位选择秒失败
|
|
${min} Get text ${catch_minute}
|
|
元素点击 ${confirm_time_UX} 确定恢复时间点 确定恢复时间点失败
|