fix(测试跟踪):修复用例excel导入时重复校验不准确问题。 (#1756)
Co-authored-by: 黎龙鑫 <lilongxinya@163.com> Co-authored-by: jianxing <41557596+AgAngle@users.noreply.github.com>
This commit is contained in:
parent
5c70925360
commit
2534eafcf0
|
@ -182,25 +182,19 @@ public class TestCaseService {
|
||||||
|
|
||||||
List<TestCaseWithBLOBs> caseList = testCaseMapper.selectByExampleWithBLOBs(example);
|
List<TestCaseWithBLOBs> caseList = testCaseMapper.selectByExampleWithBLOBs(example);
|
||||||
|
|
||||||
// 如果上边字段全部相同,去检查 steps 和 remark
|
// 如果上边字段全部相同,去检查 remark 和 steps
|
||||||
boolean isExt = false;
|
|
||||||
String caseRemark = testCase.getRemark();
|
|
||||||
if (StringUtils.isBlank(caseRemark)) {
|
|
||||||
caseRemark = "";
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(caseList)) {
|
if (!CollectionUtils.isEmpty(caseList)) {
|
||||||
|
String caseRemark = testCase.getRemark();
|
||||||
|
String caseSteps = testCase.getSteps();
|
||||||
for (TestCaseWithBLOBs tc : caseList) {
|
for (TestCaseWithBLOBs tc : caseList) {
|
||||||
String steps = tc.getSteps();
|
String steps = tc.getSteps();
|
||||||
String remark = tc.getRemark();
|
String remark = tc.getRemark();
|
||||||
if (StringUtils.equals(steps, testCase.getSteps()) && StringUtils.equals(remark, caseRemark)) {
|
if (StringUtils.equals(steps, caseSteps) && StringUtils.equals(remark, caseRemark)) {
|
||||||
//MSException.throwException(Translator.get("test_case_already_exists"));
|
//MSException.throwException(Translator.get("test_case_already_exists"));
|
||||||
isExt = true;
|
return tc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isExt) {
|
|
||||||
return caseList.get(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue