feat(测试跟踪): 测试计划关联功能用例页面支持执行状态和评审状态筛选
--story=1008184 --user=陈建星 测试计划优化 https://www.tapd.cn/55049933/s/1194750
This commit is contained in:
parent
b84c73212e
commit
81b44247c7
|
@ -67,5 +67,7 @@ public class TestCase implements Serializable {
|
|||
|
||||
private Boolean latest;
|
||||
|
||||
private String lastExecuteResult;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -2193,6 +2193,76 @@ public class TestCaseExample {
|
|||
addCriterion("latest not between", value1, value2, "latest");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultIsNull() {
|
||||
addCriterion("last_execute_result is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultIsNotNull() {
|
||||
addCriterion("last_execute_result is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultEqualTo(String value) {
|
||||
addCriterion("last_execute_result =", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultNotEqualTo(String value) {
|
||||
addCriterion("last_execute_result <>", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultGreaterThan(String value) {
|
||||
addCriterion("last_execute_result >", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("last_execute_result >=", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultLessThan(String value) {
|
||||
addCriterion("last_execute_result <", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultLessThanOrEqualTo(String value) {
|
||||
addCriterion("last_execute_result <=", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultLike(String value) {
|
||||
addCriterion("last_execute_result like", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultNotLike(String value) {
|
||||
addCriterion("last_execute_result not like", value, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultIn(List<String> values) {
|
||||
addCriterion("last_execute_result in", values, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultNotIn(List<String> values) {
|
||||
addCriterion("last_execute_result not in", values, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultBetween(String value1, String value2) {
|
||||
addCriterion("last_execute_result between", value1, value2, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLastExecuteResultNotBetween(String value1, String value2) {
|
||||
addCriterion("last_execute_result not between", value1, value2, "lastExecuteResult");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<result column="version_id" jdbcType="VARCHAR" property="versionId" />
|
||||
<result column="ref_id" jdbcType="VARCHAR" property="refId" />
|
||||
<result column="latest" jdbcType="BIT" property="latest" />
|
||||
<result column="last_execute_result" jdbcType="VARCHAR" property="lastExecuteResult" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||
<result column="prerequisite" jdbcType="LONGVARCHAR" property="prerequisite" />
|
||||
|
@ -104,7 +105,7 @@
|
|||
id, node_id, test_id, node_path, project_id, `name`, `type`, maintainer, priority,
|
||||
`method`, create_time, update_time, sort, num, other_test_name, review_status, tags,
|
||||
demand_id, demand_name, `status`, step_model, custom_num, create_user, original_status,
|
||||
delete_time, delete_user_id, `order`, case_public, version_id, ref_id, latest
|
||||
delete_time, delete_user_id, `order`, case_public, version_id, ref_id, latest, last_execute_result
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
prerequisite, remark, steps, step_description, expected_result, custom_fields
|
||||
|
@ -168,9 +169,9 @@
|
|||
custom_num, create_user, original_status,
|
||||
delete_time, delete_user_id, `order`,
|
||||
case_public, version_id, ref_id,
|
||||
latest, prerequisite, remark,
|
||||
steps, step_description, expected_result,
|
||||
custom_fields)
|
||||
latest, last_execute_result, prerequisite,
|
||||
remark, steps, step_description,
|
||||
expected_result, custom_fields)
|
||||
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR},
|
||||
#{nodePath,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR}, #{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR},
|
||||
|
@ -181,9 +182,9 @@
|
|||
#{customNum,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{originalStatus,jdbcType=VARCHAR},
|
||||
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT},
|
||||
#{casePublic,jdbcType=BIT}, #{versionId,jdbcType=VARCHAR}, #{refId,jdbcType=VARCHAR},
|
||||
#{latest,jdbcType=BIT}, #{prerequisite,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR},
|
||||
#{steps,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR}, #{expectedResult,jdbcType=LONGVARCHAR},
|
||||
#{customFields,jdbcType=LONGVARCHAR})
|
||||
#{latest,jdbcType=BIT}, #{lastExecuteResult,jdbcType=VARCHAR}, #{prerequisite,jdbcType=LONGVARCHAR},
|
||||
#{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR},
|
||||
#{expectedResult,jdbcType=LONGVARCHAR}, #{customFields,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||
insert into test_case
|
||||
|
@ -281,6 +282,9 @@
|
|||
<if test="latest != null">
|
||||
latest,
|
||||
</if>
|
||||
<if test="lastExecuteResult != null">
|
||||
last_execute_result,
|
||||
</if>
|
||||
<if test="prerequisite != null">
|
||||
prerequisite,
|
||||
</if>
|
||||
|
@ -394,6 +398,9 @@
|
|||
<if test="latest != null">
|
||||
#{latest,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="lastExecuteResult != null">
|
||||
#{lastExecuteResult,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="prerequisite != null">
|
||||
#{prerequisite,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -516,6 +523,9 @@
|
|||
<if test="record.latest != null">
|
||||
latest = #{record.latest,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.lastExecuteResult != null">
|
||||
last_execute_result = #{record.lastExecuteResult,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.prerequisite != null">
|
||||
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -572,6 +582,7 @@
|
|||
version_id = #{record.versionId,jdbcType=VARCHAR},
|
||||
ref_id = #{record.refId,jdbcType=VARCHAR},
|
||||
latest = #{record.latest,jdbcType=BIT},
|
||||
last_execute_result = #{record.lastExecuteResult,jdbcType=VARCHAR},
|
||||
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
|
||||
remark = #{record.remark,jdbcType=LONGVARCHAR},
|
||||
steps = #{record.steps,jdbcType=LONGVARCHAR},
|
||||
|
@ -614,7 +625,8 @@
|
|||
case_public = #{record.casePublic,jdbcType=BIT},
|
||||
version_id = #{record.versionId,jdbcType=VARCHAR},
|
||||
ref_id = #{record.refId,jdbcType=VARCHAR},
|
||||
latest = #{record.latest,jdbcType=BIT}
|
||||
latest = #{record.latest,jdbcType=BIT},
|
||||
last_execute_result = #{record.lastExecuteResult,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -712,6 +724,9 @@
|
|||
<if test="latest != null">
|
||||
latest = #{latest,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="lastExecuteResult != null">
|
||||
last_execute_result = #{lastExecuteResult,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="prerequisite != null">
|
||||
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -765,6 +780,7 @@
|
|||
version_id = #{versionId,jdbcType=VARCHAR},
|
||||
ref_id = #{refId,jdbcType=VARCHAR},
|
||||
latest = #{latest,jdbcType=BIT},
|
||||
last_execute_result = #{lastExecuteResult,jdbcType=VARCHAR},
|
||||
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
|
||||
remark = #{remark,jdbcType=LONGVARCHAR},
|
||||
steps = #{steps,jdbcType=LONGVARCHAR},
|
||||
|
@ -804,7 +820,8 @@
|
|||
case_public = #{casePublic,jdbcType=BIT},
|
||||
version_id = #{versionId,jdbcType=VARCHAR},
|
||||
ref_id = #{refId,jdbcType=VARCHAR},
|
||||
latest = #{latest,jdbcType=BIT}
|
||||
latest = #{latest,jdbcType=BIT},
|
||||
last_execute_result = #{lastExecuteResult,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -22,7 +22,7 @@
|
|||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="condition">
|
||||
<sql id="condition">
|
||||
<choose>
|
||||
<when test='${object}.operator == "like"'>
|
||||
like CONCAT('%', #{${object}.value},'%')
|
||||
|
@ -66,4 +66,15 @@
|
|||
</choose>
|
||||
</sql>
|
||||
|
||||
<sql id="filterInWrapper">
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</sql>
|
||||
|
||||
<sql id="idsInWrapper">
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
|
@ -145,8 +145,6 @@ public interface ExtTestCaseMapper {
|
|||
|
||||
String getLastExecStatusById(String id);
|
||||
|
||||
List<TestCaseDTO> getLastExecStatusByIdList(@Param("ids") List<String> idList);
|
||||
|
||||
int countByWorkSpaceId(String workSpaceId);
|
||||
|
||||
long trashCount(@Param("projectId") String projectId);
|
||||
|
|
|
@ -188,6 +188,7 @@
|
|||
<select id="getTestCaseByNotInPlan" resultType="io.metersphere.track.dto.TestCaseDTO">
|
||||
select test_case.id, test_case.name, test_case.priority, test_case.type, test_case.review_status,
|
||||
test_case.num, test_case.custom_num, test_case.priority, test_case.tags, test_case.create_time,
|
||||
test_case.last_execute_result,
|
||||
test_case.update_time,
|
||||
project_version.name versionName, test_case.version_id versionId
|
||||
from test_case
|
||||
|
@ -236,6 +237,7 @@
|
|||
test_case.delete_user_id ,test_case.delete_time,
|
||||
project_version.name as versionName,
|
||||
project_version.id as versionId,
|
||||
test_case.last_execute_result,
|
||||
<if test="request.selectFields != null and request.selectFields.size() > 0">
|
||||
<foreach collection="request.selectFields" item="field" separator=",">
|
||||
${field}
|
||||
|
@ -260,6 +262,7 @@
|
|||
select
|
||||
project_version.name as versionName,
|
||||
project_version.id as versionId,
|
||||
test_case.last_execute_result,
|
||||
<if test="request.selectFields != null and request.selectFields.size() > 0">
|
||||
<foreach collection="request.selectFields" item="field" separator=",">
|
||||
${field}
|
||||
|
@ -543,47 +546,37 @@
|
|||
<choose>
|
||||
<when test="key=='priority'">
|
||||
and test_case.priority in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='type'">
|
||||
and test_case.type in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='review_status'">
|
||||
and test_case.review_status in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='last_execute_result'">
|
||||
and test_case.last_execute_result in
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='status'">
|
||||
and test_case.status in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='method'">
|
||||
and test_case.method in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key=='version_id'">
|
||||
and test_case.version_id in
|
||||
<foreach collection="values" open="(" close=")" separator="," item="value">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key.startsWith('custom')">
|
||||
and test_case.id in (
|
||||
select resource_id from custom_field_test_case where concat('custom',field_id) = #{key}
|
||||
and trim(both '"' from value) in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
)
|
||||
</when>
|
||||
</choose>
|
||||
|
@ -1021,16 +1014,6 @@
|
|||
WHERE case_id = #{0}
|
||||
ORDER BY update_time DESC limit 1;
|
||||
</select>
|
||||
|
||||
<select id="getLastExecStatusByIdList" resultType="io.metersphere.track.dto.TestCaseDTO">
|
||||
SELECT `status`, case_id as id
|
||||
FROM test_plan_test_case
|
||||
WHERE case_id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="countByWorkSpaceId" resultType="java.lang.Integer">
|
||||
select count(distinct ref_id)
|
||||
from test_case
|
||||
|
|
|
@ -119,27 +119,19 @@
|
|||
<choose>
|
||||
<when test="key == 'priority'">
|
||||
and c.priority in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key == 'user_id'">
|
||||
and c.create_user_id in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="key == 'priority'">
|
||||
and a.priority in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key == 'version_id'">
|
||||
and a.version_id in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
<when test="key == 'exec_result'">
|
||||
and t.status in
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
|
|
|
@ -74,4 +74,6 @@ public interface ExtTestPlanTestCaseMapper {
|
|||
List<CountMapDTO> getExecResultMapByPlanId(@Param("planId") String planId);
|
||||
|
||||
String selectCaseId(String id);
|
||||
|
||||
List<String> getCaseIdsByIds(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
|
|
@ -477,7 +477,6 @@
|
|||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
<include refid="queryWhereCondition"/>
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
||||
</select>
|
||||
<select id="selectForPlanReport" resultType="io.metersphere.track.dto.PlanReportCaseDTO">
|
||||
select tptc.id, tptc.status
|
||||
|
@ -584,6 +583,13 @@
|
|||
where tptc.plan_id = #{planId}
|
||||
</select>
|
||||
|
||||
<select id="getCaseIdsByIds" resultType="java.lang.String">
|
||||
select case_id
|
||||
from test_plan_test_case
|
||||
where id in
|
||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.idsInWrapper"/>
|
||||
</select>
|
||||
|
||||
<sql id="queryVersionCondition">
|
||||
<if test="request.versionId != null">
|
||||
and ${versionTable}.version_id = #{request.versionId}
|
||||
|
|
|
@ -784,19 +784,7 @@ public class TestCaseService {
|
|||
testCaseIdList.add(item.getId());
|
||||
});
|
||||
|
||||
List<TestCaseDTO> testCaseDTOList = extTestCaseMapper.getLastExecStatusByIdList(testCaseIdList);
|
||||
Map<String, String> testCaseStatusMap = new HashMap<>();
|
||||
testCaseDTOList.forEach(item -> {
|
||||
testCaseStatusMap.put(item.getId(), item.getStatus());
|
||||
});
|
||||
|
||||
for (TestCaseDTO data : returnList) {
|
||||
String lastStatus = testCaseStatusMap.get(data.getId());
|
||||
if (StringUtils.isNotEmpty(lastStatus)) {
|
||||
data.setLastExecuteResult(lastStatus);
|
||||
} else {
|
||||
data.setLastExecuteResult(null);
|
||||
}
|
||||
String dataStatus = excelData.parseStatus(data.getStatus());
|
||||
if (StringUtils.equalsAnyIgnoreCase(data.getStatus(), "Trash")) {
|
||||
try {
|
||||
|
@ -2649,6 +2637,38 @@ public class TestCaseService {
|
|||
testCaseMapper::updateByPrimaryKeySelective);
|
||||
}
|
||||
|
||||
public void updateLastExecuteStatus(List<String> ids, String status) {
|
||||
if (CollectionUtils.isNotEmpty(ids) && StringUtils.isNotBlank(status)) {
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
|
||||
testCase.setLastExecuteResult(status);
|
||||
testCaseMapper.updateByExampleSelective(testCase, example);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateLastExecuteStatus(String id, String status) {
|
||||
if (StringUtils.isNotBlank(id) && StringUtils.isNotBlank(status)) {
|
||||
this.updateLastExecuteStatus(Arrays.asList(id), status);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateReviewStatus(List<String> ids, String status) {
|
||||
if (CollectionUtils.isNotEmpty(ids) && StringUtils.isNotBlank(status)) {
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
|
||||
testCase.setReviewStatus(status);
|
||||
testCaseMapper.updateByExampleSelective(testCase, example);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateReviewStatus(String id, String status) {
|
||||
if (StringUtils.isNotBlank(id) && StringUtils.isNotBlank(status)) {
|
||||
this.updateReviewStatus(Arrays.asList(id), status);
|
||||
}
|
||||
}
|
||||
|
||||
public Pager<List<TestCaseDTO>> getRelationshipRelateList(QueryTestCaseRequest request, int goPage, int pageSize) {
|
||||
setDefaultOrder(request);
|
||||
List<String> relationshipIds = relationshipEdgeService.getRelationshipIds(request.getId());
|
||||
|
|
|
@ -155,6 +155,7 @@ public class TestPlanTestCaseService {
|
|||
testPlanTestCase.setUpdateTime(System.currentTimeMillis());
|
||||
testPlanTestCase.setRemark(null);
|
||||
testPlanTestCaseMapper.updateByPrimaryKeySelective(testPlanTestCase);
|
||||
testCaseService.updateLastExecuteStatus(testPlanTestCase.getCaseId(), testPlanTestCase.getStatus());
|
||||
}
|
||||
|
||||
public int deleteTestCase(String id) {
|
||||
|
@ -187,6 +188,11 @@ public class TestPlanTestCaseService {
|
|||
testPlanTestCaseMapper.updateByExampleSelective(
|
||||
testPlanTestCase,
|
||||
testPlanTestCaseExample);
|
||||
|
||||
if (StringUtils.isNotBlank(request.getStatus())) {
|
||||
List<String> caseIds = extTestPlanTestCaseMapper.getCaseIdsByIds(request.getIds());
|
||||
testCaseService.updateLastExecuteStatus(caseIds, request.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
public TestPlanTestCaseExample getBatchExample(TestPlanCaseBatchRequest request) {
|
||||
|
@ -341,6 +347,8 @@ public class TestPlanTestCaseService {
|
|||
item.setStatus(status);
|
||||
testPlanTestCaseMapper.updateByPrimaryKeySelective(item);
|
||||
|
||||
testCaseService.updateLastExecuteStatus(testPlanTestCase.getCaseId(), testPlanTestCase.getStatus());
|
||||
|
||||
SaveCommentRequest saveCommentRequest = new SaveCommentRequest();
|
||||
saveCommentRequest.setCaseId(testPlanTestCase.getCaseId());
|
||||
saveCommentRequest.setId(UUID.randomUUID().toString());
|
||||
|
@ -377,6 +385,7 @@ public class TestPlanTestCaseService {
|
|||
testPlanTestCases.forEach(item -> {
|
||||
item.setUpdateTime(System.currentTimeMillis());
|
||||
testPlanTestCaseMapper.updateByPrimaryKeySelective(item);
|
||||
testCaseService.updateLastExecuteStatus(item.getCaseId(), item.getStatus());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,6 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class TestReviewTestCaseService {
|
||||
@Resource
|
||||
private TestCaseTestMapper testCaseTestMapper;
|
||||
@Resource
|
||||
private LoadTestMapper loadTestMapper;
|
||||
@Resource
|
||||
|
@ -58,6 +56,8 @@ public class TestReviewTestCaseService {
|
|||
@Resource
|
||||
TestCaseMapper testCaseMapper;
|
||||
@Resource
|
||||
TestCaseService testCaseService;
|
||||
@Resource
|
||||
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
|
||||
|
||||
public List<TestReviewCaseDTO> list(QueryCaseReviewRequest request) {
|
||||
|
@ -159,11 +159,7 @@ public class TestReviewTestCaseService {
|
|||
testCaseReviewTestCaseMapper.updateByPrimaryKeySelective(testCaseReviewTestCase);
|
||||
|
||||
// 修改用例评审状态
|
||||
String caseId = testCaseReviewTestCase.getCaseId();
|
||||
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
|
||||
testCase.setId(caseId);
|
||||
testCase.setReviewStatus(testCaseReviewTestCase.getStatus());
|
||||
testCaseMapper.updateByPrimaryKeySelective(testCase);
|
||||
testCaseService.updateReviewStatus(testCaseReviewTestCase.getCaseId(), testCaseReviewTestCase.getStatus());
|
||||
}
|
||||
|
||||
public TestReviewCaseDTO get(String reviewId) {
|
||||
|
@ -223,11 +219,8 @@ public class TestReviewTestCaseService {
|
|||
|
||||
// 更新状态{TestCase, TestCaseReviewTestCase}
|
||||
if (StringUtils.isNotBlank(request.getStatus())) {
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
|
||||
testCase.setReviewStatus(request.getStatus());
|
||||
testCaseMapper.updateByExampleSelective(testCase, example);
|
||||
testCaseService.updateReviewStatus(ids, request.getStatus());
|
||||
|
||||
TestCaseReviewTestCaseExample caseReviewTestCaseExample = new TestCaseReviewTestCaseExample();
|
||||
caseReviewTestCaseExample.createCriteria().andReviewIdEqualTo(request.getReviewId()).andCaseIdIn(ids);
|
||||
TestCaseReviewTestCase testCaseReviewTestCase = new TestCaseReviewTestCase();
|
||||
|
@ -250,17 +243,11 @@ public class TestReviewTestCaseService {
|
|||
public void editTestCaseForMinder(String reviewId, List<TestCaseReviewTestCase> testCaseReviewTestCases) {
|
||||
checkReviewCase(reviewId);
|
||||
if (!CollectionUtils.isEmpty(testCaseReviewTestCases)) {
|
||||
List<TestCaseWithBLOBs> testCaseList = new ArrayList<>();
|
||||
testCaseReviewTestCases.forEach((item) -> {
|
||||
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
|
||||
testCase.setId(item.getCaseId());
|
||||
testCase.setReviewStatus(item.getStatus());
|
||||
testCaseList.add(testCase);
|
||||
testCase.setUpdateTime(System.currentTimeMillis());
|
||||
item.setUpdateTime(System.currentTimeMillis());
|
||||
testCaseReviewTestCaseMapper.updateByPrimaryKeySelective(item);
|
||||
testCaseService.updateReviewStatus(item.getCaseId(), item.getStatus());
|
||||
});
|
||||
testCaseList.forEach(testCaseMapper::updateByPrimaryKeySelective);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,19 +49,6 @@
|
|||
min-width="120"/>
|
||||
|
||||
<span v-for="(item, index) in fields" :key="index">
|
||||
<ms-table-column
|
||||
v-if="item.id === 'lastExecResult'"
|
||||
prop="lastExecuteResult"
|
||||
min-width="100px"
|
||||
:label="$t('test_track.plan_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<span @click.stop="clickt = 'stop'">
|
||||
<span class="el-dropdown-link">
|
||||
<status-table-item :value="scope.row.lastExecuteResult ? scope.row.lastExecuteResult : 'Prepare'"/>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
prop="projectName"
|
||||
|
@ -110,18 +97,14 @@
|
|||
:label="$t('commons.create_user')"
|
||||
min-width="120"/>
|
||||
|
||||
<ms-table-column
|
||||
prop="reviewStatus"
|
||||
min-width="120px"
|
||||
<test-case-review-status-table-item
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
:label="$t('test_track.case.status')">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<review-status :value="scope.row.reviewStatus"/>
|
||||
</span>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
:fields-width="fieldsWidth"/>
|
||||
|
||||
<test-plan-case-status-table-item
|
||||
prop="lastExecuteResult"
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"/>
|
||||
|
||||
<ms-table-column
|
||||
prop="tags"
|
||||
|
@ -287,6 +270,8 @@ import ListItemDeleteConfirm from "@/business/components/common/components/ListI
|
|||
import {getAdvSearchCustomField} from "@/business/components/common/components/search/custom-component";
|
||||
import MsSearch from "@/business/components/common/components/search/MsSearch";
|
||||
import RelateDemand from "@/business/components/track/case/components/RelateDemand";
|
||||
import TestCaseReviewStatusTableItem from "@/business/components/track/common/tableItems/TestCaseReviewStatusTableItem";
|
||||
import TestPlanCaseStatusTableItem from "@/business/components/track/common/tableItems/TestPlanCaseStatusTableItem";
|
||||
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {};
|
||||
|
@ -294,6 +279,8 @@ const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComp
|
|||
export default {
|
||||
name: "TestCaseList",
|
||||
components: {
|
||||
TestPlanCaseStatusTableItem,
|
||||
TestCaseReviewStatusTableItem,
|
||||
RelateDemand,
|
||||
MsSearch,
|
||||
ListItemDeleteConfirm,
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
<template>
|
||||
<ms-table-column
|
||||
:prop="prop"
|
||||
:field="field"
|
||||
:filters="reviewStatusFilters"
|
||||
:min-width="minWidth"
|
||||
:fields-width="fieldsWidth"
|
||||
:label="$t('test_track.case.status')">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<review-status :value="scope.row[prop]"/>
|
||||
</span>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
|
||||
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
|
||||
export default {
|
||||
name: "TestCaseReviewStatusTableItem",
|
||||
components: {ReviewStatus, MsTableColumn},
|
||||
props: {
|
||||
minWidth: {
|
||||
type: [String, Number],
|
||||
default: '120px'
|
||||
},
|
||||
fieldsWidth: Object,
|
||||
prop: {
|
||||
type: String,
|
||||
default: 'reviewStatus'
|
||||
},
|
||||
field: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reviewStatusFilters: [
|
||||
{text: this.$t('test_track.review.prepare'), value: 'Prepare'},
|
||||
{text: this.$t('test_track.review.pass'), value: 'Pass'},
|
||||
{text: this.$t('test_track.review.un_pass'), value: 'UnPass'},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,54 @@
|
|||
<template>
|
||||
<ms-table-column
|
||||
:prop="prop"
|
||||
:filters="statusFilters"
|
||||
:field="field"
|
||||
:min-width="minWidth"
|
||||
:fields-width="fieldsWidth"
|
||||
:label="$t('test_track.plan_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<status-table-item :value="scope.row[prop] ? scope.row[prop] : 'Prepare'"/>
|
||||
</span>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
|
||||
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
|
||||
export default {
|
||||
name: "TestPlanCaseStatusTableItem",
|
||||
components: {StatusTableItem, MsTableColumn},
|
||||
props: {
|
||||
minWidth: {
|
||||
type: [String, Number],
|
||||
default: '120px'
|
||||
},
|
||||
fieldsWidth: Object,
|
||||
prop: {
|
||||
type: String,
|
||||
default: 'status'
|
||||
},
|
||||
field: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusFilters: [
|
||||
{text: this.$t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
|
||||
{text: this.$t('test_track.plan_view.pass'), value: 'Pass'},
|
||||
{text: this.$t('test_track.plan_view.failure'), value: 'Failure'},
|
||||
{text: this.$t('test_track.plan_view.blocking'), value: 'Blocking'},
|
||||
{text: this.$t('test_track.plan_view.skip'), value: 'Skip'}
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -125,6 +125,7 @@
|
|||
|
||||
<ms-table-column :field="item"
|
||||
prop="execResult"
|
||||
:filters="execResultFilters"
|
||||
:fields-width="fieldsWidth"
|
||||
:label="$t('test_track.plan.execute_result')" min-width="150" align="center">
|
||||
<template v-slot:default="scope">
|
||||
|
@ -372,6 +373,16 @@ export default {
|
|||
},
|
||||
editTestPlanApiCaseOrder() {
|
||||
return editTestPlanApiCaseOrder;
|
||||
},
|
||||
execResultFilters() {
|
||||
let execResultFilters = [];
|
||||
for (let key of RESULT_MAP.keys()) {
|
||||
execResultFilters.push({
|
||||
text: RESULT_MAP.get(key),
|
||||
value: key
|
||||
});
|
||||
}
|
||||
return execResultFilters;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -74,6 +74,10 @@
|
|||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
<test-plan-case-status-table-item prop="lastExecuteResult"/>
|
||||
|
||||
<test-case-review-status-table-item/>
|
||||
|
||||
<ms-table-column prop="tags" :label="$t('commons.tag')" width="90px">
|
||||
<template v-slot:default="scope">
|
||||
<ms-tag v-for="(itemName, index) in scope.row.tags" :key="index" type="success" effect="plain"
|
||||
|
@ -109,6 +113,10 @@ import MsTag from "@/business/components/common/components/MsTag";
|
|||
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
|
||||
import MsUpdateTimeColumn from "@/business/components/common/components/table/MsUpdateTimeColumn";
|
||||
import {getVersionFilters} from "@/network/project";
|
||||
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
|
||||
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
|
||||
import TestCaseReviewStatusTableItem from "@/business/components/track/common/tableItems/TestCaseReviewStatusTableItem";
|
||||
import TestPlanCaseStatusTableItem from "@/business/components/track/common/tableItems/TestPlanCaseStatusTableItem";
|
||||
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {};
|
||||
|
@ -116,6 +124,10 @@ const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./v
|
|||
export default {
|
||||
name: "FunctionalRelevance",
|
||||
components: {
|
||||
TestPlanCaseStatusTableItem,
|
||||
TestCaseReviewStatusTableItem,
|
||||
ReviewStatus,
|
||||
StatusTableItem,
|
||||
MsUpdateTimeColumn,
|
||||
MsCreateTimeColumn,
|
||||
MsTag,
|
||||
|
|
|
@ -310,6 +310,7 @@ export default {
|
|||
saveCase(next, noTip) {
|
||||
let param = {};
|
||||
param.id = this.testCase.id;
|
||||
param.caseId = this.testCase.caseId;
|
||||
param.status = this.testCase.status;
|
||||
param.results = [];
|
||||
param.remark = this.testCase.remark;
|
||||
|
|
|
@ -183,18 +183,18 @@
|
|||
<status-table-item :value="scope.row.status"/>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" chang>
|
||||
<el-dropdown-item :disabled="!hasEditPermission" :command="{id: scope.row.id, status: 'Pass'}">
|
||||
<el-dropdown-item :disabled="!hasEditPermission" :command="{id: scope.row.id, caseId: scope.row.caseId, status: 'Pass'}">
|
||||
{{ $t('test_track.plan_view.pass') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="!hasEditPermission"
|
||||
:command="{id: scope.row.id, status: 'Failure'}">
|
||||
:command="{id: scope.row.id, caseId: scope.row.caseId, status: 'Failure'}">
|
||||
{{ $t('test_track.plan_view.failure') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="!hasEditPermission"
|
||||
:command="{id: scope.row.id, status: 'Blocking'}">
|
||||
:command="{id: scope.row.id, caseId: scope.row.caseId, status: 'Blocking'}">
|
||||
{{ $t('test_track.plan_view.blocking') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="!hasEditPermission" :command="{id: scope.row.id, status: 'Skip'}">
|
||||
<el-dropdown-item :disabled="!hasEditPermission" :command="{id: scope.row.id, caseId: scope.row.caseId, status: 'Skip'}">
|
||||
{{ $t('test_track.plan_view.skip') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -357,8 +357,7 @@ export default {
|
|||
{text: this.$t('test_track.plan_view.pass'), value: 'Pass'},
|
||||
{text: this.$t('test_track.plan_view.failure'), value: 'Failure'},
|
||||
{text: this.$t('test_track.plan_view.blocking'), value: 'Blocking'},
|
||||
{text: this.$t('test_track.plan_view.skip'), value: 'Skip'},
|
||||
{text: this.$t('test_track.plan.plan_status_running'), value: 'Underway'},
|
||||
{text: this.$t('test_track.plan_view.skip'), value: 'Skip'}
|
||||
],
|
||||
executorFilters: [],
|
||||
maintainerFilters: [],
|
||||
|
|
|
@ -108,19 +108,9 @@
|
|||
:label="$t('test_track.review.reviewer')"
|
||||
min-width="120px"/>
|
||||
|
||||
<ms-table-column
|
||||
prop="reviewStatus"
|
||||
<test-case-review-status-table-item
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
:filters="statusFilters"
|
||||
min-width="120px"
|
||||
:label="$t('test_track.review_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<review-status :value="scope.row.reviewStatus"/>
|
||||
</span>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
:fields-width="fieldsWidth"/>
|
||||
|
||||
<ms-table-column
|
||||
sortable
|
||||
|
@ -200,10 +190,12 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
|
|||
import MsTable from "@/business/components/common/components/table/MsTable";
|
||||
import {editTestReviewTestCaseOrder, getTestReviewTestCase} from "@/network/testCase";
|
||||
import {getCurrentProjectID, hasLicense} from "@/common/js/utils";
|
||||
import TestCaseReviewStatusTableItem from "@/business/components/track/common/tableItems/TestCaseReviewStatusTableItem";
|
||||
|
||||
export default {
|
||||
name: "TestReviewTestCaseList",
|
||||
components: {
|
||||
TestCaseReviewStatusTableItem,
|
||||
HeaderLabelOperate,
|
||||
HeaderCustom,
|
||||
MsTableOperatorButton, MsTableOperator, MethodTableItem, TypeTableItem,
|
||||
|
@ -252,11 +244,6 @@ export default {
|
|||
{text: this.$t('commons.performance'), value: 'performance'},
|
||||
{text: this.$t('commons.api'), value: 'api'}
|
||||
],
|
||||
statusFilters: [
|
||||
{text: this.$t('test_track.review.prepare'), value: 'Prepare'},
|
||||
{text: this.$t('test_track.review.pass'), value: 'Pass'},
|
||||
{text: this.$t('test_track.review.un_pass'), value: 'UnPass'},
|
||||
],
|
||||
showMore: false,
|
||||
buttons: [
|
||||
{
|
||||
|
|
|
@ -213,7 +213,7 @@ export let CUSTOM_TABLE_HEADER = {
|
|||
{id: 'createName', key: '7', label: 'commons.create_user'},
|
||||
{id: 'createTime', key: '8', label: 'commons.create_time'},
|
||||
{id: 'desc', key: '9', label: 'test_track.case.case_desc'},
|
||||
{id: 'lastExecResult', key: '0', label: 'test_track.plan_view.execute_result'},
|
||||
{id: 'lastExecuteResult', key: '0', label: 'test_track.plan_view.execute_result'},
|
||||
],
|
||||
// 公共用例库
|
||||
TRACK_PUBLIC_TEST_CASE: [
|
||||
|
@ -227,7 +227,7 @@ export let CUSTOM_TABLE_HEADER = {
|
|||
{id: 'createName', key: '7', label: 'commons.create_user'},
|
||||
{id: 'createTime', key: '8', label: 'commons.create_time'},
|
||||
{id: 'desc', key: '9', label: 'test_track.case.case_desc'},
|
||||
{id: 'lastExecResult', key: '0', label: 'test_track.plan_view.execute_result'},
|
||||
{id: 'lastExecuteResult', key: '0', label: 'test_track.plan_view.execute_result'},
|
||||
],
|
||||
// 测试报告
|
||||
TRACK_REPORT_TABLE: [
|
||||
|
|
Loading…
Reference in New Issue