fix(接口测试): 解决导入场景补充case不能执行的问题
--id=1011678 --user=郭雨琦 【接口测试】导入的场景,自动创建了接口定义,在场景里选mock环境,执行,没有返回api定义的响应体 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001011678
This commit is contained in:
parent
fdd9c08477
commit
2a730f6f7d
|
@ -193,7 +193,10 @@ public class ApiScenarioImportUtil {
|
||||||
object.put("resourceId", test.getId());
|
object.put("resourceId", test.getId());
|
||||||
object.put("projectId", projectId);
|
object.put("projectId", projectId);
|
||||||
object.put("useEnvironment","");
|
object.put("useEnvironment","");
|
||||||
test.setRequest(object.toJSONString());
|
JSONObject objectNew = JSONObject.parseObject(object.toJSONString());
|
||||||
|
objectNew.remove("refType");
|
||||||
|
objectNew.remove("referenced");
|
||||||
|
test.setRequest(objectNew.toJSONString());
|
||||||
test.setUserId(SessionUtils.getUserId());
|
test.setUserId(SessionUtils.getUserId());
|
||||||
test.setLatest(true);
|
test.setLatest(true);
|
||||||
test.setOrder(apiDefinitionService.getImportNextOrder(projectId));
|
test.setOrder(apiDefinitionService.getImportNextOrder(projectId));
|
||||||
|
@ -223,7 +226,10 @@ public class ApiScenarioImportUtil {
|
||||||
object.put("resourceId", apiTestCase.getId());
|
object.put("resourceId", apiTestCase.getId());
|
||||||
object.put("projectId", projectId);
|
object.put("projectId", projectId);
|
||||||
object.put("useEnvironment","");
|
object.put("useEnvironment","");
|
||||||
apiTestCase.setRequest(object.toJSONString());
|
JSONObject objectNew = JSONObject.parseObject(object.toJSONString());
|
||||||
|
objectNew.remove("refType");
|
||||||
|
objectNew.remove("referenced");
|
||||||
|
apiTestCase.setRequest(objectNew.toJSONString());
|
||||||
apiTestCase.setOrder(apiDefinitionService.getImportNextCaseOrder(projectId));
|
apiTestCase.setOrder(apiDefinitionService.getImportNextCaseOrder(projectId));
|
||||||
apiTestCaseMapper.insert(apiTestCase);
|
apiTestCaseMapper.insert(apiTestCase);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue