fix(接口测试): 修复jsonPath断言内容不准确的缺陷

--bug=1024854 --user=王孝刚 [接口测试] github#23072断言,Not
Contains类型的,在报告里体现的描述不准确。 https://www.tapd.cn/55049933/s/1355505
This commit is contained in:
wxg0103 2023-03-24 11:28:24 +08:00 committed by fit2-zhao
parent e69d59caaa
commit bf31999af8
1 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@
</el-col>
<el-col>
<el-select :disabled="isReadOnly" v-model="jsonPath.option" class="ms-col-type" size="small"
style="width:40%;margin-right: 10px" @change="reload">
style="width:40%;margin-right: 10px" @change="setJSONPathDescription">
<el-option :label="$t('api_test.request.assertions.contains')" value="CONTAINS"/>
<el-option :label="$t('api_test.request.assertions.not_contains')" value="NOT_CONTAINS"/>
<el-option :label="$t('api_test.request.assertions.equals')" value="EQUALS"/>
@ -108,7 +108,8 @@ export default {
},
setJSONPathDescription() {
this.showTip = !this.jsonPath || !this.jsonPath.expression || this.jsonPath.expression.length < 50;
this.jsonPath.description = this.jsonPath.expression + " expect: " + (this.jsonPath.expect ? this.jsonPath.expect : '');
this.jsonPath.description = this.jsonPath.expression + " " + this.jsonPath.option + ": " + (this.jsonPath.expect ? this.jsonPath.expect : '');
this.reload();
}
}
}