fix(接口定义): 修复场景列表显示unexecute状态的缺陷

--bug=1021459 --user=王孝刚 【接口测试】执行场景结果是未执行的时候,最后结果字段显示了unexecute
https://www.tapd.cn/55049933/s/1321706
This commit is contained in:
wxg0103 2022-12-30 18:21:32 +08:00 committed by fit2-zhao
parent 783ad1cf1c
commit 083fa1c699
4 changed files with 26 additions and 4 deletions

View File

@ -218,6 +218,9 @@
<el-link type="danger" @click="showReport(row)" v-else-if="row.lastResult === 'Fail'">
{{ $t('api_test.automation.fail') }}
</el-link>
<el-link v-else-if="!row.lastResult || row.lastResult === 'unexecute'" :disabled="true">
{{ $t('api_test.home_page.detail_card.unexecute') }}
</el-link>
<el-link type="danger" style="color: #F6972A" @click="showReport(row)"
v-else-if="row.lastResult === 'errorReportResult'">
{{ $t('error_report_library.option.name') }}

View File

@ -2146,14 +2146,21 @@ export default {
}
});
},
recursionDelete(resourceId, nodes) {
getAllCheckedNodes() {
if (this.$refs.stepTree) {
return this.$refs.stepTree.getCheckedNodes();
}
return [];
},
recursionDelete(item, nodes) {
for (let i in nodes) {
if (nodes[i]) {
if (resourceId === nodes[i].resourceId) {
//caseresourceIdparentIndex
if (item.resourceId === nodes[i].resourceId && item.parentIndex === nodes[i].parentIndex) {
nodes.splice(i, 1);
} else {
if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) {
this.recursionDelete(resourceId, nodes[i].hashTree);
this.recursionDelete(item, nodes[i].hashTree);
}
}
}

View File

@ -892,6 +892,14 @@ export default {
}
});
},
resetResourceId(hashTree) {
hashTree.forEach((item) => {
item.resourceId = getUUID();
if (item.hashTree && item.hashTree.length > 0) {
this.resetResourceId(item.hashTree);
}
});
},
getCaseAndOpen(id, apiName, apiId) {
this.$get('/api/testcase/findById/' + id, (response) => {
let data = response.data;
@ -903,6 +911,9 @@ export default {
} else if (apiCaseRequest.type === "JDBCSampler") {
apiCaseRequest.method = "SQL";
}
if (apiCaseRequest.hashTree && apiCaseRequest.hashTree.length > 0) {
this.resetResourceId(apiCaseRequest.hashTree);
}
apiCaseRequest.name = apiName;
let obj = {
name: "copy_" + data.name,

View File

@ -148,7 +148,8 @@ export function API_SCENARIO_FILTERS () {
],
RESULT_FILTERS: [
{text: i18n.t('api_test.automation.fail'), value: 'Fail'},
{text: i18n.t('api_test.automation.success'), value: 'Success'}
{text: i18n.t('api_test.automation.success'), value: 'Success'},
{text: i18n.t('api_test.home_page.detail_card.unexecute'), value: 'unexecute'}
]
};
/*LEVEL_FILTERS: [