fix(接口测试): 测试报告展示顺序
This commit is contained in:
parent
3225a76c43
commit
6bdb76d719
|
@ -99,7 +99,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
|||
|
||||
// 一个脚本里可能包含多个场景(ThreadGroup),所以要区分开,key: 场景Id
|
||||
final Map<String, ScenarioResult> scenarios = new LinkedHashMap<>();
|
||||
queue.forEach(result -> {
|
||||
queue.forEach(result -> {
|
||||
// 线程名称: <场景名> <场景Index>-<请求Index>, 例如:Scenario 2-1
|
||||
String scenarioName = StringUtils.substringBeforeLast(result.getThreadName(), THREAD_SPLIT);
|
||||
String index = StringUtils.substringAfterLast(result.getThreadName(), THREAD_SPLIT);
|
||||
|
@ -107,7 +107,12 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
|||
ScenarioResult scenarioResult;
|
||||
if (!scenarios.containsKey(scenarioId)) {
|
||||
scenarioResult = new ScenarioResult();
|
||||
scenarioResult.setId(scenarioId);
|
||||
try {
|
||||
scenarioResult.setId(Integer.parseInt(scenarioId));
|
||||
} catch (Exception e) {
|
||||
scenarioResult.setId(0);
|
||||
LogUtil.error("场景ID转换异常: " + e.getMessage());
|
||||
}
|
||||
scenarioResult.setName(scenarioName);
|
||||
scenarios.put(scenarioId, scenarioResult);
|
||||
} else {
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
@Data
|
||||
public class ScenarioResult {
|
||||
|
||||
private String id;
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
|
|
Loading…
Reference in New Issue