fix(接口定义): 修复case选择环境组执行生成报告有未执行的缺陷

--bug=1023586 --user=王孝刚 【接口测试】场景中引用了case,选择环境组,执行场景后,这个case还是没有环境
https://www.tapd.cn/55049933/s/1340015
This commit is contained in:
wxg0103 2023-02-22 14:56:48 +08:00 committed by wxg0103
parent cce4190dfa
commit 517ca54dde
1 changed files with 2 additions and 0 deletions

View File

@ -88,6 +88,7 @@ public class MsHashTreeService {
private static final String FOLLOW_REDIRECTS = "followRedirects"; private static final String FOLLOW_REDIRECTS = "followRedirects";
private static final String AUTO_REDIRECTS = "autoRedirects"; private static final String AUTO_REDIRECTS = "autoRedirects";
private static final String ALIAS = "alias"; private static final String ALIAS = "alias";
private static final String INDEX = "index";
public void setHashTree(JSONArray hashTree) { public void setHashTree(JSONArray hashTree) {
// 将引用转成复制 // 将引用转成复制
@ -145,6 +146,7 @@ public class MsHashTreeService {
if (apiTestCase != null) { if (apiTestCase != null) {
if (StringUtils.equalsIgnoreCase(element.optString(REFERENCED), REF)) { if (StringUtils.equalsIgnoreCase(element.optString(REFERENCED), REF)) {
JSONObject refElement = JSONUtil.parseObject(apiTestCase.getRequest()); JSONObject refElement = JSONUtil.parseObject(apiTestCase.getRequest());
refElement.remove(INDEX);
ElementUtil.dataFormatting(refElement); ElementUtil.dataFormatting(refElement);
JSONArray array = refElement.optJSONArray(HASH_TREE); JSONArray array = refElement.optJSONArray(HASH_TREE);
ElementUtil.copyBean(element, refElement); ElementUtil.copyBean(element, refElement);