调整UI自动化代码
This commit is contained in:
@@ -135,11 +135,11 @@ DecryptionKeyringsDownload
|
|||||||
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span
|
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span
|
||||||
DeleteKeyrings_del
|
DeleteKeyrings_del
|
||||||
|
|
||||||
DecryptionKeyringsTurnPage
|
# DecryptionKeyringsTurnPage
|
||||||
[Tags] Positive UI Settings DecryptionKeyrings
|
# [Tags] Positive UI Settings DecryptionKeyrings
|
||||||
OpenPages sidebarProxy_CertificateManagement //*[@id="proxyTabs"]/div/ul/li[2] xpath
|
# 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]
|
# 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
|
# ... //*[@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
|
DecryptionKeyringsCertificateExpired
|
||||||
[Tags] Positive UI Settings DecryptionKeyrings
|
[Tags] Positive UI Settings DecryptionKeyrings
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logtest
|
|||||||
${StartTime1} Get Substring ${StartTime} \ -4
|
${StartTime1} Get Substring ${StartTime} \ -4
|
||||||
${filter} Set Variable common_log_id=238347398589845504 OR common_log_id=238347398522859520
|
${filter} Set Variable common_log_id=238347398589845504 OR common_log_id=238347398522859520
|
||||||
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
||||||
${targetdict} create list common_log_id = 237434463277422592
|
${targetdict} create list common_log_id = 237434463277422592
|
||||||
log ${responsebody}
|
log ${responsebody}
|
||||||
${strlist} FieldValidation ${responsebody} ${targetdict}
|
${strlist} FieldValidation ${responsebody} ${targetdict}
|
||||||
log ${strlist}
|
log ${strlist}
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ DecryptionKeyringsErrorVerification
|
|||||||
click ${type1} #选择加密解密类型
|
click ${type1} #选择加密解密类型
|
||||||
sleep ${sleep_min}
|
sleep ${sleep_min}
|
||||||
click id=keyringsadd_sub #点击OK缇交
|
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}
|
sleep ${sleep}
|
||||||
${text1} Get Text xpath=${Positioning} #获取点击后页面文本信息
|
${text1} Get Text xpath=${Positioning} #获取点击后页面文本信息
|
||||||
Should Be Equal As Strings ${text1} ${Assertion} #断言
|
Should Be Equal As Strings ${text1} ${Assertion} #断言
|
||||||
|
|||||||
@@ -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):
|
def conditional(conditions,value2,targetkey,sum,value=None):
|
||||||
str1=""
|
str1=""
|
||||||
if conditions == "=":
|
if conditions == "=":
|
||||||
@@ -90,49 +133,6 @@ def conditional(conditions,value2,targetkey,sum,value=None):
|
|||||||
|
|
||||||
return str1
|
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):
|
def Assertresults(resultslist):
|
||||||
print(resultslist)
|
print(resultslist)
|
||||||
for i in resultslist:
|
for i in resultslist:
|
||||||
|
|||||||
Reference in New Issue
Block a user