fix(接口测试): 修复条件控制器判断bug

This commit is contained in:
q4speed 2020-10-12 13:09:40 +08:00
parent 6d15cfb6e1
commit 62a6af8758
1 changed files with 6 additions and 5 deletions

View File

@ -1219,21 +1219,22 @@ class JMXGenerator {
if (request.controller.isValid() && request.controller.enable) { if (request.controller.isValid() && request.controller.enable) {
if (request.controller instanceof IfController) { if (request.controller instanceof IfController) {
let name = request.controller.label(); let name = request.controller.label();
let variable = request.controller.variable; let variable = "\"" + request.controller.variable + "\"";
let operator = request.controller.operator; let operator = request.controller.operator;
let value = request.controller.value; let value = "\"" + request.controller.value + "\"";
if (operator === "=~" || operator === "!~") { if (operator === "=~" || operator === "!~") {
value = "\".*" + value + ".*\""; value = "\".*" + request.controller.value + ".*\"";
} }
if (operator === "is empty") { if (operator === "is empty") {
variable = "empty(\"" + variable + "\")"; variable = "empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }
if (operator === "is not empty") { if (operator === "is not empty") {
variable = "!empty(\"" + variable + "\")"; variable = "!empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }