From cdf67995b719631365eec723a2baff80f3bb2866 Mon Sep 17 00:00:00 2001 From: byb11 Date: Tue, 27 Apr 2021 11:32:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4UI=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui_settings/DecryptionKeyringsCase.robot | 10 +-- .../ui_settings/zResponsepagesCase.robot | 2 +- 02-Keyword/tsg_ui/setting/Settings.robot | 2 +- .../Custometest/LogResponseVAL.py | 86 +++++++++---------- 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: