diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 8f7f5d2b4d..71d9cf7eec 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -1101,6 +1101,9 @@ public class ApiDefinitionService { ApiDefinitionImport apiImport = null; try { apiImport = (ApiDefinitionImport) Objects.requireNonNull(runService).parse(file == null ? null : file.getInputStream(), request); + if(apiImport.getMocks() == null){ + apiImport.setMocks(new ArrayList<>()); + } } catch (Exception e) { LogUtil.error(e.getMessage(), e); String returnThrowException = e.getMessage(); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index 306fa6c050..1877a326ce 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -351,7 +351,12 @@ public class ApiScenarioReportService { scenario = apiScenarioMapper.selectByPrimaryKey(report.getScenarioId()); } if (scenario != null) { - scenario.setLastResult(errorSize > 0 ? "Fail" : ScenarioStatus.Success.name()); + if(StringUtils.equalsAnyIgnoreCase(status,ExecuteResult.errorReportResult.name())){ + scenario.setLastResult(status); + }else { + scenario.setLastResult(errorSize > 0 ? "Fail" : ScenarioStatus.Success.name()); + } + long successSize = requestResults.stream().filter(requestResult -> StringUtils.equalsIgnoreCase(requestResult.getStatus(), ScenarioStatus.Success.name())).count(); scenario.setPassRate(new DecimalFormat("0%").format((float) successSize / requestResults.size())); scenario.setReportId(dto.getReportId()); diff --git a/frontend/src/business/components/api/automation/report/ApiReportStatus.vue b/frontend/src/business/components/api/automation/report/ApiReportStatus.vue index ac809623b6..c783847a4f 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportStatus.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportStatus.vue @@ -15,7 +15,7 @@ {{ row.status }} - + {{ $t('error_report_library.option.name') }} diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index b0af8b82fe..d9cbba7804 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -218,6 +218,9 @@ {{ $t('api_test.automation.fail') }} + + {{ $t('error_report_library.option.name') }} + diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue index 8a5383da55..d1e499de69 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue @@ -156,6 +156,9 @@ {{ $t('api_test.automation.fail') }} + + {{ $t('api_test.automation.fail') }} + {{ $t('error_report_library.option.name') }}