fix(接口测试): 修复创建case时无法跟随api定义获取内容的缺陷

--bug=1013421 --user=王孝刚 [BUG] [接口测试]
github#13861在用例中添加文档结构断言,选择跟随API定义时,不能将API定义中的内容获取过来,导致断言不生效
https://www.tapd.cn/55049933/s/1165606
This commit is contained in:
wxg0103 2022-05-26 20:30:49 +08:00 committed by jianxing
parent 3f6e32fa90
commit a8099eb681
2 changed files with 5 additions and 2 deletions

View File

@ -218,8 +218,10 @@ export default {
}, },
getDocument() { getDocument() {
// idid // idid
if (this.document && this.document.nodeType && (this.document.nodeType === "scenario" || this.document.nodeType === "Case")) { if (this.document && this.document.nodeType && this.document.nodeType === "scenario") {
this.getCase(); this.getCase();
} else if (this.document && this.document.nodeType && this.document.nodeType === "Case" && this.document.apiDefinitionId) {
this.getAPI(this.document.apiDefinitionId);
} else { } else {
this.getAPI(); this.getAPI();
} }

View File

@ -314,7 +314,8 @@ export default {
if (this.apiCase.request && this.apiCase.request.hashTree && this.apiCase.request.hashTree.length > 0) { if (this.apiCase.request && this.apiCase.request.hashTree && this.apiCase.request.hashTree.length > 0) {
this.apiCase.request.hashTree.forEach(item => { this.apiCase.request.hashTree.forEach(item => {
if (item.type === 'Assertions') { if (item.type === 'Assertions') {
item.document.nodeType = 'Case' item.document.nodeType = 'Case';
item.document.apiDefinitionId = this.apiCase.apiDefinitionId;
} }
}) })
} }