feat(接口测试): 接口&用例复制文件错误捕获
This commit is contained in:
parent
598bcadf94
commit
da688552cf
|
@ -381,11 +381,16 @@
|
||||||
let copyFilesMap: Record<string, any> = {};
|
let copyFilesMap: Record<string, any> = {};
|
||||||
const fileIds = parseRequestBodyFiles(res.request.body, [], [], []).uploadFileIds;
|
const fileIds = parseRequestBodyFiles(res.request.body, [], [], []).uploadFileIds;
|
||||||
if (fileIds.length > 0 && isCopy) {
|
if (fileIds.length > 0 && isCopy) {
|
||||||
|
try {
|
||||||
copyFilesMap = await definitionFileCopy({
|
copyFilesMap = await definitionFileCopy({
|
||||||
resourceId: typeof apiInfo === 'string' ? apiInfo : apiInfo.id,
|
resourceId: typeof apiInfo === 'string' ? apiInfo : apiInfo.id,
|
||||||
fileIds,
|
fileIds,
|
||||||
});
|
});
|
||||||
parseRequestBodyFiles(res.request.body, res.response, [], [], copyFilesMap); // 替换请求的文件 id
|
parseRequestBodyFiles(res.request.body, res.response, [], [], copyFilesMap); // 替换请求的文件 id
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
parseRequestBodyResult = parseRequestBodyFiles(res.request.body, res.response, [], [], copyFilesMap); // 解析请求体中的文件,将详情中的文件 id 集合收集,更新时以判断文件是否删除以及是否新上传的文件
|
parseRequestBodyResult = parseRequestBodyFiles(res.request.body, res.response, [], [], copyFilesMap); // 解析请求体中的文件,将详情中的文件 id 集合收集,更新时以判断文件是否删除以及是否新上传的文件
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,10 +227,15 @@
|
||||||
let copyFilesMap: Record<string, any> = {};
|
let copyFilesMap: Record<string, any> = {};
|
||||||
const fileIds = parseRequestBodyFiles(apiDetailInfo.value.request.body, [], [], []).uploadFileIds;
|
const fileIds = parseRequestBodyFiles(apiDetailInfo.value.request.body, [], [], []).uploadFileIds;
|
||||||
if (fileIds.length > 0) {
|
if (fileIds.length > 0) {
|
||||||
|
try {
|
||||||
copyFilesMap = await definitionFileCopy({
|
copyFilesMap = await definitionFileCopy({
|
||||||
resourceId: apiDetailInfo.value.id as string,
|
resourceId: apiDetailInfo.value.id as string,
|
||||||
fileIds,
|
fileIds,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
parseRequestBodyFiles(apiDetailInfo.value.request.body, [], [], [], copyFilesMap); // 替换请求文件 id
|
parseRequestBodyFiles(apiDetailInfo.value.request.body, [], [], [], copyFilesMap); // 替换请求文件 id
|
||||||
}
|
}
|
||||||
|
@ -258,10 +263,15 @@
|
||||||
let copyFilesMap: Record<string, any> = {};
|
let copyFilesMap: Record<string, any> = {};
|
||||||
const fileIds = parseRequestBodyFiles(record.request.body, [], [], []).uploadFileIds;
|
const fileIds = parseRequestBodyFiles(record.request.body, [], [], []).uploadFileIds;
|
||||||
if (fileIds.length > 0) {
|
if (fileIds.length > 0) {
|
||||||
|
try {
|
||||||
copyFilesMap = await caseFileCopy({
|
copyFilesMap = await caseFileCopy({
|
||||||
resourceId: record.id as string,
|
resourceId: record.id as string,
|
||||||
fileIds,
|
fileIds,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
parseRequestBodyFiles(record.request.body, [], [], [], copyFilesMap); // 替换请求文件 id
|
parseRequestBodyFiles(record.request.body, [], [], [], copyFilesMap); // 替换请求文件 id
|
||||||
detailForm.value = {
|
detailForm.value = {
|
||||||
|
|
Loading…
Reference in New Issue