summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbyb11 <byb11@DESKTOP-EM3PGKQ>2021-04-27 11:32:22 +0800
committerbyb11 <byb11@DESKTOP-EM3PGKQ>2021-04-27 11:32:22 +0800
commitcdf67995b719631365eec723a2baff80f3bb2866 (patch)
tree1a0a35da4619e1cae80b7e92238d62e485874d28
parentff26c17784938a52381b1035f7b8fa517c8d2f19 (diff)
调整UI自动化代码
-rw-r--r--01-TestCase/tsg_ui/ui_settings/DecryptionKeyringsCase.robot10
-rw-r--r--01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot2
-rw-r--r--02-Keyword/tsg_ui/setting/Settings.robot2
-rw-r--r--04-CustomLibrary/Custometest/LogResponseVAL.py86
4 files changed, 50 insertions, 50 deletions
diff --git a/01-TestCase/tsg_ui/ui_settings/DecryptionKeyringsCase.robot b/01-TestCase/tsg_ui/ui_settings/DecryptionKeyringsCase.robot
index d6eab77..b4e89cd 100644
--- a/01-TestCase/tsg_ui/ui_settings/DecryptionKeyringsCase.robot
+++ b/01-TestCase/tsg_ui/ui_settings/DecryptionKeyringsCase.robot
@@ -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
diff --git a/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot b/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot
index 785b7f8..591d2e3 100644
--- a/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot
+++ b/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot
@@ -37,7 +37,7 @@ logtest
${StartTime1} Get Substring ${StartTime} \ -4
${filter} Set Variable common_log_id=238347398589845504 OR common_log_id=238347398522859520
${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}
${strlist} FieldValidation ${responsebody} ${targetdict}
log ${strlist}
diff --git a/02-Keyword/tsg_ui/setting/Settings.robot b/02-Keyword/tsg_ui/setting/Settings.robot
index e7c8e2b..91808a1 100644
--- a/02-Keyword/tsg_ui/setting/Settings.robot
+++ b/02-Keyword/tsg_ui/setting/Settings.robot
@@ -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} #断言
diff --git a/04-CustomLibrary/Custometest/LogResponseVAL.py b/04-CustomLibrary/Custometest/LogResponseVAL.py
index 449ffdf..72776a6 100644
--- a/04-CustomLibrary/Custometest/LogResponseVAL.py
+++ b/04-CustomLibrary/Custometest/LogResponseVAL.py
@@ -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: