fix(接口执行): 修复TCP请求不会执行全局前后置脚本的问题

--bug=1009114 --user=宋天阳 【接口测试】tcp接口添加全局前置脚本,脚本不执行
https://www.tapd.cn/55049933/s/1085014
This commit is contained in:
song-tianyang 2021-12-22 15:39:03 +08:00 committed by song-tianyang
parent 16ca9b85fd
commit 6c38dc571c
3 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ public class JMeterScriptUtil {
private static void addItemHashTree(MsTestElement element, HashTree samplerHashTree, ParameterConfig config, String enviromentId) { private static void addItemHashTree(MsTestElement element, HashTree samplerHashTree, ParameterConfig config, String enviromentId) {
if (element != null && element.getEnvironmentId() == null) { if (element != null && element.getEnvironmentId() == null) {
element.setEnvironmentId(enviromentId); element.setEnvironmentId(enviromentId);
element.toHashTree(samplerHashTree, element.getHashTree(), config);
} }
element.toHashTree(samplerHashTree, element.getHashTree(), config);
} }
} }

View File

@ -164,7 +164,7 @@ public class MsTCPSampler extends MsTestElement {
}); });
} }
//根据配置将脚本放置在私有脚本之后 //根据配置将脚本放置在私有脚本之后
JMeterScriptUtil.setScript(envConfig, samplerHashTree, GlobalScriptFilterRequest.TCP.name(), enviromentId, config, false); JMeterScriptUtil.setScript(envConfig, samplerHashTree, GlobalScriptFilterRequest.TCP.name(), enviromentId, config, true);
} }
private void addItemHashTree(MsTestElement element, HashTree samplerHashTree, ParameterConfig config) { private void addItemHashTree(MsTestElement element, HashTree samplerHashTree, ParameterConfig config) {

View File

@ -189,7 +189,7 @@ export let CUSTOM_TABLE_HEADER = {
{id: 'createUser', key: '7', label: 'commons.create_user'}, {id: 'createUser', key: '7', label: 'commons.create_user'},
{id: 'createTime', key: '8', label: 'commons.create_time'}, {id: 'createTime', key: '8', label: 'commons.create_time'},
{id: 'desc', key: '9', label: 'test_track.case.case_desc'}, {id: 'desc', key: '9', label: 'test_track.case.case_desc'},
{id: 'lastExecResult', key: '10', label: 'test_track.plan_view.execute_result'}, {id: 'lastExecResult', key: '0', label: 'test_track.plan_view.execute_result'},
], ],
//缺陷列表 //缺陷列表
ISSUE_LIST: [ ISSUE_LIST: [