fix(接口自动化): 修复执行报告场景名称问题

This commit is contained in:
fit2-zhao 2021-01-18 18:12:02 +08:00
parent cb73ebc2a3
commit ba6c5b85a6
2 changed files with 9 additions and 16 deletions

View File

@ -49,8 +49,6 @@ public class ApiScenarioReportService {
private ApiScenarioMapper apiScenarioMapper;
@Resource
private TestPlanApiScenarioMapper testPlanApiScenarioMapper;
// @Resource
// private TestPlanReportService testPlanReportService;
public ApiScenarioReport complete(TestResult result, String runMode) {
// 更新场景
@ -144,10 +142,7 @@ public class ApiScenarioReportService {
// 报告详情内容
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
// List<ScenarioResult> scenarioResults = new ArrayList();
// scenarioResult.setName(report.getScenarioName());
// scenarioResults.add(scenarioResult);
// newResult.setScenarios(scenarioResults);
scenarioResult.setName(report.getScenarioName());
newResult.addScenario(scenarioResult);
detail.setContent(JSON.toJSONString(newResult).getBytes(StandardCharsets.UTF_8));
@ -219,6 +214,7 @@ public class ApiScenarioReportService {
return lastReport;
}
public ApiScenarioReport updateScenario(TestResult result) {
ApiScenarioReport lastReport = null;
for (ScenarioResult item : result.getScenarios()) {
@ -227,10 +223,7 @@ public class ApiScenarioReportService {
// 报告详情内容
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
TestResult newResult = createTestResult(result.getTestId(), item);
// List<ScenarioResult> scenarioResults = new ArrayList();
// item.setName(report.getScenarioName());
// scenarioResults.add(item);
// newResult.setScenarios(scenarioResults);
item.setName(report.getScenarioName());
newResult.addScenario(item);
detail.setContent(JSON.toJSONString(newResult).getBytes(StandardCharsets.UTF_8));
detail.setReportId(report.getId());

View File

@ -1,5 +1,5 @@
<template>
<el-dialog :title="$t('api_test.scenario.variables')"
<el-dialog :title="$t('api_test.scenario.variables')" :close-on-click-modal="false"
:visible.sync="visible" class="environment-dialog" width="60%"
@close="close">
<div>