Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a1b7d214b0
|
@ -5,6 +5,7 @@ import io.metersphere.controller.request.ReportRequest;
|
||||||
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
||||||
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
|
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
|
||||||
import io.metersphere.dto.ReportDTO;
|
import io.metersphere.dto.ReportDTO;
|
||||||
|
import io.metersphere.dto.TestCaseDTO;
|
||||||
import io.metersphere.dto.TestPlanCaseDTO;
|
import io.metersphere.dto.TestPlanCaseDTO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -14,5 +15,5 @@ public interface ExtTestCaseMapper {
|
||||||
|
|
||||||
List<TestCase> getTestCaseNames(@Param("request") QueryTestCaseRequest request);
|
List<TestCase> getTestCaseNames(@Param("request") QueryTestCaseRequest request);
|
||||||
|
|
||||||
List<TestPlanCaseDTO> getTestPlanTestCases(@Param("request") QueryTestPlanCaseRequest request);
|
List<TestCaseDTO> list(@Param("request") QueryTestCaseRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,25 +20,37 @@
|
||||||
ORDER BY test_case.update_time DESC
|
ORDER BY test_case.update_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTestPlanTestCases" resultType="io.metersphere.dto.TestPlanCaseDTO">
|
<select id="list" resultType="io.metersphere.dto.TestCaseDTO">
|
||||||
select t1.id as id, t1.plan_id as planId, t1.executor as executor, t1.status as status, t1.results as results, t1.create_time as createTime, t1.update_time updateTime,
|
select test_case.* from test_case
|
||||||
t2.id as caseId, t2.node_id as nodeId, t2.node_path as nodePath, t2.project_id as projectId, t2.name as name, t2.remark remark, t2.steps steps,
|
<where>
|
||||||
t2.type as type, t2.maintainer as maintainer, t2.priority as priority, t2.method as method, t2.prerequisite as prerequisite
|
<if test="request.name != null">
|
||||||
from test_plan_test_case as t1
|
and test_case.name like CONCAT('%', #{request.name},'%')
|
||||||
inner join test_case as t2 on
|
</if>
|
||||||
t1.plan_id = #{request.planId}
|
<if test="request.nodeIds != null and request.nodeIds.size() > 0">
|
||||||
<if test="request.nodeIds != null and request.nodeIds.size() > 0">
|
and test_case.node_id in
|
||||||
and t2.node_id in
|
<foreach collection="request.nodeIds" item="nodeId" separator="," open="(" close=")">
|
||||||
<foreach collection="request.nodeIds" open="(" close=")" separator="," item="nodeId">
|
#{nodeId}
|
||||||
#{nodeId}
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="request.projectId != null">
|
||||||
|
and test_case.project_id = #{request.projectId}
|
||||||
|
</if>
|
||||||
|
<if test="request.filters != null and request.filters.size() > 0">
|
||||||
|
<foreach collection="request.filters.entrySet()" index="key" item="values">
|
||||||
|
<if test="values != null and values.size() > 0">
|
||||||
|
and test_case.${key} in
|
||||||
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
|
#{value}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="request.orders" separator="," item="order">
|
||||||
|
${order.name} ${order.type}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t1.case_id = t2.id
|
|
||||||
<if test="request.name != null">
|
|
||||||
and t2.name like CONCAT('%', #{request.name},'%')
|
|
||||||
</if>
|
|
||||||
<if test="request.executor != null">
|
|
||||||
and t1.executor = #{request.executor}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,6 +1,8 @@
|
||||||
package io.metersphere.base.mapper.ext;
|
package io.metersphere.base.mapper.ext;
|
||||||
|
|
||||||
|
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
|
||||||
import io.metersphere.dto.TestCaseReportStatusResultDTO;
|
import io.metersphere.dto.TestCaseReportStatusResultDTO;
|
||||||
|
import io.metersphere.dto.TestPlanCaseDTO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -10,4 +12,7 @@ public interface ExtTestPlanTestCaseMapper {
|
||||||
List<TestCaseReportStatusResultDTO> getReportMetric(@Param("planId") String planId);
|
List<TestCaseReportStatusResultDTO> getReportMetric(@Param("planId") String planId);
|
||||||
|
|
||||||
List<String> getExecutors(@Param("planId") String planId);
|
List<String> getExecutors(@Param("planId") String planId);
|
||||||
|
|
||||||
|
List<TestPlanCaseDTO> list(@Param("request") QueryTestPlanCaseRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,41 @@
|
||||||
and plan_id = #{planId};
|
and plan_id = #{planId};
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="io.metersphere.dto.TestPlanCaseDTO">
|
||||||
|
select test_plan_test_case.*, test_case.*
|
||||||
|
from test_plan_test_case
|
||||||
|
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||||
|
<where>
|
||||||
|
<if test="request.name != null">
|
||||||
|
and test_plan_test_case.name like CONCAT('%', #{request.name},'%')
|
||||||
|
</if>
|
||||||
|
<if test="request.nodeIds != null and request.nodeIds.size() > 0">
|
||||||
|
and test_plan_test_case.node_id in
|
||||||
|
<foreach collection="request.nodeIds" item="nodeId" separator="," open="(" close=")">
|
||||||
|
#{nodeId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="request.planId != null">
|
||||||
|
and test_plan_test_case.plan_id = #{request.planId}
|
||||||
|
</if>
|
||||||
|
<if test="request.filters != null and request.filters.size() > 0">
|
||||||
|
<foreach collection="request.filters.entrySet()" index="key" item="values">
|
||||||
|
<if test="values != null and values.size() > 0">
|
||||||
|
and ${key} in
|
||||||
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
|
#{value}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="request.orders" separator="," item="order">
|
||||||
|
test_plan_test_case.${order.name} ${order.type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,9 +1,13 @@
|
||||||
package io.metersphere.config;
|
package io.metersphere.config;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
@ConfigurationProperties(prefix = JmeterProperties.JMETER_PREFIX)
|
@ConfigurationProperties(prefix = JmeterProperties.JMETER_PREFIX)
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
public class JmeterProperties {
|
public class JmeterProperties {
|
||||||
|
|
||||||
public static final String JMETER_PREFIX = "jmeter";
|
public static final String JMETER_PREFIX = "jmeter";
|
||||||
|
@ -12,19 +16,4 @@ public class JmeterProperties {
|
||||||
|
|
||||||
private String home;
|
private String home;
|
||||||
|
|
||||||
public String getImage() {
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImage(String image) {
|
|
||||||
this.image = image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHome() {
|
|
||||||
return home;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHome(String home) {
|
|
||||||
this.home = home;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package io.metersphere.config;
|
package io.metersphere.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
@ConfigurationProperties(prefix = KafkaProperties.KAFKA_PREFIX)
|
@ConfigurationProperties(prefix = KafkaProperties.KAFKA_PREFIX)
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
public class KafkaProperties {
|
public class KafkaProperties {
|
||||||
public static final String KAFKA_PREFIX = "kafka";
|
public static final String KAFKA_PREFIX = "kafka";
|
||||||
|
|
||||||
|
@ -22,112 +26,8 @@ public class KafkaProperties {
|
||||||
private KafkaProperties.Ssl ssl = new KafkaProperties.Ssl();
|
private KafkaProperties.Ssl ssl = new KafkaProperties.Ssl();
|
||||||
private KafkaProperties.Log log = new KafkaProperties.Log();
|
private KafkaProperties.Log log = new KafkaProperties.Log();
|
||||||
|
|
||||||
public String getAcks() {
|
@Getter
|
||||||
return acks;
|
@Setter
|
||||||
}
|
|
||||||
|
|
||||||
public void setAcks(String acks) {
|
|
||||||
this.acks = acks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTopic() {
|
|
||||||
return topic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTopic(String topic) {
|
|
||||||
this.topic = topic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFields() {
|
|
||||||
return fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFields(String fields) {
|
|
||||||
this.fields = fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTimestamp() {
|
|
||||||
return timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTimestamp(String timestamp) {
|
|
||||||
this.timestamp = timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBootstrapServers() {
|
|
||||||
return bootstrapServers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBootstrapServers(String bootstrapServers) {
|
|
||||||
this.bootstrapServers = bootstrapServers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSampleFilter() {
|
|
||||||
return sampleFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSampleFilter(String sampleFilter) {
|
|
||||||
this.sampleFilter = sampleFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTestMode() {
|
|
||||||
return testMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestMode(String testMode) {
|
|
||||||
this.testMode = testMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getCompressionType() {
|
|
||||||
return compressionType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompressionType(String compressionType) {
|
|
||||||
this.compressionType = compressionType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getClientId() {
|
|
||||||
return clientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClientId(String clientId) {
|
|
||||||
this.clientId = clientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParseAllReqHeaders() {
|
|
||||||
return parseAllReqHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParseAllReqHeaders(String parseAllReqHeaders) {
|
|
||||||
this.parseAllReqHeaders = parseAllReqHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParseAllResHeaders() {
|
|
||||||
return parseAllResHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParseAllResHeaders(String parseAllResHeaders) {
|
|
||||||
this.parseAllResHeaders = parseAllResHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBatchSize() {
|
|
||||||
return batchSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBatchSize(String batchSize) {
|
|
||||||
this.batchSize = batchSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConnectionsMaxIdleMs() {
|
|
||||||
return connectionsMaxIdleMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConnectionsMaxIdleMs(String connectionsMaxIdleMs) {
|
|
||||||
this.connectionsMaxIdleMs = connectionsMaxIdleMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Ssl {
|
public static class Ssl {
|
||||||
private String enabled = "false";
|
private String enabled = "false";
|
||||||
private String keyPassword;
|
private String keyPassword;
|
||||||
|
@ -140,124 +40,11 @@ public class KafkaProperties {
|
||||||
private String protocol;
|
private String protocol;
|
||||||
private String enabledProtocols;
|
private String enabledProtocols;
|
||||||
private String provider;
|
private String provider;
|
||||||
|
|
||||||
public Ssl() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnabled() {
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnabled(String enabled) {
|
|
||||||
this.enabled = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeyPassword() {
|
|
||||||
return keyPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKeyPassword(String keyPassword) {
|
|
||||||
this.keyPassword = keyPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeystoreLocation() {
|
|
||||||
return keystoreLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKeystoreLocation(String keystoreLocation) {
|
|
||||||
this.keystoreLocation = keystoreLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeystorePassword() {
|
|
||||||
return keystorePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKeystorePassword(String keystorePassword) {
|
|
||||||
this.keystorePassword = keystorePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeystoreType() {
|
|
||||||
return keystoreType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKeystoreType(String keystoreType) {
|
|
||||||
this.keystoreType = keystoreType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTruststoreLocation() {
|
|
||||||
return truststoreLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTruststoreLocation(String truststoreLocation) {
|
|
||||||
this.truststoreLocation = truststoreLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTruststorePassword() {
|
|
||||||
return truststorePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTruststorePassword(String truststorePassword) {
|
|
||||||
this.truststorePassword = truststorePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTruststoreType() {
|
|
||||||
return truststoreType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTruststoreType(String truststoreType) {
|
|
||||||
this.truststoreType = truststoreType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProtocol() {
|
|
||||||
return protocol;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProtocol(String protocol) {
|
|
||||||
this.protocol = protocol;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnabledProtocols() {
|
|
||||||
return enabledProtocols;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnabledProtocols(String enabledProtocols) {
|
|
||||||
this.enabledProtocols = enabledProtocols;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProvider() {
|
|
||||||
return provider;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProvider(String provider) {
|
|
||||||
this.provider = provider;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Ssl getSsl() {
|
|
||||||
return ssl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSsl(Ssl ssl) {
|
|
||||||
this.ssl = ssl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
public static class Log {
|
public static class Log {
|
||||||
private String topic;
|
private String topic;
|
||||||
|
|
||||||
public String getTopic() {
|
|
||||||
return topic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTopic(String topic) {
|
|
||||||
this.topic = topic;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Log getLog() {
|
|
||||||
return log;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLog(Log log) {
|
|
||||||
this.log = log;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
||||||
import io.metersphere.controller.request.testcase.TestCaseBatchRequest;
|
import io.metersphere.controller.request.testcase.TestCaseBatchRequest;
|
||||||
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
||||||
|
import io.metersphere.dto.TestCaseDTO;
|
||||||
import io.metersphere.excel.domain.ExcelResponse;
|
import io.metersphere.excel.domain.ExcelResponse;
|
||||||
import io.metersphere.service.TestCaseService;
|
import io.metersphere.service.TestCaseService;
|
||||||
import io.metersphere.user.SessionUtils;
|
import io.metersphere.user.SessionUtils;
|
||||||
|
@ -16,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RequestMapping("/test/case")
|
@RequestMapping("/test/case")
|
||||||
|
@ -26,7 +28,7 @@ public class TestCaseController {
|
||||||
TestCaseService testCaseService;
|
TestCaseService testCaseService;
|
||||||
|
|
||||||
@PostMapping("/list/{goPage}/{pageSize}")
|
@PostMapping("/list/{goPage}/{pageSize}")
|
||||||
public Pager<List<TestCaseWithBLOBs>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestCaseRequest request) {
|
public Pager<List<TestCaseDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestCaseRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
return PageUtils.setPageInfo(page, testCaseService.listTestCase(request));
|
return PageUtils.setPageInfo(page, testCaseService.listTestCase(request));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package io.metersphere.controller.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrderRequest {
|
||||||
|
private String name;
|
||||||
|
private String type;
|
||||||
|
}
|
|
@ -1,15 +1,21 @@
|
||||||
package io.metersphere.controller.request.testcase;
|
package io.metersphere.controller.request.testcase;
|
||||||
|
|
||||||
import io.metersphere.base.domain.TestCase;
|
import io.metersphere.base.domain.TestCase;
|
||||||
|
import io.metersphere.controller.request.OrderRequest;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class QueryTestCaseRequest extends TestCase {
|
public class QueryTestCaseRequest extends TestCase {
|
||||||
|
|
||||||
private List<String> nodeIds;
|
private List<String> nodeIds;
|
||||||
|
|
||||||
|
private List<OrderRequest> orders;
|
||||||
|
|
||||||
|
private Map<String, List<String>> filters;
|
||||||
|
|
||||||
private String planId;
|
private String planId;
|
||||||
|
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
package io.metersphere.controller.request.testplancase;
|
package io.metersphere.controller.request.testplancase;
|
||||||
|
|
||||||
import io.metersphere.base.domain.TestCase;
|
|
||||||
import io.metersphere.base.domain.TestPlanTestCase;
|
import io.metersphere.base.domain.TestPlanTestCase;
|
||||||
|
import io.metersphere.controller.request.OrderRequest;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class QueryTestPlanCaseRequest extends TestPlanTestCase {
|
public class QueryTestPlanCaseRequest extends TestPlanTestCase {
|
||||||
|
|
||||||
private List<String> nodeIds;
|
private List<String> nodeIds;
|
||||||
|
|
||||||
|
private List<OrderRequest> orders;
|
||||||
|
|
||||||
|
private Map<String, List<String>> filters;
|
||||||
|
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package io.metersphere.dto;
|
||||||
|
|
||||||
|
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TestCaseDTO extends TestCaseWithBLOBs{
|
||||||
|
|
||||||
|
private String maintainerName;
|
||||||
|
|
||||||
|
public String getMaintainerName() {
|
||||||
|
return maintainerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaintainerName(String maintainerName) {
|
||||||
|
this.maintainerName = maintainerName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,35 +1,13 @@
|
||||||
package io.metersphere.dto;
|
package io.metersphere.dto;
|
||||||
|
|
||||||
import io.metersphere.base.domain.TestCase;
|
|
||||||
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class TestPlanCaseDTO extends TestCaseWithBLOBs {
|
public class TestPlanCaseDTO extends TestCaseWithBLOBs {
|
||||||
|
|
||||||
private String executor;
|
private String executor;
|
||||||
|
private String executorName;
|
||||||
private String status;
|
private String status;
|
||||||
private String results;
|
private String results;
|
||||||
|
|
||||||
public String getExecutor() {
|
|
||||||
return executor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExecutor(String executor) {
|
|
||||||
this.executor = executor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResults() {
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResults(String results) {
|
|
||||||
this.results = results;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,6 +311,7 @@ public class TestCaseNodeService {
|
||||||
} else {
|
} else {
|
||||||
pid = insertTestCaseNode(nodeName, pNode == null ? null : pNode.getId(), projectId, level);
|
pid = insertTestCaseNode(nodeName, pNode == null ? null : pNode.getId(), projectId, level);
|
||||||
pathMap.put(path.toString(), pid);
|
pathMap.put(path.toString(), pid);
|
||||||
|
level++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pathIterator.hasNext()) {
|
while (pathIterator.hasNext()) {
|
||||||
|
@ -322,6 +323,7 @@ public class TestCaseNodeService {
|
||||||
} else {
|
} else {
|
||||||
pid = insertTestCaseNode(nextNodeName, pid, projectId, level);
|
pid = insertTestCaseNode(nextNodeName, pid, projectId, level);
|
||||||
pathMap.put(path.toString(), pid);
|
pathMap.put(path.toString(), pid);
|
||||||
|
level++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class TestCaseReportService {
|
||||||
|
|
||||||
QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest();
|
QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest();
|
||||||
request.setPlanId(planId);
|
request.setPlanId(planId);
|
||||||
List<TestPlanCaseDTO> testPlanTestCases = extTestCaseMapper.getTestPlanTestCases(request);
|
List<TestPlanCaseDTO> testPlanTestCases = extTestPlanTestCaseMapper.list(request);
|
||||||
|
|
||||||
Map<String, TestCaseReportModuleResultDTO> moduleResultMap = new HashMap<>();
|
Map<String, TestCaseReportModuleResultDTO> moduleResultMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import io.metersphere.commons.utils.LogUtil;
|
||||||
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
|
||||||
import io.metersphere.controller.request.testcase.TestCaseBatchRequest;
|
import io.metersphere.controller.request.testcase.TestCaseBatchRequest;
|
||||||
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
||||||
|
import io.metersphere.dto.TestCaseDTO;
|
||||||
import io.metersphere.excel.domain.ExcelErrData;
|
import io.metersphere.excel.domain.ExcelErrData;
|
||||||
import io.metersphere.excel.domain.ExcelResponse;
|
import io.metersphere.excel.domain.ExcelResponse;
|
||||||
import io.metersphere.excel.domain.TestCaseExcelData;
|
import io.metersphere.excel.domain.TestCaseExcelData;
|
||||||
|
@ -101,19 +102,8 @@ public class TestCaseService {
|
||||||
return testCaseMapper.deleteByPrimaryKey(testCaseId);
|
return testCaseMapper.deleteByPrimaryKey(testCaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestCaseWithBLOBs> listTestCase(QueryTestCaseRequest request) {
|
public List<TestCaseDTO> listTestCase(QueryTestCaseRequest request) {
|
||||||
TestCaseExample testCaseExample = new TestCaseExample();
|
return extTestCaseMapper.list(request);
|
||||||
TestCaseExample.Criteria criteria = testCaseExample.createCriteria();
|
|
||||||
if ( StringUtils.isNotBlank(request.getName()) ) {
|
|
||||||
criteria.andNameLike("%" + request.getName() + "%");
|
|
||||||
}
|
|
||||||
if ( StringUtils.isNotBlank(request.getProjectId()) ) {
|
|
||||||
criteria.andProjectIdEqualTo(request.getProjectId());
|
|
||||||
}
|
|
||||||
if ( request.getNodeIds() != null && request.getNodeIds().size() > 0) {
|
|
||||||
criteria.andNodeIdIn(request.getNodeIds());
|
|
||||||
}
|
|
||||||
return testCaseMapper.selectByExampleWithBLOBs(testCaseExample);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,19 +2,25 @@ package io.metersphere.service;
|
||||||
|
|
||||||
import io.metersphere.base.domain.TestPlanTestCase;
|
import io.metersphere.base.domain.TestPlanTestCase;
|
||||||
import io.metersphere.base.domain.TestPlanTestCaseExample;
|
import io.metersphere.base.domain.TestPlanTestCaseExample;
|
||||||
|
import io.metersphere.base.domain.User;
|
||||||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||||
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
|
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
|
||||||
|
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||||
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
||||||
import io.metersphere.commons.utils.BeanUtils;
|
import io.metersphere.commons.utils.BeanUtils;
|
||||||
|
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||||
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
|
||||||
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
|
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
|
||||||
import io.metersphere.dto.TestPlanCaseDTO;
|
import io.metersphere.dto.TestPlanCaseDTO;
|
||||||
|
import io.metersphere.user.SessionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@ -24,10 +30,21 @@ public class TestPlanTestCaseService {
|
||||||
TestPlanTestCaseMapper testPlanTestCaseMapper;
|
TestPlanTestCaseMapper testPlanTestCaseMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
ExtTestCaseMapper extTestCaseMapper;
|
UserService userService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
|
||||||
|
|
||||||
public List<TestPlanCaseDTO> getTestPlanCases(QueryTestPlanCaseRequest request) {
|
public List<TestPlanCaseDTO> getTestPlanCases(QueryTestPlanCaseRequest request) {
|
||||||
return extTestCaseMapper.getTestPlanTestCases(request);
|
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
|
||||||
|
QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
|
||||||
|
queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
Map<String, String> userMap = userService.getMemberList(queryMemberRequest)
|
||||||
|
.stream().collect(Collectors.toMap(User::getId, User::getName));
|
||||||
|
list.forEach(item -> {
|
||||||
|
item.setExecutorName(userMap.get(item.getExecutor()));
|
||||||
|
});
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editTestCase(TestPlanTestCase testPlanTestCase) {
|
public void editTestCase(TestPlanTestCase testPlanTestCase) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ mybatis.configuration.multiple-result-sets-enabled=true
|
||||||
mybatis.configuration.use-column-label=true
|
mybatis.configuration.use-column-label=true
|
||||||
mybatis.configuration.auto-mapping-behavior=full
|
mybatis.configuration.auto-mapping-behavior=full
|
||||||
mybatis.configuration.default-statement-timeout=25000
|
mybatis.configuration.default-statement-timeout=25000
|
||||||
|
mybatis.configuration.map-underscore-to-camel-case=true
|
||||||
|
|
||||||
logging.file.path=/opt/metersphere/logs/${spring.application.name}
|
logging.file.path=/opt/metersphere/logs/${spring.application.name}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-dialog :title="operationType == 'edit' ? ( readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')" :visible.sync="dialogFormVisible" width="65%">
|
<el-dialog :title="operationType == 'edit' ? ( readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')"
|
||||||
|
:visible.sync="dialogFormVisible" width="65%">
|
||||||
|
|
||||||
<el-form :model="form" :rules="rules" ref="caseFrom">
|
<el-form :model="form" :rules="rules" ref="caseFrom" v-loading="result.loading">
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8" :offset="1">
|
<el-col :span="8" :offset="1">
|
||||||
|
@ -13,13 +14,12 @@
|
||||||
:label="$t('test_track.case.name')"
|
:label="$t('test_track.case.name')"
|
||||||
:label-width="formLabelWidth"
|
:label-width="formLabelWidth"
|
||||||
prop="name">
|
prop="name">
|
||||||
<el-input :disabled="readOnly" v-model="form.name"></el-input>
|
<el-input class="case-name" :disabled="readOnly" v-model="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="11" :offset="2">
|
<el-col :span="11" :offset="2">
|
||||||
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
||||||
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.module"
|
v-model="form.module"
|
||||||
:disabled="readOnly"
|
:disabled="readOnly"
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in maintainerOptions"
|
v-for="item in maintainerOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.id"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -173,6 +173,10 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
|
<el-switch
|
||||||
|
v-model="isCreateContinue"
|
||||||
|
active-text="保存并继续创建">
|
||||||
|
</el-switch>
|
||||||
<ms-dialog-footer v-if="!readOnly"
|
<ms-dialog-footer v-if="!readOnly"
|
||||||
@cancel="dialogFormVisible = false"
|
@cancel="dialogFormVisible = false"
|
||||||
@confirm="saveCase"/>
|
@confirm="saveCase"/>
|
||||||
|
@ -196,6 +200,7 @@
|
||||||
components: {MsDialogFooter},
|
components: {MsDialogFooter},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
result: {},
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -227,7 +232,8 @@
|
||||||
method :[{required: true, message: this.$t('test_track.case.input_method'), trigger: 'change'}]
|
method :[{required: true, message: this.$t('test_track.case.input_method'), trigger: 'change'}]
|
||||||
},
|
},
|
||||||
formLabelWidth: "120px",
|
formLabelWidth: "120px",
|
||||||
operationType: ''
|
operationType: '',
|
||||||
|
isCreateContinue: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -318,8 +324,12 @@
|
||||||
this.$warning(this.$t('test_track.case.input_name'));
|
this.$warning(this.$t('test_track.case.input_name'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$post('/test/case/' + this.operationType, param, () => {
|
this.result = this.$post('/test/case/' + this.operationType, param, () => {
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
|
if (this.operationType == 'add' && this.isCreateContinue) {
|
||||||
|
this.form.name = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false;
|
||||||
this.$emit("refresh");
|
this.$emit("refresh");
|
||||||
});
|
});
|
||||||
|
@ -394,4 +404,12 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-switch {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.case-name {
|
||||||
|
width: 194px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,18 +8,20 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-link type="primary" class="download-template"
|
<el-link type="primary" class="download-template"
|
||||||
href="/test/case/export/template">{{$t('test_track.case.import.download_template')}}</el-link></el-row>
|
href="/test/case/export/template">{{$t('test_track.case.import.download_template')}}</el-link></el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-upload
|
<el-upload
|
||||||
|
v-loading="isLoading"
|
||||||
|
element-loading-text="导入中"
|
||||||
|
element-loading-spinner="el-icon-loading"
|
||||||
class="upload-demo"
|
class="upload-demo"
|
||||||
:action="'/test/case/import/' + projectId"
|
:action="'/test/case/import/' + projectId"
|
||||||
:on-preview="handlePreview"
|
|
||||||
multiple
|
multiple
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:beforeUpload="UploadValidate"
|
:beforeUpload="UploadValidate"
|
||||||
:on-success="handleSuccess"
|
:on-success="handleSuccess"
|
||||||
:on-error="handleError"
|
:on-error="handleError"
|
||||||
|
:show-file-list="false"
|
||||||
:file-list="fileList">
|
:file-list="fileList">
|
||||||
<template v-slot:trigger>
|
<template v-slot:trigger>
|
||||||
<el-button size="mini" type="success" plain>{{$t('test_track.case.import.click_upload')}}</el-button>
|
<el-button size="mini" type="success" plain>{{$t('test_track.case.import.click_upload')}}</el-button>
|
||||||
|
@ -27,7 +29,8 @@
|
||||||
<template v-slot:tip>
|
<template v-slot:tip>
|
||||||
<div class="el-upload__tip">{{$t('test_track.case.import.upload_limit')}}</div>
|
<div class="el-upload__tip">{{$t('test_track.case.import.upload_limit')}}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-upload></el-row>
|
</el-upload>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -46,7 +49,6 @@
|
||||||
import ElUploadList from "element-ui/packages/upload/src/upload-list";
|
import ElUploadList from "element-ui/packages/upload/src/upload-list";
|
||||||
import MsTableButton from '../../../../components/common/components/MsTableButton';
|
import MsTableButton from '../../../../components/common/components/MsTableButton';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseImport",
|
name: "TestCaseImport",
|
||||||
components: {ElUploadList, MsTableButton},
|
components: {ElUploadList, MsTableButton},
|
||||||
|
@ -54,7 +56,8 @@
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
errList: []
|
errList: [],
|
||||||
|
isLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -63,9 +66,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePreview(file) {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
handleExceed(files, fileList) {
|
handleExceed(files, fileList) {
|
||||||
this.$warning(this.$t('test_track.case.import.upload_limit_count'));
|
this.$warning(this.$t('test_track.case.import.upload_limit_count'));
|
||||||
},
|
},
|
||||||
|
@ -80,9 +80,12 @@
|
||||||
this.$warning(this.$t('test_track.case.import.upload_limit_size'));
|
this.$warning(this.$t('test_track.case.import.upload_limit_size'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
this.isLoading = true;
|
||||||
|
this.errList = [];
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
handleSuccess(response) {
|
handleSuccess(response) {
|
||||||
|
this.isLoading = false;
|
||||||
let res = response.data;
|
let res = response.data;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$success(this.$t('test_track.case.import.success'));
|
this.$success(this.$t('test_track.case.import.success'));
|
||||||
|
@ -94,6 +97,7 @@
|
||||||
this.fileList = [];
|
this.fileList = [];
|
||||||
},
|
},
|
||||||
handleError(err, file, fileList) {
|
handleError(err, file, fileList) {
|
||||||
|
this.isLoading = false;
|
||||||
this.$error(err.message);
|
this.$error(err.message);
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
|
@ -102,7 +106,7 @@
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
|
@sort-change="sort"
|
||||||
|
@filter-change="filter"
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
@select="handleSelectionChange"
|
@select="handleSelectionChange"
|
||||||
@row-click="showDetail"
|
@row-click="showDetail"
|
||||||
|
@ -37,7 +39,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="priority"
|
prop="priority"
|
||||||
:filters="priorityFilters"
|
:filters="priorityFilters"
|
||||||
:filter-method="filter"
|
column-key="priority"
|
||||||
:label="$t('test_track.case.priority')"
|
:label="$t('test_track.case.priority')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -47,7 +49,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="type"
|
prop="type"
|
||||||
:filters="typeFilters"
|
:filters="typeFilters"
|
||||||
:filter-method="filter"
|
column-key="type"
|
||||||
:label="$t('test_track.case.type')"
|
:label="$t('test_track.case.type')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -56,8 +58,8 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="method"
|
prop="method"
|
||||||
|
column-key="method"
|
||||||
:filters="methodFilters"
|
:filters="methodFilters"
|
||||||
:filter-method="filter"
|
|
||||||
:label="$t('test_track.case.method')"
|
:label="$t('test_track.case.method')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -72,7 +74,7 @@
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="updateTime"
|
prop="updateTime"
|
||||||
sortable
|
sortable="custom"
|
||||||
:label="$t('commons.update_time')"
|
:label="$t('commons.update_time')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -113,6 +115,7 @@
|
||||||
import MsTableOperator from "../../../common/components/MsTableOperator";
|
import MsTableOperator from "../../../common/components/MsTableOperator";
|
||||||
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
|
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
|
||||||
import MsTableButton from "../../../common/components/MsTableButton";
|
import MsTableButton from "../../../common/components/MsTableButton";
|
||||||
|
import {humpToLine} from "../../../../../common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseList",
|
name: "TestCaseList",
|
||||||
|
@ -222,9 +225,18 @@
|
||||||
this.selectIds.clear();
|
this.selectIds.clear();
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
},
|
},
|
||||||
filter(value, row, column) {
|
filter(filters) {
|
||||||
const property = column['property'];
|
if (!this.condition.filters) {
|
||||||
return row[property] === value;
|
this.condition.filters = {};
|
||||||
|
}
|
||||||
|
for(let filter in filters) {
|
||||||
|
if (filters[filter] && filters[filter].length > 0) {
|
||||||
|
this.condition.filters[filter] = filters[filter];
|
||||||
|
} else {
|
||||||
|
this.condition.filters[filter] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.initTableData();
|
||||||
},
|
},
|
||||||
showDetail(row, event, column) {
|
showDetail(row, event, column) {
|
||||||
this.$emit('testCaseDetail', row);
|
this.$emit('testCaseDetail', row);
|
||||||
|
@ -250,6 +262,29 @@
|
||||||
},
|
},
|
||||||
moveToNode() {
|
moveToNode() {
|
||||||
this.$emit('moveToNode', this.selectIds);
|
this.$emit('moveToNode', this.selectIds);
|
||||||
|
},
|
||||||
|
sort(column) {
|
||||||
|
column.prop = humpToLine(column.prop);
|
||||||
|
if (column.order == 'descending') {
|
||||||
|
column.order = 'desc';
|
||||||
|
} else {
|
||||||
|
column.order = 'asc';
|
||||||
|
}
|
||||||
|
if (!this.condition.orders) {
|
||||||
|
this.condition.orders = [];
|
||||||
|
}
|
||||||
|
let hasProp = false;
|
||||||
|
this.condition.orders.forEach(order => {
|
||||||
|
if (order.name == column.prop) {
|
||||||
|
order.type = column.order;
|
||||||
|
hasProp = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!hasProp) {
|
||||||
|
this.condition.orders.push({name: column.prop, type: column.order});
|
||||||
|
}
|
||||||
|
this.initTableData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
width="20%">
|
width="20%">
|
||||||
<el-select v-model="executor" :placeholder="$t('test_track.plan_view.select_executor')">
|
<el-select v-model="executor" :placeholder="$t('test_track.plan_view.select_executor')">
|
||||||
<el-option v-for="item in executorOptions" :key="item.id"
|
<el-option v-for="item in executorOptions" :key="item.id"
|
||||||
:label="item.id" :value="item.id"></el-option>
|
:label="item.name" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
|
@filter-change="filter"
|
||||||
|
@sort-change="sort"
|
||||||
@select="handleSelectionChange"
|
@select="handleSelectionChange"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:data="tableData">
|
:data="tableData">
|
||||||
|
@ -37,7 +39,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="priority"
|
prop="priority"
|
||||||
:filters="priorityFilters"
|
:filters="priorityFilters"
|
||||||
:filter-method="filter"
|
column-key="priority"
|
||||||
:label="$t('test_track.case.priority')">
|
:label="$t('test_track.case.priority')">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
||||||
|
@ -47,7 +49,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="type"
|
prop="type"
|
||||||
:filters="typeFilters"
|
:filters="typeFilters"
|
||||||
:filter-method="filter"
|
column-key="type"
|
||||||
:label="$t('test_track.case.type')"
|
:label="$t('test_track.case.type')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -58,7 +60,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="method"
|
prop="method"
|
||||||
:filters="methodFilters"
|
:filters="methodFilters"
|
||||||
:filter-method="filter"
|
column-key="method"
|
||||||
:label="$t('test_track.case.method')"
|
:label="$t('test_track.case.method')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -67,14 +69,14 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="executor"
|
prop="executorName"
|
||||||
:label="$t('test_track.plan_view.executor')">
|
:label="$t('test_track.plan_view.executor')">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="status"
|
prop="status"
|
||||||
:filters="statusFilters"
|
:filters="statusFilters"
|
||||||
:filter-method="filter"
|
column-key="status"
|
||||||
:label="$t('test_track.plan_view.execute_result')">
|
:label="$t('test_track.plan_view.execute_result')">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<status-table-item :value="scope.row.status"/>
|
<status-table-item :value="scope.row.status"/>
|
||||||
|
@ -125,7 +127,7 @@
|
||||||
import NodeBreadcrumb from '../../../common/NodeBreadcrumb';
|
import NodeBreadcrumb from '../../../common/NodeBreadcrumb';
|
||||||
|
|
||||||
import {TokenKey} from '../../../../../../common/js/constants';
|
import {TokenKey} from '../../../../../../common/js/constants';
|
||||||
import {tableFilter} from '../../../../../../common/js/utils';
|
import {humpToLine, tableFilter} from '../../../../../../common/js/utils';
|
||||||
import PriorityTableItem from "../../../common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "../../../common/tableItems/planview/PriorityTableItem";
|
||||||
import StatusTableItem from "../../../common/tableItems/planview/StatusTableItem";
|
import StatusTableItem from "../../../common/tableItems/planview/StatusTableItem";
|
||||||
import TypeTableItem from "../../../common/tableItems/planview/TypeTableItem";
|
import TypeTableItem from "../../../common/tableItems/planview/TypeTableItem";
|
||||||
|
@ -295,10 +297,6 @@
|
||||||
}
|
}
|
||||||
this.initTableData();
|
this.initTableData();
|
||||||
},
|
},
|
||||||
filter(value, row, column) {
|
|
||||||
const property = column['property'];
|
|
||||||
return row[property] === value;
|
|
||||||
},
|
|
||||||
openTestReport() {
|
openTestReport() {
|
||||||
this.$refs.testReporTtemplateList.open();
|
this.$refs.testReporTtemplateList.open();
|
||||||
},
|
},
|
||||||
|
@ -316,6 +314,42 @@
|
||||||
id = this.testPlan.reportId;
|
id = this.testPlan.reportId;
|
||||||
}
|
}
|
||||||
this.$refs.testCaseReportView.open(id);
|
this.$refs.testCaseReportView.open(id);
|
||||||
|
},
|
||||||
|
filter(filters) {
|
||||||
|
if (!this.condition.filters) {
|
||||||
|
this.condition.filters = {};
|
||||||
|
}
|
||||||
|
for(let filter in filters) {
|
||||||
|
if (filters[filter] && filters[filter].length > 0) {
|
||||||
|
this.condition.filters[filter] = filters[filter];
|
||||||
|
} else {
|
||||||
|
this.condition.filters[filter] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
sort(column) {
|
||||||
|
column.prop = humpToLine(column.prop);
|
||||||
|
if (column.order == 'descending') {
|
||||||
|
column.order = 'desc';
|
||||||
|
} else {
|
||||||
|
column.order = 'asc';
|
||||||
|
}
|
||||||
|
if (!this.condition.orders) {
|
||||||
|
this.condition.orders = [];
|
||||||
|
}
|
||||||
|
let hasProp = false;
|
||||||
|
this.condition.orders.forEach(order => {
|
||||||
|
if (order.name == column.prop) {
|
||||||
|
order.type = column.order;
|
||||||
|
hasProp = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!hasProp) {
|
||||||
|
this.condition.orders.push({name: column.prop, type: column.order});
|
||||||
|
}
|
||||||
|
this.initTableData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,3 +55,8 @@ export function mapToJson(strMap){
|
||||||
}
|
}
|
||||||
return JSON.stringify(obj);
|
return JSON.stringify(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 驼峰转换下划线
|
||||||
|
export function humpToLine(name) {
|
||||||
|
return name.replace(/([A-Z])/g,"_$1").toLowerCase();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue