From d1d7cb7c72900a650f470cfd45b4a1d9407b1de0 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 1 Jun 2021 11:19:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC=E6=96=AD?= =?UTF-8?q?=E8=A8=80=E6=8E=A8=E8=8D=90=E6=A8=A1=E7=89=88=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/assertion/ApiAssertionJsr223.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/assertion/ApiAssertionJsr223.vue b/frontend/src/business/components/api/definition/components/assertion/ApiAssertionJsr223.vue index c32bfb8ef7..ac5d3feefa 100644 --- a/frontend/src/business/components/api/definition/components/assertion/ApiAssertionJsr223.vue +++ b/frontend/src/business/components/api/definition/components/assertion/ApiAssertionJsr223.vue @@ -153,6 +153,7 @@ let operator = this.assertion.operator; let value = this.assertion.value || ""; let desc = "${" + variable + "} " + operator + " '" + value + "'"; + let msgScript = "\" + value + \" " + operator + " '" + value + "'"; let script = "value = vars.get(\"" + variable + "\");\n" switch (this.assertion.operator) { case "==": @@ -169,24 +170,28 @@ break; case ">": desc = "${" + variable + "} " + operator + " " + value; + msgScript = "\" + value + \" " + operator + " " + value; script += "number = Integer.parseInt(value);\n" + "result = number > " + value + ";\n"; break; case "<": desc = "${" + variable + "} " + operator + " " + value; + msgScript = "\" + value + \" " + operator + " " + value; script += "number = Integer.parseInt(value);\n" + "result = number < " + value + ";\n"; break; case "is empty": - desc = "${" + variable + "} " + operator + desc = "${" + variable + "} " + operator; + msgScript = "\" + value + \" " + operator; script += "result = value == void || value.length() == 0;\n"; break; case "is not empty": - desc = "${" + variable + "} " + operator + desc = "${" + variable + "} " + operator; + msgScript = "\" + value + \" " + operator; script += "result = value != void && value.length() > 0;\n"; break; } - let msg = (operator != "is empty" && operator != "is not empty") ? "assertion [" + desc + "]: false;" : "value " + operator + let msg = (operator !== "is empty" && operator !== "is not empty") ? "assertion [" + msgScript + "]: false;" : "value " + operator script += "if (!result){\n" + "\tmsg = \"" + msg + "\";\n" + "\tAssertionResult.setFailureMessage(msg);\n" +