调整UI自动化代码

This commit is contained in:
byb11
2021-04-27 11:32:22 +08:00
parent ff26c17784
commit cdf67995b7
4 changed files with 50 additions and 50 deletions

View File

@@ -135,11 +135,11 @@ DecryptionKeyringsDownload
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span
DeleteKeyrings_del
DecryptionKeyringsTurnPage
[Tags] Positive UI Settings DecryptionKeyrings
OpenPages sidebarProxy_CertificateManagement //*[@id="proxyTabs"]/div/ul/li[2] xpath
TurnPage //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/button[2] //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/button[1]
... //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/span[2]/div/input 2 //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/div/p/span
# DecryptionKeyringsTurnPage
# [Tags] Positive UI Settings DecryptionKeyrings
# OpenPages sidebarProxy_CertificateManagement //*[@id="proxyTabs"]/div/ul/li[2] xpath
# TurnPage //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/button[2] //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/button[1]
# ... //*[@id="app"]/div/div[3]/div[2]/div/div[2]/div[1]/div/div[4]/div/span[2]/div/input 2 //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/div/p/span
DecryptionKeyringsCertificateExpired
[Tags] Positive UI Settings DecryptionKeyrings

View File

@@ -765,7 +765,7 @@ DecryptionKeyringsErrorVerification
click ${type1} #选择加密解密类型
sleep ${sleep_min}
click id=keyringsadd_sub #点击OK缇交
Wait Until Element Is Enabled xpath=${Positioning} ${sleep_Wait}
Wait Until Page Contains Element xpath=${Positioning} ${sleep_Wait}
sleep ${sleep}
${text1} Get Text xpath=${Positioning} #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${Assertion} #断言

View File

@@ -1,3 +1,46 @@
def FieldValidation(responsedict, targetlist):
responselist = responsedict["data"]["list"]
strlist = []
if responselist:
#循环返回数据列表
sum = 1
for response in responselist:
# 循环目地列表
for t in targetlist:
#将目的根据空格分割成列表 “key值”“判断条件”“value值”
target=t.split(" ")
print("target",target)
#判断目的条件的Key在数据中是否存在
if target[0] in response:
targetkey = target[0]
#判断条件
conditions=target[1]
#目的Value
# 对应Key返回数据的Value
responsevalue = response[target[0]]
print(targetkey,conditions,responsevalue)
print(len(target))
if len(target) == 3:
targetvalue=target[2]
p=conditional(conditions,responsevalue,targetkey,sum,targetvalue)
strlist.append(p)
elif len(target) == 2:
p=conditional(conditions, responsevalue, targetkey, sum)
strlist.append(p)
else:
str2 = "返回数据第" + str(sum) + "组数据中不存在该字段:" + target[0]
print(str2)
strlist.append(str2)
sum+=1
else:
str3 = "返回数据中无数据"
strlist.append(str3)
return strlist
def conditional(conditions,value2,targetkey,sum,value=None):
str1=""
if conditions == "=":
@@ -90,49 +133,6 @@ def conditional(conditions,value2,targetkey,sum,value=None):
return str1
def FieldValidation(responsedict, targetlist):
responselist = responsedict["data"]["list"]
strlist = []
if responselist:
#循环返回数据列表
sum = 1
for response in responselist:
# 循环目地列表
for t in targetlist:
#将目的根据空格分割成列表 “key值”“判断条件”“value值”
target=t.split(" ")
print("target",target)
#判断目的条件的Key在数据中是否存在
if target[0] in response:
targetkey = target[0]
#判断条件
conditions=target[1]
#目的Value
# 对应Key返回数据的Value
responsevalue = response[target[0]]
print(targetkey,conditions,responsevalue)
print(len(target))
if len(target) == 3:
targetvalue=target[2]
p=conditional(conditions,responsevalue,targetkey,sum,targetvalue)
strlist.append(p)
elif len(target) == 2:
p=conditional(conditions, responsevalue, targetkey, sum)
strlist.append(p)
else:
str2 = "返回数据第" + str(sum) + "组数据中不存在该字段:" + target[0]
print(str2)
strlist.append(str2)
sum+=1
else:
str3 = "返回数据中无数据"
strlist.append(str3)
return strlist
def Assertresults(resultslist):
print(resultslist)
for i in resultslist: