From 0345f60630464f01dd52149f1debe3a85860dc78 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Sat, 6 May 2023 13:44:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C=E6=8E=A5=E5=8F=A3Case?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=A1=E6=81=AF=E8=BF=87=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025827 --user=宋昌昌 【接口测试】批量执行接口用例-较多用例未配置环境时-提示信息无法滚动查看-未展示关闭按钮 https://www.tapd.cn/55049933/s/1369241 --- .../io/metersphere/api/exec/api/ApiCaseExecuteService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/api/ApiCaseExecuteService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/api/ApiCaseExecuteService.java index bdac98a174..5afda8e973 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/api/ApiCaseExecuteService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/api/ApiCaseExecuteService.java @@ -176,6 +176,11 @@ public class ApiCaseExecuteService { } } if (StringUtils.isNotEmpty(message)) { + // message过长时截取部分展示 + String[] splitErr = message.toString().split(";"); + if (splitErr.length > 20) { + MSException.throwException("用例:" + String.join(";", Arrays.copyOf(splitErr, 20)) + "....;运行环境为空!"); + } MSException.throwException("用例:" + message + "运行环境为空!"); } return projectEnvMap;