fix(测试计划): 修复测试计划里面单独执行接口用例时接口用例列表的最终执行结果没更新的问题
--bug=1018867 --user=宋天阳 【测试跟踪】测试计划-接口用例和场景用例列表中执行用例,在接口测试模块的测试报告中仍能看见报告 https://www.tapd.cn/55049933/s/1276700
This commit is contained in:
parent
beaff1b33a
commit
b818366cd9
|
@ -102,6 +102,15 @@ public class ApiDefinitionExecResultService {
|
||||||
result.setUserId(dto.getExtendedParameters().get("userId").toString());
|
result.setUserId(dto.getExtendedParameters().get("userId").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//如果是测试计划用例,更新接口用例的上次执行结果
|
||||||
|
TestPlanApiCase testPlanApiCase = testPlanApiCaseMapper.selectByPrimaryKey(dto.getTestId());
|
||||||
|
if (testPlanApiCase != null) {
|
||||||
|
ApiTestCaseWithBLOBs apiTestCase = apiTestCaseMapper.selectByPrimaryKey(testPlanApiCase.getApiCaseId());
|
||||||
|
if (apiTestCase != null) {
|
||||||
|
apiTestCase.setLastResultId(dto.getReportId());
|
||||||
|
apiTestCaseMapper.updateByPrimaryKeySelective(apiTestCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 发送通知
|
// 发送通知
|
||||||
LoggerUtil.info("执行结果【 " + result.getName() + " 】入库存储完成");
|
LoggerUtil.info("执行结果【 " + result.getName() + " 】入库存储完成");
|
||||||
sendNotice(result, user);
|
sendNotice(result, user);
|
||||||
|
@ -296,6 +305,12 @@ public class ApiDefinitionExecResultService {
|
||||||
apiCase.setStatus(status);
|
apiCase.setStatus(status);
|
||||||
apiCase.setUpdateTime(System.currentTimeMillis());
|
apiCase.setUpdateTime(System.currentTimeMillis());
|
||||||
testPlanApiCaseMapper.updateByPrimaryKeySelective(apiCase);
|
testPlanApiCaseMapper.updateByPrimaryKeySelective(apiCase);
|
||||||
|
|
||||||
|
ApiTestCaseWithBLOBs apiTestCase = apiTestCaseMapper.selectByPrimaryKey(apiCase.getApiCaseId());
|
||||||
|
if (apiTestCase != null) {
|
||||||
|
apiTestCase.setLastResultId(dto.getReportId());
|
||||||
|
apiTestCaseMapper.updateByPrimaryKeySelective(apiTestCase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setExecResult(dto.getTestId(), status, item.getStartTime());
|
this.setExecResult(dto.getTestId(), status, item.getStartTime());
|
||||||
|
|
Loading…
Reference in New Issue