fix(测试跟踪): 修复测试计划内场景表格批量执行时没按执行顺序执行的问题

--bug=1023310 --user=宋天阳 【接口测试】测试计划里串行执行场景,没有按顺序执行
https://www.tapd.cn/55049933/s/1337992
This commit is contained in:
song-tianyang 2023-02-20 11:32:58 +08:00 committed by 刘瑞斌
parent 75429f05f7
commit 0b01ed8db0
3 changed files with 10 additions and 6 deletions

View File

@ -195,7 +195,9 @@ public class ApiScenarioExecuteService {
// 测试计划执行数据查询
List<TestPlanApiScenarioInfoDTO> testPlanApiScenarioList;
if (CollectionUtils.isNotEmpty(request.getPlanScenarioIds())) {
testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectByPlanIds(request.getPlanScenarioIds());
testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectByPlanScenarioIds(request.getPlanScenarioIds(),
"\"" + StringUtils.join(request.getPlanScenarioIds(), ",") + "\"");
} else {
testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectLegalDataByTestPlanId(request.getTestPlanId());
}

View File

@ -22,19 +22,19 @@ public interface ExtTestPlanScenarioCaseMapper {
List<String> getNotRelevanceCaseIds(String planId, List<String> relevanceProjectIds);
List<String> selectIds(@Param("request")TestPlanScenarioRequest request);
List<String> selectIds(@Param("request") TestPlanScenarioRequest request);
List<TestPlanApiScenario> selectByIds(@Param("ids")String ids ,@Param("order")String order );
List<TestPlanApiScenario> selectByIds(@Param("ids") String ids, @Param("order") String order);
List<TestPlanApiScenarioInfoDTO> selectLegalDataByTestPlanId(String planId);
List<TestPlanApiScenarioInfoDTO> selectByPlanIds(List<String> planScenarioIds);
List<TestPlanApiScenarioInfoDTO> selectByPlanScenarioIds(@Param("planScenarioIds") List<String> planScenarioIds, @Param("order") String order);
List<PlanReportCaseDTO> selectForPlanReport(String planId);
List<TestPlanFailureScenarioDTO> getFailureList(@Param("planId") String planId, @Param("status") String status);
List<TestPlanFailureScenarioDTO> getFailureListByIds(@Param("ids") Collection<String> ids,@Param("status") String status);
List<TestPlanFailureScenarioDTO> getFailureListByIds(@Param("ids") Collection<String> ids, @Param("status") String status);
List<Integer> getUnderwaySteps(@Param("ids") List<String> underwayIds);
@ -49,5 +49,6 @@ public interface ExtTestPlanScenarioCaseMapper {
Long getLastOrder(@Param("planId") String planId, @Param("baseOrder") Long baseOrder);
List<String> selectNameByIdIn(List<String> ids);
String selectProjectId(String testPlanId);
}

View File

@ -402,7 +402,7 @@
)
</select>
<select id="selectByPlanIds" resultType="io.metersphere.api.dto.plan.TestPlanApiScenarioInfoDTO">
<select id="selectByPlanScenarioIds" resultType="io.metersphere.api.dto.plan.TestPlanApiScenarioInfoDTO">
SELECT tpas.id,
tpas.api_scenario_id,
tpas.environment,
@ -416,5 +416,6 @@
<foreach collection="planScenarioIds" item="id" separator="," open="(" close=")">
#{id}
</foreach>
ORDER BY FIND_IN_SET(tpas.id, ${order})
</select>
</mapper>