1、提交登录限制关键字和用例2、提交解决登录限制ip修改和删除按钮不可定位问题
This commit is contained in:
@@ -7,7 +7,8 @@ Resource ../objects/ObjectPages.robot
|
||||
|
||||
*** Keywords ***
|
||||
Login_Restrictions
|
||||
[Arguments] ${Login-Restrictions}=1 ${ip-type}=1 ${ip-value}=[192.2.2.2/24] ${ip-value1}=[192.2.2.2/24] ${Maximum-Login-Attemepts}=1 ${Maximum-Login-Attemepts-valuie}=5 ${Lock-Time}=1 ${Lock-Time-valuie}=60
|
||||
[Arguments] ${Login-Restrictions}=1 ${ip-type}=1 ${ip-value}=[192.2.2.2/24] ${ip-value1}=[192.2.2.2/24] ${Maximum-Login-Attemepts}=1 ${Maximum-Login-Attemepts-valuie}=5
|
||||
... ${Lock-Time}=1 ${Lock-Time-valuie}=60
|
||||
sleep 1
|
||||
Menu administration Login Restrictions #点击菜单Login Restrictions
|
||||
sleep 1
|
||||
@@ -16,11 +17,11 @@ Login_Restrictions
|
||||
run keyword if "${Login-Restrictions}"=="open" and "${class}"=="el-switch is-checked" log 按钮为开启状态,不进行操作
|
||||
run keyword if "${Login-Restrictions}"=="open" and "${class}"=="el-switch" Run Keywords log 按钮为关闭状态,需要点击开启
|
||||
... AND sleep 1
|
||||
... AND click element link=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
... AND click element xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
run keyword if "${Login-Restrictions}"=="close" and "${class}"=="el-switch is-checked" Run Keywords log 按钮为开启状态,需要点击关闭
|
||||
... AND sleep 1
|
||||
... AND click element xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
run keyword if "${Login-Restrictions}"=="close" and "${class}"=="el-switch" log 按钮为关闭状态,不进行操作
|
||||
... AND click element xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
run keyword if "${Login-Restrictions}"=="close" and "${class}"=="el-switch" log 按钮为关闭状态,不进行操作
|
||||
sleep 1
|
||||
#判断操作类型
|
||||
run keyword if "${ip-type}"=="create" Ip-Create ${ip-value}
|
||||
@@ -30,8 +31,8 @@ Login_Restrictions
|
||||
run keyword if "${Lock-Time}"=="input" input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[3]/div/div/input ${Lock-Time-valuie}
|
||||
sleep 1
|
||||
click element id=wanAdd_ok
|
||||
sleep 1
|
||||
${Text} get text xpath=/div/p
|
||||
Wait Until Element Is Visible //p[.="Success"] 20
|
||||
${Text} get text //p[.="Success"]
|
||||
sleep 2
|
||||
Should Be Equal As Strings ${Text} Success #断言
|
||||
|
||||
@@ -44,40 +45,43 @@ Ip-Create
|
||||
\ click element id=temporary_form
|
||||
\ sleep 1
|
||||
\ input text id=statusInputedit ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ sleep 1
|
||||
sleep 1
|
||||
|
||||
|
||||
IP-search
|
||||
[Arguments] ${ip}
|
||||
sleep 1
|
||||
input text id=object_ip_search ${ip}
|
||||
sleep 1
|
||||
press keys id=object_ip_search ENTER
|
||||
|
||||
|
||||
IP-Edit
|
||||
[Arguments] ${ip} ${new_ip}
|
||||
${j} get length ${ip}
|
||||
Import Library ${path}variable/LoginRestrictions.py #引用自定义python文件,获取ip索引
|
||||
sleep 1
|
||||
: FOR ${i} IN RANGE ${j}
|
||||
\ sleep 1
|
||||
\ IP-search ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ Click Element //div[text()="${ip}[${i}]"] #点击修改按钮
|
||||
\ sleep 1
|
||||
\ input text id=statusInputedit ${new_ip} #输入修改后的ip
|
||||
\ ${index} index1 ${ip}[${i}] #获取ip所在列表的索引值
|
||||
\ Click Element id=editForm${index} #点击修改按钮
|
||||
\ sleep 1
|
||||
\ input text id=statusInputedit ${new_ip} #输入修改后的ip
|
||||
sleep 1
|
||||
|
||||
|
||||
IP-Delete
|
||||
[Arguments] ${ip}
|
||||
${j} get length ${ip}
|
||||
Import Library ${path}variable/LoginRestrictions.py
|
||||
sleep 1
|
||||
: FOR ${i} IN RANGE ${j}
|
||||
\ sleep 1
|
||||
\ IP-search ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ click element xpath=/html/body/div[1]/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/div/div/div[2]/i[2] #点击删除按钮
|
||||
\ sleep 1
|
||||
\ ${index} index1 ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ click element id=delForm${index} #点击删除按钮
|
||||
\ sleep 1
|
||||
sleep 1
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user