fix(接口测试): 修复xml断言保存失败的缺陷
--bug=1019004 --user=王孝刚 【接口测试】文档结构断言-xml断言,无法手动添加正确的断言 https://www.tapd.cn/55049933/s/1289123
This commit is contained in:
parent
4b1bceb8ac
commit
ab648c5585
|
@ -210,8 +210,12 @@ export function stepCompute(array, request) {
|
|||
|
||||
}
|
||||
|
||||
export function mergeDocumentData(originalData, childMap) {
|
||||
export function mergeDocumentData(originalData, childMap, rootName, rootType) {
|
||||
originalData.forEach(item => {
|
||||
if (item.id === 'root') {
|
||||
item.name = rootName;
|
||||
item.type = rootType;
|
||||
}
|
||||
if (childMap && childMap.has(item.id)) {
|
||||
let sourceData = JSON.parse(JSON.stringify(item.children));
|
||||
item.children = JSON.parse(JSON.stringify(childMap.get(item.id)));
|
||||
|
@ -234,7 +238,7 @@ export function mergeRequestDocumentData(request) {
|
|||
let index = request.hashTree.findIndex(item => item.type === 'Assertions');
|
||||
if (index !== -1) {
|
||||
if (request.hashTree[index].document && request.hashTree[index].document.originalData && request.hashTree[index].document.tableData.size && request.hashTree[index].document.tableData.size !== 0) {
|
||||
mergeDocumentData(request.hashTree[index].document.originalData, request.hashTree[index].document.tableData);
|
||||
mergeDocumentData(request.hashTree[index].document.originalData, request.hashTree[index].document.tableData, request.hashTree[index].document.rootName, request.hashTree[index].document.rootType);
|
||||
if (request.hashTree[index].document.type === 'json') {
|
||||
request.hashTree[index].document.data.json = request.hashTree[index].document.originalData;
|
||||
} else {
|
||||
|
|
|
@ -251,6 +251,10 @@ export default {
|
|||
tree.loadedChildren = true
|
||||
// 渲染子节点
|
||||
resolve(resolveArr);
|
||||
if (tree.id === 'root') {
|
||||
this.$set(this.document, 'rootName', tree.name);
|
||||
this.$set(this.document, 'rootType', tree.type);
|
||||
}
|
||||
this.mapData.set(tree.id, resolveArr);
|
||||
},
|
||||
checkedAPI() {
|
||||
|
|
Loading…
Reference in New Issue