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