fix(接口测试): 修复foreach循环控制器不生效的缺陷

--bug=1038410 --user=王孝刚 【接口测试】场景-循环控制器-forEach循环设置不生效
https://www.tapd.cn/55049933/s/1487037
This commit is contained in:
wxg0103 2024-04-03 10:48:44 +08:00 committed by 刘瑞斌
parent 1d8793f09b
commit 7c0cab89af
6 changed files with 9 additions and 6 deletions

View File

@ -308,7 +308,7 @@ test_case_status_prepare=未开始
test_case_status_again=重新提审
test_case_status_running=进行中
test_case_status_finished=已完成
connection_expired=接已失效,请重新获取
connection_expired=接已失效,请重新获取
# track home
api_case=接口用例
performance_case=性能用例

View File

@ -309,7 +309,7 @@ test_case_status_prepare=未开始
test_case_status_again=重新提审
test_case_status_running=进行中
test_case_status_finished=已完成
connection_expired=接已失效,请重新获取
connection_expired=接已失效,请重新获取
# track home
api_case=接口用例
performance_case=性能用例

View File

@ -308,7 +308,7 @@ test_case_status_prepare=未開始
test_case_status_again=重新提審
test_case_status_running=進行中
test_case_status_finished=已完成
connection_expired=接已失效,請重新獲取
connection_expired=接已失效,請重新獲取
# track home
api_case=接口用例
performance_case=性能用例

View File

@ -174,8 +174,8 @@ public class MsLoopControllerConverter extends AbstractJmeterElementConverter<Ms
controller.setName(StringUtils.isNotBlank(element.getName()) ? element.getName() : "Foreach Controller");
controller.setProperty(TestElement.TEST_CLASS, ForeachController.class.getName());
controller.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ForeachControlPanel"));
controller.setInputVal(element.getForEachController().getVariable());
controller.setReturnVal(element.getForEachController().getValue());
controller.setInputVal(element.getForEachController().getValue());
controller.setReturnVal(element.getForEachController().getVariable());
controller.setUseSeparator(true);
return controller;
}

View File

@ -6,6 +6,7 @@ import io.metersphere.api.dto.report.ApiReportListDTO;
import io.metersphere.api.mapper.*;
import io.metersphere.api.utils.ApiDataUtils;
import io.metersphere.sdk.constants.ApiExecuteResourceType;
import io.metersphere.sdk.constants.ApiReportStatus;
import io.metersphere.sdk.domain.Environment;
import io.metersphere.sdk.domain.EnvironmentGroup;
import io.metersphere.sdk.dto.api.result.RequestResult;
@ -213,6 +214,8 @@ public class ApiReportService {
}
apiReportSteps.sort(Comparator.comparingLong(ApiReportStepDTO::getSort));
apiReportDTO.setChildren(apiReportSteps);
apiReportDTO.setTotal((long) apiReportSteps.size());
apiReportDTO.setPendingCount(apiReportSteps.stream().filter(step -> StringUtils.equals(ApiReportStatus.PENDING.name(), step.getStatus()) || StringUtils.isBlank(step.getStatus())).count());
return apiReportDTO;
}
ApiTestCaseRecordExample example = new ApiTestCaseRecordExample();

View File

@ -246,7 +246,7 @@ public class ApiScenarioReportService {
scenarioReportDTO.setStepErrorCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.ERROR.name(), step.getStatus())).count());
scenarioReportDTO.setStepSuccessCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.SUCCESS.name(), step.getStatus())).count());
scenarioReportDTO.setStepPendingCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.PENDING.name(), step.getStatus())).count());
scenarioReportDTO.setStepPendingCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.PENDING.name(), step.getStatus()) || StringUtils.isBlank(step.getStatus())).count());
scenarioReportDTO.setStepFakeErrorCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.FAKE_ERROR.name(), step.getStatus())).count());
//控制台信息 console
ApiScenarioReportLogExample example = new ApiScenarioReportLogExample();