2020-06-02 11:51:59 +08:00
*** Settings ***
Library Selenium2Library
Resource ../Menu.robot
Library Collections
2021-02-01 19:05:41 +08:00
Library ../../../04-CustomLibrary/Custometest/StringManipulation.py
2021-02-03 20:06:44 +08:00
Resource ../../../03-Variable/bifangapivariable.txt
2021-02-05 10:22:07 +08:00
Library DatabaseLibrary
2020-06-02 11:51:59 +08:00
*** Keywords ***
2021-07-09 15:44:26 +08:00
System
[Arguments] ${SecondaryMenu}
2021-02-02 20:05:00 +08:00
[Documentation]
... ${SecondaryMenu}:二级菜单
2021-07-09 15:44:26 +08:00
click element id=VSidebar1_Home1_App0_anonymousComponent-1_System
sleep ${sleep_min}
click element id=${SecondaryMenu}
sleep ${sleep_min}
2021-02-01 19:48:24 +08:00
UserCreatePage
2021-07-09 15:44:26 +08:00
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable} ${Language} ${page} ${role}
System VSidebar1_Home1_App0_anonymousComponent-1_system_accounts/system_UserManagement
2021-02-01 19:48:24 +08:00
Wait Until Element Is Enabled id=userAdd 10
Click element id=userAdd
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/label[contains(text(), "Name")]/following-sibling::div/div/input ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div[1]/input ${username}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/input ${accPasswd}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div/input ${accPasswd}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
run keyword if "${accEnable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-01 19:48:24 +08:00
... ELSE log 不操作
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
run keyword if "${Required_Password_Change}"=="open" Run Keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${day}
... ELSE log 不开启密码过期验证
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div/div/span/span/i
sleep ${sleep_min}
click element xpath=/html/body/div[2]/div[1]/div[1]/ul/li/span[contains(text(), "${Language}")]
sleep ${sleep_min}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[8]/div/div/div/span/span/i
sleep ${sleep_min}
click element xpath=/html/body/div[3]/div[1]/div[1]/ul/li/span[contains(text(),"${page}")]
sleep ${sleep_min}
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[10]/div/div/div[1]/span/span/i
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2020-12-22 18:34:28 +08:00
click element //span[.="${role}"]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[2]/button[1]
2021-06-17 14:17:39 +08:00
Wait Until Element Is Enabled id=userAdd ${sleep_Wait}
2021-02-02 20:05:00 +08:00
2021-03-01 10:03:36 +08:00
UserCreatePageErrorVerification
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable} ${role}
Menu administration Accounts
Wait Until Element Is Enabled id=userAdd 10
Click element id=userAdd
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div[1]/input ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/input ${username}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-03-01 10:03:36 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[3]/div/div/input ${accPasswd}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div/input ${accPasswd}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
run keyword if "${accEnable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-03-01 10:03:36 +08:00
... ELSE log 不操作
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
run keyword if "${Required_Password_Change}"=="open" Run Keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${day}
2021-03-01 10:03:36 +08:00
... ELSE log 不开启密码过期验证
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[last()]/div/div/div/span/span/i
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-03-01 10:03:36 +08:00
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-03-01 10:03:36 +08:00
click element //span[.="${role}"]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
click button xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[2]/button[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-03-01 10:03:36 +08:00
2021-02-01 19:05:41 +08:00
UserEdit
[Arguments] ${password} ${enable}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
click element id=userEdit
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/input ${password}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div/input ${password}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
run keyword if "${enable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-01 19:05:41 +08:00
... ELSE log 不操作
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
click button xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[2]/button[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
2021-02-03 20:06:44 +08:00
UserSearchName
[Arguments] ${name} ${type}
2021-04-22 15:05:42 +08:00
sleep ${sleep}
2021-07-09 15:44:26 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[1]/input
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
run keyword if "${type}"=="Name" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
run keyword if "${type}"=="UserName" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
sleep ${sleep}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-07-09 15:44:26 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
2021-02-02 20:05:00 +08:00
CreateRoles
[Arguments] ${name} ${description} ${list}
[Documentation]
... ${name}:角色权限名称
... ${description}:备注
... ${list}:权限定位列表
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Click element id=VSidebar1_Home1_App0_anonymousComponent-1_System
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Click element id=VSidebar1_Home1_App0_anonymousComponent-1_system_accounts/roles
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
Click element id=app_create
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-07-09 15:44:26 +08:00
input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${name}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div/input ${description}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
FOR ${i} IN @{list}
log ${i}
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
click element xpath=${i}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
END
click element id=rolesOk
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
EditRoles
[Arguments] ${name}=null ${description}=null ${Authority}=null ${Authorityxpath}=null
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
click element id=appEdit
2021-07-09 15:44:26 +08:00
Wait Until Element Is Enabled xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${sleep_Wait}
2021-03-05 17:28:28 +08:00
run keyword if "${name}" != "null" run keywords sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${name}
2021-02-02 20:05:00 +08:00
... ELSE log name不修改
2021-03-05 17:28:28 +08:00
run keyword if "${description}" != "null" run keywords sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div/input ${description}
2021-02-02 20:05:00 +08:00
... ELSE log description不修改
2021-03-05 17:28:28 +08:00
run keyword if "${Authority}" != "null" run keywords sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
... AND click element xpath=${Authorityxpath}
... ELSE log 权限不修改
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
click element id=rolesOk
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
RolesVerification
[Arguments] ${rolexpath} ${role}
[Documentation]
... ${rolexpath}:权限在侧滑框的定位
... ${role} : 权限 ( Enable、ReadOnly、Disable)
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[3]/div/div/span/span
2021-07-09 15:44:26 +08:00
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[5]/div/p ${sleep_Wait}
2021-02-02 20:05:00 +08:00
${text} Get Element Attribute xpath=${rolexpath} class
${role} Set Variable if "${role}" == "Enable" iconfont switch_i icon-Rolesenable
... "${role}" == "ReadOnly" iconfont switch_i icon-Rolesreadonly
... "${role}" == "Disable" iconfont switch_i icon-Rolesdisable
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
click element id=permission_cancel
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-02 20:05:00 +08:00
Should Be Equal As Strings ${text} ${role}
2021-02-03 20:06:44 +08:00
RoleSearch
[Arguments] ${name}
[Documentation] Roles页面搜索功能
... ${name}:搜索条件name
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[1]/input
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Click element xpath=/html/body/div[2]/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
RolesDelete
Click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
Click element id=appDel
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
Click element xpath=/html/body/div/div/div[3]/button[2]
2021-04-28 11:42:59 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
AuditLogsSearch
[Arguments] ${id} ${TargetType} ${ip}=null
[Documentation]
... ${id} :操作对象的id
... ${TargetType}:类型
... ${ip}:ip不输入默认为测试机IP
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${id}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
run keyword if "${ip}" == "null" run keywords sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[2]/div[3]/div/input ${testClentIP}
2021-03-05 17:28:28 +08:00
... ELSE IF "${ip}" != "null" run keywords sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[2]/div[3]/div/input ${ip}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
click element xpath=/html/body/div/div[1]/div[1]/ul/li/span[contains(text(), "${TargetType}")]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
AuditLogsSearch-NotID
[Arguments] ${TargetType} ${ip}=null
[Documentation]
... ${TargetType}:类型
... ${ip}:ip不输入默认为测试机IP
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-03 20:06:44 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
run keyword if "${ip}" == "null" run keywords sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${testClentIP}
2021-03-05 17:28:28 +08:00
... ELSE IF "${ip}" != "null" run keywords sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${ip}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
click element xpath=/html/body/div/div[1]/div[1]/ul/li/span[contains(text(), "${TargetType}")]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-03 20:06:44 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 14:08:06 +08:00
LoginLogsSearch
[Arguments] ${Operator}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 14:08:06 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 14:08:06 +08:00
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 14:08:06 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/div/input ${Operator}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 14:08:06 +08:00
click element xpath=/html/body/div/div/div/ul/li/span[contains(text(), "${Operator}")]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 14:08:06 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 14:08:06 +08:00
2021-02-04 19:04:56 +08:00
CreateLDAPServer
[Arguments] ${list} ${Enbale}=close ${ADCAuthentication}=close ${NoOKButton}=1
[Documentation]
... ${Name}:LDAP服务器名称 ${Host}:主机地址 ${Port}:端口号 ${UserName} :用户名 ${UserMapper-prefix}:用户映射左匹配 ${UserMapper-suffix}:用户映射器右匹配
... ${Password}:密码 ${ConnectionTimeout}:链接超时时间 ${Enbale};是否生效默认为关闭( open开启) ${ADCAuthentication}: ADC认证默认关闭( open开启) ${NoOKButton}=1不点击OK按钮
2021-07-09 15:44:26 +08:00
System VSidebar1_Home1_App0_anonymousComponent-1_system_LadpServer
2021-02-04 19:04:56 +08:00
click element id=ldapAdd
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${list}[0]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div[1]/input ${list}[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/input ${list}[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div[1]/input ${list}[3]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div[1]/input ${list}[4]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div[2]/input ${list}[5]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${list}[6]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[8]/div/div/div/input ${list}[7]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
run keyword if "${Enbale}"!= "close" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div/span
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... ELSE log 不开启Enable按钮
2021-03-05 17:28:28 +08:00
run keyword if "${ADCAuthentication}"!= "close" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[9]/div/div/span
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... ELSE log 不开启ADCAuthentication按钮
click element id=ldapTestConnection
2021-03-05 17:28:28 +08:00
Wait Until Element Is Enabled xpath=/html/body/div[last()]/p ${sleep_Wait}
run keyword if "${NoOKButton}"== "1" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element id=ldapAddSuccess
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
EditLDAPServer
[Arguments] ${list} ${Enbale}=close ${ADCAuthentication}=close
[Documentation]
... ${Name}:LDAP服务器名称 ${Host}:主机地址 ${Port}:端口号 ${UserName} :用户名 ${UserMapper-prefix}:用户映射左匹配 ${UserMapper-suffix}:用户映射器右匹配
... ${Password}:密码 ${ConnectionTimeout}:链接超时时间 ${Enbale};是否生效默认为关闭( open开启) ${ADCAuthentication}: ADC认证默认关闭( open开启)
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
click element id=ldapEdit
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div[1]/input ${list}[0]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div[1]/input ${list}[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${list}[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div[1]/input ${list}[3]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[8]/div/div[1]/input ${list}[4]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[8]/div/div[2]/input ${list}[5]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[9]/div/div/input ${list}[6]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[11]/div/div/div/input ${list}[7]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
run keyword if "${Enbale}"!= "close" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[10]/div/div/span
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... ELSE log 不开启Enable按钮
2021-03-05 17:28:28 +08:00
run keyword if "${ADCAuthentication}"!= "close" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[12]/div/div/span
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... ELSE log 不开启ADCAuthentication按钮
click element id=ldapTestConnection
2021-03-05 17:28:28 +08:00
Wait Until Element Is Enabled xpath=/html/body/div[last()]/p ${sleep_Wait}
2021-02-04 19:04:56 +08:00
click element id=ldapAddSuccess
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
DeleteLDAPServer
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
click element id=ldapDel
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
click element xpath=/html/body/div/div/div[3]/button[2]
2021-03-05 17:28:28 +08:00
Wait Until Element Is Enabled xpath=/html/body/div[last()]/p ${sleep_Wait}
2021-02-04 19:04:56 +08:00
LDAPServerSearch
[Arguments] ${value} ${search}
2021-03-05 17:28:28 +08:00
Wait Until Element Is Enabled id=ldapAdd ${sleep_Wait}
2021-02-04 19:04:56 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
run keyword if "${search}" == "id" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-03-05 17:28:28 +08:00
run keyword if "${search}" == "name" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${value}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
LDAPVerificationADC
[Arguments] ${name} ${type}
[Documentation] 验证name的ADC按钮是否开启, 同一个服务ADC只能开启一个
... ${name}: 要查询的LDAPServer的名称
... ${type}:判断开启和关闭( close / open)
2021-07-09 15:44:26 +08:00
System VSidebar1_Home1_App0_anonymousComponent-1_system_LadpServer
2021-02-04 19:04:56 +08:00
LDAPServerSearch ${name} name
${text} Get Element Attribute xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[9]/div/div/span/div class
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
run keyword if "${text}" != "el-switch" and "${type}"=="close" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[9]/div/div/span/div
2021-03-05 17:28:28 +08:00
run keyword if "${text}" != "el-switch is-checked" and "${type}"=="open" run keywords sleep ${sleep_min}
2021-02-04 19:04:56 +08:00
... AND click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[9]/div/div/span/div
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
RestrictionsButton
[Arguments] ${type}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
${status1} Get Element Attribute xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div class
${status2} Set Variable If "${status1}"=="el-switch" close open
2021-03-05 17:28:28 +08:00
run keyword if "${status2}" != "${type}" run keywords sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
... AND click element xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div/span
... ELSE log 不需要改变
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
click element id=wanAdd_ok
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
AddAuthorizedSourceIP
[Arguments] ${IP}
[Documentation] 增加IP
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
click element id=temporary_form
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[2]/div/div[1]/div[2]/div[1]/div/div[last()]/div/div[1]/div[1]/div/div[2]/div/input ${IP}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
click element id=wanAdd_ok
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
LoginRestrictions-SearchIP
[Arguments] ${IP}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
input text id=object_ip_search ${IP}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
press keys id=object_ip_search ENTER
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
LoginRestrictions-DeleteIP
2021-05-13 14:15:40 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
${text} Get Element Attribute xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/div/div[2]/div/div/form/div[2]/div/div[1]/div[2]/div[1]/div/div[last()]/div/div/div[2]/i[2] id
2021-05-13 14:15:40 +08:00
click element id=${text}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
click element id=wanAdd_ok
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
LoginRestrictions-LastIPNumber
[Documentation] 返回最后一个IP的位数
${a} Set Variable ${7}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
${text} Get Element Attribute xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/div/div[2]/div/div/form/div[2]/div/div[1]/div[2]/div[1]/div/div[last()]/div/div/div[2]/i[2] id
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-03-29 16:44:20 +08:00
${Number}= StringSegmentation ${text} ${a}
2021-02-05 10:22:07 +08:00
[Return] ${Number}
EditMaximumLoginAttemepts
[Arguments] ${Number}
[Documentation] 修改最多错误次数
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[3]/div/div[1]/input ${Number}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
click element id=wanAdd_ok
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
EditLockTime
[Arguments] ${Time}
[Documentation] 修改等待时间
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[4]/div/div[1]/input ${Time}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
click element id=wanAdd_ok
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 11:30:50 +08:00
OpenMyAccountPage
[Documentation] 打开MyAccount侧滑框
2021-04-28 11:42:59 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
Mouse Hover xpath=//*[@id="app"]/div/div[1]/div[3]/div/span[2]
sleep ${sleep}
2021-02-05 11:30:50 +08:00
click element id=editInfo
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-05 11:30:50 +08:00
EditMyAccount
[Arguments] ${name} ${password} ${ConfirmPassword} ${RequiredPasswordChange}=null ${Day}=null
[Documentation]
...
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-05-12 15:14:31 +08:00
input text id=undefined1 ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[3]/div/div/input ${password}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
input text xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[4]/div/div/input ${ConfirmPassword}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
${status} Get Element Attribute xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[5]/div/div class
2021-03-05 17:28:28 +08:00
run keyword if "${RequiredPasswordChange}"=="open" and "${status}"=="el-switch" run keywords sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND click element xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[5]/div/div/span
2021-03-05 17:28:28 +08:00
... AND sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND input text xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[6]/div/div/input ${Day}
2021-03-05 17:28:28 +08:00
run keyword if "${RequiredPasswordChange}"=="close" and "${status}"=="el-switch is-checked" run keywords sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
... AND click element xpath=/html/body/div[3]/div/div[1]/div/div/div[1]/div/div/div[1]/div[2]/form/div[9]/div[3]/div/div[1]/span
2021-02-05 11:30:50 +08:00
... ELSE log 不修改密码提醒按钮
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 11:30:50 +08:00
click element id=userOk
2021-04-28 11:42:59 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
LoginRestrictionsObtainSQLIP
[Documentation] 获取数据库白名单并返回
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-05 10:22:07 +08:00
Connect To Database Using Custom Params pymysql ${mysqlHost}
${text1} query SELECT login_addr_whitelist FROM login_restrictions_config
${text1} Set Variable ${text1[0][0]}
Disconnect From Database
log ${text1}
[Return] ${text1}
UpdataLoginRestrictionsSQLIP
[Arguments] ${Whitelist}
[Documentation] 恢复白名单数据库
2021-03-11 15:10:08 +08:00
sleep ${sleep}
2021-02-05 10:22:07 +08:00
Connect To Database Using Custom Params pymysql ${mysqlHost}
${return} Execute Sql String UPDATE login_restrictions_config SET login_addr_whitelist='${Whitelist}' WHERE id=1
Disconnect From Database
2021-02-22 13:38:18 +08:00
EditMailServer
[Arguments] ${server} ${port} ${NeedAuthentication} ${name} ${e-mail} ${password} ${SSL}
[Documentation]
...
2021-07-09 15:44:26 +08:00
System VSidebar1_Home1_App0_anonymousComponent-1_system_MailServer
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[1]/div/div/input ${server}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[2]/div/div/input ${port}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
${status} Get Element Attribute xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div class
2021-03-05 17:28:28 +08:00
run keyword if "${NeedAuthentication}" == "close" and "${status}" == "el-switch is-checked" run keywords sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/span
2021-03-05 17:28:28 +08:00
run keyword if "${NeedAuthentication}" == "open" and "${status}" == "el-switch" run keywords sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[3]/div/div/span
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div/div[1]/input ${name}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div/input ${e-mail}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${password}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
${SSLstatus} Get Element Attribute xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div class
2021-03-05 17:28:28 +08:00
run keyword if "${SSL}" == "close" and "${SSLstatus}" == "el-switch is-checked" run keywords sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div/span
2021-03-05 17:28:28 +08:00
run keyword if "${SSL}" == "open" and "${SSLstatus}" == "el-switch" run keywords sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[7]/div/div/span
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-22 13:38:18 +08:00
click element id=mailServerOk
2021-04-22 15:05:42 +08:00
sleep ${sleep}
2021-02-04 19:04:56 +08:00
2021-02-01 19:48:24 +08:00
Login
2021-02-01 19:05:41 +08:00
[Arguments] ${UserName} ${Password}
2021-07-09 15:44:26 +08:00
Mouse Hover xpath=//*[@id="app"]/div/div[1]/div[3]/div/span[2]
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-07-09 15:44:26 +08:00
click element id=SignOut
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
input text xpath=//*[@id="app"]/div/div[2]/div/div[2]/div/input ${UserName}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-01 19:05:41 +08:00
input text xpath=//*[@id="app"]/div/div[2]/div/div[3]/div/input ${Password}
2021-03-05 17:28:28 +08:00
sleep ${sleep_min}
2021-02-01 19:05:41 +08:00
click element xpath=/html/body/div/div/div[2]/div/div[4]/button
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
2021-02-03 20:06:44 +08:00
AdminTurnPage
[Arguments] ${NextPage} ${PreviousPage} ${JumpInput} ${pages} ${AssertXpath} ${last}=null ${lastxpath}=null
2021-02-01 19:05:41 +08:00
[Documentation]
... ${NextPage} 下一页按钮定位
... ${PreviousPage} 上一页按钮定位
2021-02-02 23:44:06 +08:00
... ${JumpInput} 跳转页面输入框
2021-02-01 19:05:41 +08:00
... ${pages} 跳转得页码
2021-02-03 20:06:44 +08:00
... ${last} 次关键字 当最后一页定位和其他页面不同时, 传入非null的值
... ${lastxpath} 当最后一页定位和其他页面不同时, 传入最后一页的xpath 定位
2021-02-01 19:05:41 +08:00
${text1} get text xpath=${AssertXpath}
Click element xpath=${NextPage}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
${text2} get text xpath=${AssertXpath}
Click element xpath=${PreviousPage}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
${text3} get text xpath=${AssertXpath}
Clear Element Text xpath=${JumpInput}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
input text xpath=${JumpInput} ${pages}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
press keys xpath=${JumpInput} ENTER
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
${text4} get text xpath=${AssertXpath}
2021-03-05 17:28:28 +08:00
run keyword if "${last}"=="null" run keywords sleep ${sleep_min}
2021-04-22 15:05:42 +08:00
... AND Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[2]/div/div/div[last()]/div/ul/li[last()]
2021-02-03 20:06:44 +08:00
... ELSE Click element xpath=${lastxpath}
2021-03-05 17:28:28 +08:00
sleep ${sleep}
2021-02-01 19:05:41 +08:00
${text5} get text xpath=${AssertXpath}
Should Not Be Equal ${text1} ${text2}
Should Not Be Equal ${text3} ${text2}
Should Not Be Equal ${text3} ${text4}
2021-07-09 15:44:26 +08:00
Should Not Be Equal ${text1} ${text5}
2021-02-04 14:08:06 +08:00
2021-02-02 20:05:00 +08:00
Assertion
2021-02-05 10:22:07 +08:00
[Arguments] ${assertxpath} ${asserttext}
2021-02-02 20:05:00 +08:00
${text} Get text xpath=${assertxpath}
Should Be Equal As Strings ${text} ${asserttext}
2021-02-04 19:04:56 +08:00
Assertion-ElementAttributes
[Arguments] ${assertxpath} ${asserttext} ${Element}
${text} Get Element Attribute xpath=${assertxpath} ${Element}
Should Be Equal As Strings ${text} ${asserttext}
2021-02-03 20:06:44 +08:00
2020-07-20 18:38:17 +08:00