diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 19c1b0376d..8599652296 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -24,7 +24,6 @@ import io.metersphere.base.mapper.ext.ExtTestPlanScenarioCaseMapper; import io.metersphere.commons.constants.*; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.DateUtils; -import io.metersphere.commons.utils.LogUtil; import io.metersphere.commons.utils.ServiceUtils; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.i18n.Translator; @@ -310,6 +309,10 @@ public class ApiAutomationService { try { boolean isFirst = true; for (ApiScenarioWithBLOBs item : apiScenarios) { + if (item.getStepTotal() == 0) { + MSException.throwException(item.getName() + "," + Translator.get("automation_exec_info")); + break; + } MsThreadGroup group = new MsThreadGroup(); group.setLabel(item.getName()); group.setName(UUID.randomUUID().toString()); @@ -347,7 +350,7 @@ public class ApiAutomationService { } } catch (Exception ex) { - LogUtil.error(ex.getMessage()); + MSException.throwException(ex.getMessage()); } testPlan.toHashTree(jmeterHashTree, testPlan.getHashTree(), new ParameterConfig()); diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index ae2aa26f23..51f39e1c43 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -177,6 +177,6 @@ task_notification=Result notification message_task_already_exists=Task recipient already exists #automation automation_name_already_exists=the scenario already exists in the project and the module - +automation_exec_info=There are no test steps to execute diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 983fac6be2..82313e0b5b 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -177,4 +177,5 @@ task_notification_jenkins=jenkins任务通知 task_notification=任务通知 message_task_already_exists=任务接收人已经存在 #automation -automation_name_already_exists=同一个项目和模块下,场景名称不能重复 \ No newline at end of file +automation_name_already_exists=同一个项目和模块下,场景名称不能重复 +automation_exec_info=没有测试步骤,无法执行 \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 97a457beb3..f3ddb7decc 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -179,3 +179,4 @@ api_definition_url_not_repeating=接口請求地址已經存在 message_task_already_exists=任務接收人已經存在 #automation automation_name_already_exists=同一個項目和模塊下,場景名稱不能重複 +automation_exec_info=沒有測試步驟,無法執行 \ No newline at end of file