feat(接口自动化): 修复当变量未定义时 影响IF为空或非空判断问题

This commit is contained in:
fit2-zhao 2021-02-05 16:38:03 +08:00
parent d258d7b693
commit 6c188f3f88
2 changed files with 4 additions and 4 deletions

View File

@ -79,13 +79,13 @@ public class MsIfController extends MsTestElement {
} }
if (StringUtils.equals(operator, "is empty")) { if (StringUtils.equals(operator, "is empty")) {
variable = "!empty(" + variable + ")"; variable = variable + "==" + "\"\\" + this.variable + "\"" + "|| empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }
if (StringUtils.equals(operator, "is not empty")) { if (StringUtils.equals(operator, "is not empty")) {
variable = "empty(" + variable + ")"; variable = variable + "!=" + "\"\\" + this.variable + "\"" + "&& !empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }

View File

@ -123,13 +123,13 @@ public class MsLoopController extends MsTestElement {
} }
if (StringUtils.equals(operator, "is empty")) { if (StringUtils.equals(operator, "is empty")) {
variable = "!empty(" + variable + ")"; variable = variable + "==" + "\"\\" + this.whileController.getVariable() + "\"" + "|| empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }
if (StringUtils.equals(operator, "is not empty")) { if (StringUtils.equals(operator, "is not empty")) {
variable = "empty(" + variable + ")"; variable = variable + "!=" + "\"\\" + this.whileController.getVariable() + "\"" + "&& !empty(" + variable + ")";
operator = ""; operator = "";
value = ""; value = "";
} }