fix(接口自动化): 用例触发模式设置及展示
This commit is contained in:
parent
38aa2cae2f
commit
988c31be43
|
@ -123,13 +123,15 @@ public class ApiScenarioReportService {
|
||||||
|
|
||||||
public ApiScenarioReport editReport(ScenarioResult test, long startTime) {
|
public ApiScenarioReport editReport(ScenarioResult test, long startTime) {
|
||||||
ApiScenarioReport report = apiScenarioReportMapper.selectByPrimaryKey(test.getName());
|
ApiScenarioReport report = apiScenarioReportMapper.selectByPrimaryKey(test.getName());
|
||||||
report.setId(report.getId());
|
if (report != null) {
|
||||||
report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis()));
|
report.setId(report.getId());
|
||||||
report.setCreateTime(startTime);
|
report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis()));
|
||||||
report.setUpdateTime(startTime);
|
report.setCreateTime(startTime);
|
||||||
String status = test.getError() == 0 ? "Success" : "Error";
|
report.setUpdateTime(startTime);
|
||||||
report.setStatus(status);
|
String status = test.getError() == 0 ? "Success" : "Error";
|
||||||
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
|
report.setStatus(status);
|
||||||
|
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
|
||||||
|
}
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +177,6 @@ public class ApiScenarioReportService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiScenarioReport updatePlanCase(TestResult result, String runMode) {
|
public ApiScenarioReport updatePlanCase(TestResult result, String runMode) {
|
||||||
// TestPlanApiScenario testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(result.getTestId());
|
|
||||||
List<ScenarioResult> scenarioResultList = result.getScenarios();
|
List<ScenarioResult> scenarioResultList = result.getScenarios();
|
||||||
ApiScenarioReport returnReport = null;
|
ApiScenarioReport returnReport = null;
|
||||||
StringBuilder scenarioIds = new StringBuilder();
|
StringBuilder scenarioIds = new StringBuilder();
|
||||||
|
@ -190,6 +191,9 @@ public class ApiScenarioReportService {
|
||||||
startTime = scenarioResult.getRequestResults().get(0).getStartTime();
|
startTime = scenarioResult.getRequestResults().get(0).getStartTime();
|
||||||
}
|
}
|
||||||
ApiScenarioReport report = editReport(scenarioResult, startTime);
|
ApiScenarioReport report = editReport(scenarioResult, startTime);
|
||||||
|
report.setTriggerMode(ReportTriggerMode.CASE.name());
|
||||||
|
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
|
||||||
|
|
||||||
// 报告详情内容
|
// 报告详情内容
|
||||||
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
||||||
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
|
TestResult newResult = createTestResult(result.getTestId(), scenarioResult);
|
||||||
|
|
|
@ -118,7 +118,8 @@ export default {
|
||||||
triggerFilters: [
|
triggerFilters: [
|
||||||
{text: this.$t('commons.trigger_mode.manual'), value: 'MANUAL'},
|
{text: this.$t('commons.trigger_mode.manual'), value: 'MANUAL'},
|
||||||
{text: this.$t('commons.trigger_mode.schedule'), value: 'SCHEDULE'},
|
{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: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue