fix(接口测试): 修复case执行后立即查看执行结果,结果还是上一次执行结果的缺陷

--bug=1027128 --user=王孝刚
【接口测试】接口case-列表执行接口case-第一次成功,第二次失败,立即查看执行结果是第一次的成功信息
https://www.tapd.cn/55049933/s/1386046
This commit is contained in:
wxg0103 2023-06-26 11:41:26 +08:00 committed by f2c-ci-robot[bot]
parent f307f5abfa
commit 7206e6caf6
2 changed files with 5 additions and 3 deletions

View File

@ -442,11 +442,12 @@ export default {
this.apiCaseList[0].execResult = status; this.apiCaseList[0].execResult = status;
this.apiCaseList[0].responseData = data; this.apiCaseList[0].responseData = data;
this.apiCaseList[0].passRate = passRate; this.apiCaseList[0].passRate = passRate;
this.apiCaseList[0].reportId = data.threadName;
this.$refs.apiCaseItem.runLoading = false; this.$refs.apiCaseItem.runLoading = false;
if (this.$refs.apiCaseItem && this.$refs.apiCaseItem[0]) { if (this.$refs.apiCaseItem && this.$refs.apiCaseItem[0]) {
this.$refs.apiCaseItem[0].reload(); this.$refs.apiCaseItem[0].reload();
} }
store.currentApiCase = { refresh: true, id: data.id, status: status, passRate: passRate }; store.currentApiCase = { refresh: true, id: data.id, status: status, passRate: passRate, reportId: data.threadName };
}); });
} }
}, },

View File

@ -663,7 +663,7 @@ export default {
}, },
storeCurrentApiCaseRefresh() { storeCurrentApiCaseRefresh() {
if (store.currentApiCase && store.currentApiCase.refresh) { if (store.currentApiCase && store.currentApiCase.refresh) {
this.setStatus(store.currentApiCase.id, store.currentApiCase.status, store.currentApiCase.passRate); this.setStatus(store.currentApiCase.id, store.currentApiCase.status, store.currentApiCase.passRate, store.currentApiCase.reportId);
} }
store.currentApiCase = {}; store.currentApiCase = {};
}, },
@ -743,12 +743,13 @@ export default {
customHeader() { customHeader() {
this.$refs.caseTable.openCustomHeader(); this.$refs.caseTable.openCustomHeader();
}, },
setStatus(id, status, passRate) { setStatus(id, status, passRate, reportId) {
this.tableData.forEach((item) => { this.tableData.forEach((item) => {
if (id && id === item.id) { if (id && id === item.id) {
item.status = status; item.status = status;
item.execResult = status; item.execResult = status;
item.passRate = passRate; item.passRate = passRate;
item.lastResultId = reportId;
} }
}); });
}, },