fix(接口测试): 接口测试断言报错空列表过滤保存不正确问题
This commit is contained in:
parent
d19071ad1e
commit
cbab810c8f
|
@ -197,6 +197,13 @@ export const defaultExtractParamItem: ExpressionConfig = {
|
||||||
responseFormat: ResponseBodyXPathAssertionFormat.XML,
|
responseFormat: ResponseBodyXPathAssertionFormat.XML,
|
||||||
moreSettingPopoverVisible: false,
|
moreSettingPopoverVisible: false,
|
||||||
};
|
};
|
||||||
|
// @desc 断言的字段xpath和上边的defaultExtractParamItem不匹配所以添加此类型为了保存参数过滤正确
|
||||||
|
export const assertDefaultParamsItem: ResponseAssertionItem = {
|
||||||
|
expression: '',
|
||||||
|
condition: RequestAssertionCondition.EQUALS,
|
||||||
|
expectedValue: '',
|
||||||
|
enable: true,
|
||||||
|
};
|
||||||
|
|
||||||
// 断言 json默认值
|
// 断言 json默认值
|
||||||
export const jsonPathDefaultParamItem = {
|
export const jsonPathDefaultParamItem = {
|
||||||
|
|
|
@ -1136,6 +1136,7 @@
|
||||||
|
|
||||||
// 处理断言参数
|
// 处理断言参数
|
||||||
const { assertionConfig } = requestVModel.value.children[0];
|
const { assertionConfig } = requestVModel.value.children[0];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: requestVModel.value.id.toString(),
|
id: requestVModel.value.id.toString(),
|
||||||
reportId: reportId.value,
|
reportId: reportId.value,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { type ExecuteAssertionConfig, ExecuteBody, type ExecuteConditionConfig }
|
||||||
import { RequestConditionProcessor, RequestParamsType, ResponseBodyAssertionType } from '@/enums/apiEnum';
|
import { RequestConditionProcessor, RequestParamsType, ResponseBodyAssertionType } from '@/enums/apiEnum';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
assertDefaultParamsItem,
|
||||||
defaultAssertParamsItem,
|
defaultAssertParamsItem,
|
||||||
defaultBodyParamsItem,
|
defaultBodyParamsItem,
|
||||||
defaultExtractParamItem,
|
defaultExtractParamItem,
|
||||||
|
@ -216,7 +217,7 @@ export function filterAssertions(assertionConfig: ExecuteAssertionConfig, isExec
|
||||||
},
|
},
|
||||||
xpathAssertion: {
|
xpathAssertion: {
|
||||||
...assertItem.xpathAssertion,
|
...assertItem.xpathAssertion,
|
||||||
assertions: filterKeyValParams(assertItem?.xpathAssertion?.assertions || [], defaultExtractParamItem, isExecute)
|
assertions: filterKeyValParams(assertItem?.xpathAssertion?.assertions || [], assertDefaultParamsItem, isExecute)
|
||||||
.validParams,
|
.validParams,
|
||||||
},
|
},
|
||||||
jsonPathAssertion: {
|
jsonPathAssertion: {
|
||||||
|
|
Loading…
Reference in New Issue