fix(场景自动化) 修复导入jmeter提取参数解析问题

--bug=1007618 --user=赵勇 【github#7356】jmeter5.4.1 导入的用例中,如果正则提取器中包含从 响应头 中提取时,用例中提取器 response headers 无法自动选中 https://www.tapd.cn/55049933/s/1062232
This commit is contained in:
fit2-zhao 2021-11-01 12:36:35 +08:00 committed by fit2-zhao
parent 5938b68390
commit e6b54b980e
2 changed files with 6 additions and 4 deletions

View File

@ -102,7 +102,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
jmterHashTree(testPlan, scenario);
this.projectId = request.getProjectId();
ScenarioImport scenarioImport = new ScenarioImport();
scenarioImport.setData(paseObj(scenario, request));
scenarioImport.setData(parseObj(scenario, request));
scenarioImport.setProjectId(request.getProjectId());
return scenarioImport;
} catch (Exception e) {
@ -112,7 +112,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
return null;
}
private List<ApiScenarioWithBLOBs> paseObj(MsScenario msScenario, ApiTestImportRequest request) {
private List<ApiScenarioWithBLOBs> parseObj(MsScenario msScenario, ApiTestImportRequest request) {
List<ApiScenarioWithBLOBs> scenarioWithBLOBsList = new ArrayList<>();
ApiScenarioWithBLOBs scenarioWithBLOBs = new ApiScenarioWithBLOBs();
ApiScenarioModule selectModule = null;
@ -530,7 +530,9 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
RegexExtractor regexExtractor = (RegexExtractor) key;
if (regexExtractor.useRequestHeaders()) {
regex.setUseHeaders("request_headers");
} else if (regexExtractor.useBody()) {
}if (regexExtractor.useHeaders()) {
regex.setUseHeaders("true");
} if (regexExtractor.useBody()) {
regex.setUseHeaders("false");
} else if (regexExtractor.useUnescapedBody()) {
regex.setUseHeaders("unescaped");

View File

@ -17,7 +17,7 @@
<span class="ms-req-span"> {{content.success? content.success+content.error :0}} 请求</span>
</span>
</div>
<ms-chart id="chart" ref="chart" :options="options" :autoresize="true" v-else/>
<ms-chart id="chart" ref="chart" :options="options" :height="220" :autoresize="true" v-else/>
<el-row type="flex" justify="center" align="middle">
<span class="ms-point-success"/>
<div class="metric-box">