fix(接口测试): 修复foreach循环控制器不生效的缺陷
--bug=1038410 --user=王孝刚 【接口测试】场景-循环控制器-forEach循环设置不生效 https://www.tapd.cn/55049933/s/1487037
This commit is contained in:
parent
1d8793f09b
commit
7c0cab89af
|
@ -308,7 +308,7 @@ test_case_status_prepare=未开始
|
||||||
test_case_status_again=重新提审
|
test_case_status_again=重新提审
|
||||||
test_case_status_running=进行中
|
test_case_status_running=进行中
|
||||||
test_case_status_finished=已完成
|
test_case_status_finished=已完成
|
||||||
connection_expired=连接已失效,请重新获取
|
connection_expired=链接已失效,请重新获取
|
||||||
# track home
|
# track home
|
||||||
api_case=接口用例
|
api_case=接口用例
|
||||||
performance_case=性能用例
|
performance_case=性能用例
|
||||||
|
|
|
@ -309,7 +309,7 @@ test_case_status_prepare=未开始
|
||||||
test_case_status_again=重新提审
|
test_case_status_again=重新提审
|
||||||
test_case_status_running=进行中
|
test_case_status_running=进行中
|
||||||
test_case_status_finished=已完成
|
test_case_status_finished=已完成
|
||||||
connection_expired=连接已失效,请重新获取
|
connection_expired=链接已失效,请重新获取
|
||||||
# track home
|
# track home
|
||||||
api_case=接口用例
|
api_case=接口用例
|
||||||
performance_case=性能用例
|
performance_case=性能用例
|
||||||
|
|
|
@ -308,7 +308,7 @@ test_case_status_prepare=未開始
|
||||||
test_case_status_again=重新提審
|
test_case_status_again=重新提審
|
||||||
test_case_status_running=進行中
|
test_case_status_running=進行中
|
||||||
test_case_status_finished=已完成
|
test_case_status_finished=已完成
|
||||||
connection_expired=連接已失效,請重新獲取
|
connection_expired=链接已失效,請重新獲取
|
||||||
# track home
|
# track home
|
||||||
api_case=接口用例
|
api_case=接口用例
|
||||||
performance_case=性能用例
|
performance_case=性能用例
|
||||||
|
|
|
@ -174,8 +174,8 @@ public class MsLoopControllerConverter extends AbstractJmeterElementConverter<Ms
|
||||||
controller.setName(StringUtils.isNotBlank(element.getName()) ? element.getName() : "Foreach Controller");
|
controller.setName(StringUtils.isNotBlank(element.getName()) ? element.getName() : "Foreach Controller");
|
||||||
controller.setProperty(TestElement.TEST_CLASS, ForeachController.class.getName());
|
controller.setProperty(TestElement.TEST_CLASS, ForeachController.class.getName());
|
||||||
controller.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ForeachControlPanel"));
|
controller.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ForeachControlPanel"));
|
||||||
controller.setInputVal(element.getForEachController().getVariable());
|
controller.setInputVal(element.getForEachController().getValue());
|
||||||
controller.setReturnVal(element.getForEachController().getValue());
|
controller.setReturnVal(element.getForEachController().getVariable());
|
||||||
controller.setUseSeparator(true);
|
controller.setUseSeparator(true);
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import io.metersphere.api.dto.report.ApiReportListDTO;
|
||||||
import io.metersphere.api.mapper.*;
|
import io.metersphere.api.mapper.*;
|
||||||
import io.metersphere.api.utils.ApiDataUtils;
|
import io.metersphere.api.utils.ApiDataUtils;
|
||||||
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
||||||
|
import io.metersphere.sdk.constants.ApiReportStatus;
|
||||||
import io.metersphere.sdk.domain.Environment;
|
import io.metersphere.sdk.domain.Environment;
|
||||||
import io.metersphere.sdk.domain.EnvironmentGroup;
|
import io.metersphere.sdk.domain.EnvironmentGroup;
|
||||||
import io.metersphere.sdk.dto.api.result.RequestResult;
|
import io.metersphere.sdk.dto.api.result.RequestResult;
|
||||||
|
@ -213,6 +214,8 @@ public class ApiReportService {
|
||||||
}
|
}
|
||||||
apiReportSteps.sort(Comparator.comparingLong(ApiReportStepDTO::getSort));
|
apiReportSteps.sort(Comparator.comparingLong(ApiReportStepDTO::getSort));
|
||||||
apiReportDTO.setChildren(apiReportSteps);
|
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;
|
return apiReportDTO;
|
||||||
}
|
}
|
||||||
ApiTestCaseRecordExample example = new ApiTestCaseRecordExample();
|
ApiTestCaseRecordExample example = new ApiTestCaseRecordExample();
|
||||||
|
|
|
@ -246,7 +246,7 @@ public class ApiScenarioReportService {
|
||||||
|
|
||||||
scenarioReportDTO.setStepErrorCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.ERROR.name(), step.getStatus())).count());
|
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.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());
|
scenarioReportDTO.setStepFakeErrorCount(steps.stream().filter(step -> StringUtils.equals(ApiReportStatus.FAKE_ERROR.name(), step.getStatus())).count());
|
||||||
//控制台信息 console
|
//控制台信息 console
|
||||||
ApiScenarioReportLogExample example = new ApiScenarioReportLogExample();
|
ApiScenarioReportLogExample example = new ApiScenarioReportLogExample();
|
||||||
|
|
Loading…
Reference in New Issue