This commit is contained in:
yyq
2020-05-26 19:55:08 +08:00

View File

@@ -700,17 +700,7 @@ Create-Policy_Verify1
Sleep 1
input id=insert_profileName ${name}
Sleep 1
#Button_Switch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label div/div el-switch is-checked el-switch
: FOR ${list} ${key} IN ENUMERATE @{dict}
\ ${class}= Get Element Attribute xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${key}")]/following-sibling::div/div class
\ run keyword if "${class}"=="el-switch is-checked" and "${dict}[${key}]"=="1" log 默认开启,不进行操作
\ run keyword if "${class}"=="el-switch is-checked" and "${dict}[${key}]"=="0" Run Keywords log 默认开启,但需求需要关闭,进行点击关闭按钮
\ ... AND sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${key}")]/following-sibling::div/div/span
\ run keyword if "${class}"=="el-switch" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮
\ ... AND sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${key}")]/following-sibling::div/div/span
\ run keyword if "${class}"=="el-switch" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作
Button_Switch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), " ")]/following-sibling::div/div el-switch is-checked el-switch
${fail} Set Variable ${fail1}
run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[1]/span
@@ -767,12 +757,12 @@ Button_Switch
[Arguments] ${dict1} ${xpath1} ${xpath2} ${open} ${close}
${dict} Set Variable ${dict1}
: FOR ${list} ${key} IN ENUMERATE @{dict}
\ ${class}= Get Element Attribute xpath=${xpath1}[contains(text(), "${key}")]/following-sibling::${xpath2} class
\ ${class}= Get Element Attribute xpath=${xpath1}${key}${xpath2} class
\ run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="1" log 默认开启,不进行操作
\ run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="0" Run Keywords log 默认开启,但需求需要关闭,进行点击关闭按钮
\ ... AND sleep 1
\ ... AND click xpath=${xpath1}[contains(text(), "${key}")]/following-sibling::${xpath2}/span
\ ... AND click xpath=${xpath1}${key}${xpath2}/span
\ run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮
\ ... AND sleep 1
\ ... AND click xpath=${xpath1}[contains(text(), "${key}")]/following-sibling::${xpath2}/span
\ ... AND click xpath=${xpath1}${key}${xpath2}/span
\ run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作