提交 988c31be 编写于 作者: F fit2-zhao 提交者: fit2-zhao

fix(接口自动化): 用例触发模式设置及展示

上级 38aa2cae
......@@ -123,13 +123,15 @@ public class ApiScenarioReportService {
public ApiScenarioReport editReport(ScenarioResult test, long startTime) {
ApiScenarioReport report = apiScenarioReportMapper.selectByPrimaryKey(test.getName());
report.setId(report.getId());
report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis()));
report.setCreateTime(startTime);
report.setUpdateTime(startTime);
String status = test.getError() == 0 ? "Success" : "Error";
report.setStatus(status);
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
if (report != null) {
report.setId(report.getId());
report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis()));
report.setCreateTime(startTime);
report.setUpdateTime(startTime);
String status = test.getError() == 0 ? "Success" : "Error";
report.setStatus(status);
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
}
return report;
}
......@@ -175,7 +177,6 @@ public class ApiScenarioReportService {
}
public ApiScenarioReport updatePlanCase(TestResult result, String runMode) {
// TestPlanApiScenario testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(result.getTestId());
List<ScenarioResult> scenarioResultList = result.getScenarios();
ApiScenarioReport returnReport = null;
StringBuilder scenarioIds = new StringBuilder();
......@@ -190,6 +191,9 @@ public class ApiScenarioReportService {
startTime = scenarioResult.getRequestResults().get(0).getStartTime();
}
ApiScenarioReport report = editReport(scenarioResult, startTime);
report.setTriggerMode(ReportTriggerMode.CASE.name());
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
// 报告详情内容
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
......
......@@ -118,7 +118,8 @@ export default {
triggerFilters: [
{text: this.$t('commons.trigger_mode.manual'), value: 'MANUAL'},
{text: this.$t('commons.trigger_mode.schedule'), value: 'SCHEDULE'},
{text: this.$t('commons.trigger_mode.api'), value: 'API'}
{text: this.$t('commons.trigger_mode.api'), value: 'API'},
{text: this.$t('commons.trigger_mode.case'), value: 'CASE'},
],
buttons: [
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册