fix(接口测试): 修复测试计划内执行接口用例和场景,执行完成之后没有自动同步执行结果的问题

--bug=1025100 --user=宋天阳
【测试跟踪】github#23404,单独执行测试计划关联的接口用例或场景,执行完成后,用例状态未正确更新
https://www.tapd.cn/55049933/s/1359013
This commit is contained in:
song-tianyang 2023-04-04 11:16:41 +08:00 committed by 建国
parent 3c69f4c8ed
commit 7584af8011
4 changed files with 7 additions and 2 deletions

View File

@ -187,6 +187,10 @@ public class ApiExecuteService {
String runMode = ApiRunMode.DEFINITION.name();
if (StringUtils.isNotBlank(request.getType()) && StringUtils.equals(request.getType(), ApiRunMode.API_PLAN.name())) {
runMode = ApiRunMode.API_PLAN.name();
testId = request.getTestElement() != null &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree()) &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().get(0).getHashTree()) ?
request.getTestElement().getHashTree().get(0).getHashTree().get(0).getName() : request.getId();
}
HashTree hashTree = request.getTestElement().generateHashTree(config);

View File

@ -427,6 +427,7 @@ export default {
this.content.success = successCount;
this.totalTime = report.totalTime;
}
this.$emit('getReportOver');
this.loading = false;
}
} else {

View File

@ -488,8 +488,8 @@ export default {
},
runRefresh(data) {
this.rowLoading = "";
setTimeout(this.initTable, 500)
this.$success(this.$t('schedule.event_success'));
this.initTable();
},
singleRun(row) {
this.runData = [];

View File

@ -178,7 +178,7 @@
<!-- 执行结果 -->
<el-drawer :visible.sync="runVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false"
size="90%">
<ms-api-report-detail @invisible="runVisible = false" @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
<ms-api-report-detail @invisible="runVisible = false" @refresh="search" @getReportOver="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
</el-drawer>
</div>
</el-card>