fix(接口自动化): 修复jmx导入 断言规则处理问题

This commit is contained in:
fit2-zhao 2021-03-03 17:48:21 +08:00
parent ce9d9c8c43
commit 032b9e16e1
2 changed files with 6 additions and 2 deletions

View File

@ -472,13 +472,13 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
if (assertion.getTestStrings() != null && !assertion.getTestStrings().isEmpty()) {
assertionRegex.setExpression(assertion.getTestStrings().get(0).getStringValue());
}
if (assertion.isTestFieldRequestData()) {
if (assertion.isTestFieldResponseData()) {
assertionRegex.setSubject("Response Data");
}
if (assertion.isTestFieldResponseCode()) {
assertionRegex.setSubject("Response Code");
}
if (assertion.isTestFieldRequestHeaders()) {
if (assertion.isTestFieldResponseHeaders()) {
assertionRegex.setSubject("Response Headers");
}
assertions.setName(assertion.getName());

View File

@ -16,6 +16,7 @@
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type"
:placeholder="$t('api_test.request.assertions.select_type')"
size="small">
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
<el-option :label="'JSONPath'" :value="options.JSON_PATH"/>
<el-option :label="'XPath'" :value="options.XPATH2"/>
@ -24,6 +25,9 @@
</el-select>
</el-col>
<el-col :span="20">
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT"
:callback="after"/>
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX"
:callback="after"/>
<ms-api-assertion-json-path :is-read-only="isReadOnly" :list="assertions.jsonPath"