fix(接口测试): 修复禁用本地执行后单步调试提示错误问题

--bug=1021986 --user=赵勇 【接口测试】github#21310,场景内点击单步骤执行,提示“调用资源池执行失败,请检查资源池是否配置正常” https://www.tapd.cn/55049933/s/1327727
This commit is contained in:
fit2-zhao 2023-01-16 16:36:51 +08:00 committed by fit2-zhao
parent cf4287d690
commit 59768cf239
1 changed files with 8 additions and 2 deletions

View File

@ -233,12 +233,17 @@ public class ApiExecuteService {
//检查TCP数据结构等其他进行处理 //检查TCP数据结构等其他进行处理
tcpApiParamService.checkTestElement(request.getTestElement()); tcpApiParamService.checkTestElement(request.getTestElement());
String testId = request.getTestElement() != null && CollectionUtils.isNotEmpty(request.getTestElement().getHashTree()) && CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().get(0).getHashTree()) ? request.getTestElement().getHashTree().get(0).getHashTree().get(0).getName() : request.getId(); String testId = request.getTestElement() != null
&& CollectionUtils.isNotEmpty(request.getTestElement().getHashTree())
&& CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().getFirst().getHashTree())
? request.getTestElement().getHashTree().getFirst().getHashTree().getFirst().getId()
: request.getId();
String runMode = ApiRunMode.DEFINITION.name(); String runMode = ApiRunMode.DEFINITION.name();
if (StringUtils.isNotBlank(request.getType()) && StringUtils.equals(request.getType(), ApiRunMode.API_PLAN.name())) { if (StringUtils.isNotBlank(request.getType()) && StringUtils.equals(request.getType(), ApiRunMode.API_PLAN.name())) {
runMode = ApiRunMode.API_PLAN.name(); runMode = ApiRunMode.API_PLAN.name();
} }
// 加载自定义JAR // 加载自定义JAR
List<String> projectIds = NewDriverManager.loadJar(request); List<String> projectIds = NewDriverManager.loadJar(request);
HashTree hashTree = request.getTestElement().generateHashTree(config); HashTree hashTree = request.getTestElement().generateHashTree(config);
@ -273,7 +278,8 @@ public class ApiExecuteService {
JSONObject elementObj = JSONUtil.parseObject(testCaseWithBLOBs.getRequest()); JSONObject elementObj = JSONUtil.parseObject(testCaseWithBLOBs.getRequest());
ElementUtil.dataFormatting(elementObj); ElementUtil.dataFormatting(elementObj);
MsTestElement element = JSON.parseObject(elementObj.toString(), new TypeReference<MsTestElement>() {}); MsTestElement element = JSON.parseObject(elementObj.toString(), new TypeReference<MsTestElement>() {
});
element.setProjectId(testCaseWithBLOBs.getProjectId()); element.setProjectId(testCaseWithBLOBs.getProjectId());
if (StringUtils.isBlank(request.getEnvironmentId())) { if (StringUtils.isBlank(request.getEnvironmentId())) {
TestPlanApiCaseExample example = new TestPlanApiCaseExample(); TestPlanApiCaseExample example = new TestPlanApiCaseExample();