From 796f17d24f679c1ae2062e3c29efdec09c20a905 Mon Sep 17 00:00:00 2001 From: byb11 Date: Thu, 22 Apr 2021 14:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0Json=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=8A=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot | 7 +++++-- 04-CustomLibrary/Custometest/JsonDiff.py | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot b/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot index c0feaab..f7c5d09 100644 --- a/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot +++ b/01-TestCase/tsg_ui/ui_settings/zResponsepagesCase.robot @@ -82,7 +82,10 @@ datesettest jsondifftest - ${a} Set Variable {"list":{"name":"${TEST NAME}","logType":"security_event_log","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_recv_time","expression":"","label":"Receive Time"},{"name":"common_server_ip","expression":"count"},{"name":"common_server_ip","expression":"count_distinct"}],"filterCondition":null,"havingCondition":null,"isInitialize":0}} + ${a} Set Variable {"list":{"name":"${TEST NAME}","logType":"securitevent_log","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_recv_time","expression":"","label":"Receive Time"},{"name":"common_server_ip","expression":"count"},{"name":"common_server_ip","expression":"count_distinct"}],"filterCondition":null,"havingCondition":null,"isInitialize":0}} ${b} Set Variable {"list":{"name":"${TEST NAME}","logType":"security_event_log","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_recv_time","expression":"","label":"Receive Time"},{"name":"common_server_ip","expression":"count"},{"name":"common_server_ip","expression":"count_distinct"}],"filterCondition":null,"havingCondition":null,"isInitialize":0}} - json_diff ${a} ${b} + ${c} json_diff ${a} ${b} + ${d} Set Variable True + Should Be Equal As Strings ${c} ${d} + diff --git a/04-CustomLibrary/Custometest/JsonDiff.py b/04-CustomLibrary/Custometest/JsonDiff.py index f10002c..ef50112 100644 --- a/04-CustomLibrary/Custometest/JsonDiff.py +++ b/04-CustomLibrary/Custometest/JsonDiff.py @@ -3,5 +3,4 @@ from json_compare import Jcompare def json_diff(a,b): cp=Jcompare() results = cp.compare(a,b) - - assert results == "True" \ No newline at end of file + return results \ No newline at end of file