fix(接口测试): 修复jsonpath断言描述不准确的缺陷

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

View File

@ -19,7 +19,7 @@
class="ms-col-type"
size="small"
style="width: 40%; margin-right: 10px"
@change="reload">
@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"/>
@ -145,7 +145,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.expression + " " + this.jsonPath.option + ": " + (this.jsonPath.expect ? this.jsonPath.expect : '');
this.reload();
},
copyRow() {
let jsonPath = new JSONPath(this.jsonPath);

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"/>
@ -110,7 +110,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();
}
}
}