Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
26c73ae223
|
@ -7,6 +7,8 @@ public class TestCase implements Serializable {
|
||||||
|
|
||||||
private Integer nodeId;
|
private Integer nodeId;
|
||||||
|
|
||||||
|
private String nodePath;
|
||||||
|
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -43,6 +45,14 @@ public class TestCase implements Serializable {
|
||||||
this.nodeId = nodeId;
|
this.nodeId = nodeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNodePath() {
|
||||||
|
return nodePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNodePath(String nodePath) {
|
||||||
|
this.nodePath = nodePath == null ? null : nodePath.trim();
|
||||||
|
}
|
||||||
|
|
||||||
public String getProjectId() {
|
public String getProjectId() {
|
||||||
return projectId;
|
return projectId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,6 +234,76 @@ public class TestCaseExample {
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathIsNull() {
|
||||||
|
addCriterion("node_path is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathIsNotNull() {
|
||||||
|
addCriterion("node_path is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathEqualTo(String value) {
|
||||||
|
addCriterion("node_path =", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathNotEqualTo(String value) {
|
||||||
|
addCriterion("node_path <>", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathGreaterThan(String value) {
|
||||||
|
addCriterion("node_path >", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("node_path >=", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathLessThan(String value) {
|
||||||
|
addCriterion("node_path <", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("node_path <=", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathLike(String value) {
|
||||||
|
addCriterion("node_path like", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathNotLike(String value) {
|
||||||
|
addCriterion("node_path not like", value, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathIn(List<String> values) {
|
||||||
|
addCriterion("node_path in", values, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathNotIn(List<String> values) {
|
||||||
|
addCriterion("node_path not in", values, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathBetween(String value1, String value2) {
|
||||||
|
addCriterion("node_path between", value1, value2, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andNodePathNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("node_path not between", value1, value2, "nodePath");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
public Criteria andProjectIdIsNull() {
|
public Criteria andProjectIdIsNull() {
|
||||||
addCriterion("project_id is null");
|
addCriterion("project_id is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCase">
|
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCase">
|
||||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
<result column="node_id" jdbcType="INTEGER" property="nodeId" />
|
<result column="node_id" jdbcType="INTEGER" property="nodeId" />
|
||||||
|
<result column="node_path" jdbcType="VARCHAR" property="nodePath" />
|
||||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, node_id, project_id, name, type, maintainer, priority, method, prerequisite,
|
id, node_id, node_path, project_id, name, type, maintainer, priority, method, prerequisite,
|
||||||
create_time, update_time
|
create_time, update_time
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
|
@ -132,16 +133,16 @@
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
insert into test_case (id, node_id, project_id,
|
insert into test_case (id, node_id, node_path,
|
||||||
name, type, maintainer,
|
project_id, name, type,
|
||||||
priority, method, prerequisite,
|
maintainer, priority, method,
|
||||||
create_time, update_time, remark,
|
prerequisite, create_time, update_time,
|
||||||
steps)
|
remark, steps)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=INTEGER}, #{nodePath,jdbcType=VARCHAR},
|
||||||
#{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{maintainer,jdbcType=VARCHAR},
|
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
#{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR},
|
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{remark,jdbcType=LONGVARCHAR},
|
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||||
#{steps,jdbcType=LONGVARCHAR})
|
#{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
insert into test_case
|
insert into test_case
|
||||||
|
@ -152,6 +153,9 @@
|
||||||
<if test="nodeId != null">
|
<if test="nodeId != null">
|
||||||
node_id,
|
node_id,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="nodePath != null">
|
||||||
|
node_path,
|
||||||
|
</if>
|
||||||
<if test="projectId != null">
|
<if test="projectId != null">
|
||||||
project_id,
|
project_id,
|
||||||
</if>
|
</if>
|
||||||
|
@ -193,6 +197,9 @@
|
||||||
<if test="nodeId != null">
|
<if test="nodeId != null">
|
||||||
#{nodeId,jdbcType=INTEGER},
|
#{nodeId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="nodePath != null">
|
||||||
|
#{nodePath,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="projectId != null">
|
<if test="projectId != null">
|
||||||
#{projectId,jdbcType=VARCHAR},
|
#{projectId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -243,6 +250,9 @@
|
||||||
<if test="record.nodeId != null">
|
<if test="record.nodeId != null">
|
||||||
node_id = #{record.nodeId,jdbcType=INTEGER},
|
node_id = #{record.nodeId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.nodePath != null">
|
||||||
|
node_path = #{record.nodePath,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="record.projectId != null">
|
<if test="record.projectId != null">
|
||||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -285,6 +295,7 @@
|
||||||
update test_case
|
update test_case
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
node_id = #{record.nodeId,jdbcType=INTEGER},
|
node_id = #{record.nodeId,jdbcType=INTEGER},
|
||||||
|
node_path = #{record.nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
type = #{record.type,jdbcType=VARCHAR},
|
type = #{record.type,jdbcType=VARCHAR},
|
||||||
|
@ -304,6 +315,7 @@
|
||||||
update test_case
|
update test_case
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
node_id = #{record.nodeId,jdbcType=INTEGER},
|
node_id = #{record.nodeId,jdbcType=INTEGER},
|
||||||
|
node_path = #{record.nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
type = #{record.type,jdbcType=VARCHAR},
|
type = #{record.type,jdbcType=VARCHAR},
|
||||||
|
@ -323,6 +335,9 @@
|
||||||
<if test="nodeId != null">
|
<if test="nodeId != null">
|
||||||
node_id = #{nodeId,jdbcType=INTEGER},
|
node_id = #{nodeId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="nodePath != null">
|
||||||
|
node_path = #{nodePath,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="projectId != null">
|
<if test="projectId != null">
|
||||||
project_id = #{projectId,jdbcType=VARCHAR},
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -362,6 +377,7 @@
|
||||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
update test_case
|
update test_case
|
||||||
set node_id = #{nodeId,jdbcType=INTEGER},
|
set node_id = #{nodeId,jdbcType=INTEGER},
|
||||||
|
node_path = #{nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{projectId,jdbcType=VARCHAR},
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
type = #{type,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
||||||
|
@ -378,6 +394,7 @@
|
||||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
|
||||||
update test_case
|
update test_case
|
||||||
set node_id = #{nodeId,jdbcType=INTEGER},
|
set node_id = #{nodeId,jdbcType=INTEGER},
|
||||||
|
node_path = #{nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{projectId,jdbcType=VARCHAR},
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
type = #{type,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
||||||
|
|
|
@ -8,6 +8,7 @@ import io.metersphere.commons.utils.PageUtils;
|
||||||
import io.metersphere.commons.utils.Pager;
|
import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.controller.request.ReportRequest;
|
import io.metersphere.controller.request.ReportRequest;
|
||||||
import io.metersphere.dto.ReportDTO;
|
import io.metersphere.dto.ReportDTO;
|
||||||
|
import io.metersphere.report.base.ChartsData;
|
||||||
import io.metersphere.report.base.Errors;
|
import io.metersphere.report.base.Errors;
|
||||||
import io.metersphere.report.base.TestOverview;
|
import io.metersphere.report.base.TestOverview;
|
||||||
import io.metersphere.report.dto.ErrorsTop5DTO;
|
import io.metersphere.report.dto.ErrorsTop5DTO;
|
||||||
|
@ -76,5 +77,9 @@ public class ReportController {
|
||||||
return reportService.getTestOverview(reportId);
|
return reportService.getTestOverview(reportId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/content/load_chart/{reportId}")
|
||||||
|
public ChartsData getLoadChartData(@PathVariable String reportId) {
|
||||||
|
return reportService.getLoadChartData(reportId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,8 +294,8 @@ public class JtlResolver {
|
||||||
List<String> hits = new ArrayList<>();
|
List<String> hits = new ArrayList<>();
|
||||||
List<String> erorrs = new ArrayList<>();
|
List<String> erorrs = new ArrayList<>();
|
||||||
List<String> timeList = new ArrayList<>();
|
List<String> timeList = new ArrayList<>();
|
||||||
////
|
//// todo SimpleDateFormat
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
DecimalFormat df = new DecimalFormat("0.0");
|
DecimalFormat df = new DecimalFormat("0.0");
|
||||||
|
|
||||||
total.sort(Comparator.comparing(metric -> Long.valueOf(metric.getTimestamp())));
|
total.sort(Comparator.comparing(metric -> Long.valueOf(metric.getTimestamp())));
|
||||||
|
@ -310,8 +310,8 @@ public class JtlResolver {
|
||||||
public int compare(Map.Entry<String, List<Metric>> t1, Map.Entry<String, List<Metric>> t2) {
|
public int compare(Map.Entry<String, List<Metric>> t1, Map.Entry<String, List<Metric>> t2) {
|
||||||
Date date1 = null,date2 = null;
|
Date date1 = null,date2 = null;
|
||||||
try {
|
try {
|
||||||
date1 = sdf.parse(t1.getKey());
|
date1 = simpleDateFormat.parse(t1.getKey());
|
||||||
date2 = sdf.parse(t2.getKey());
|
date2 = simpleDateFormat.parse(t2.getKey());
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -323,6 +323,8 @@ public class JtlResolver {
|
||||||
int failSize = 0;
|
int failSize = 0;
|
||||||
Map.Entry<String, List<Metric>> map = entries.get(i);
|
Map.Entry<String, List<Metric>> map = entries.get(i);
|
||||||
List<Metric> metrics = map.getValue();
|
List<Metric> metrics = map.getValue();
|
||||||
|
Map<String, List<Metric>> metricsMap = metrics.stream().collect(Collectors.groupingBy(Metric::getThreadName));
|
||||||
|
int maxUsers = metricsMap.size();
|
||||||
for (int j = 0; j < metrics.size(); j++) {
|
for (int j = 0; j < metrics.size(); j++) {
|
||||||
Metric metric = metrics.get(j);
|
Metric metric = metrics.get(j);
|
||||||
String success = metric.getSuccess();
|
String success = metric.getSuccess();
|
||||||
|
@ -330,17 +332,22 @@ public class JtlResolver {
|
||||||
failSize++;
|
failSize++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// todo
|
||||||
timeList.add(map.getKey());
|
timeList.add(map.getKey());
|
||||||
hits.add(String.valueOf(metrics.size()));
|
hits.add(df.format(metrics.size() * 1.0 / maxUsers));
|
||||||
users.add(String.valueOf(metrics.size()));
|
users.add(String.valueOf(maxUsers));
|
||||||
erorrs.add(String.valueOf(failSize));
|
erorrs.add(String.valueOf(failSize));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.setTime(timeList);
|
||||||
|
data.setUsers(users);
|
||||||
|
data.setHits(hits);
|
||||||
|
data.setErrors(erorrs);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static String stampToDate(String s){
|
private static String stampToDate(String s){
|
||||||
String res;
|
String res;
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package io.metersphere.report.base;
|
package io.metersphere.report.base;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ChartsData {
|
public class ChartsData {
|
||||||
|
|
||||||
private String xAxis;
|
private String xAxis;
|
||||||
|
@ -7,6 +9,12 @@ public class ChartsData {
|
||||||
private String yAxis1;
|
private String yAxis1;
|
||||||
private String serices;
|
private String serices;
|
||||||
|
|
||||||
|
////
|
||||||
|
private List<String> time;
|
||||||
|
private List<String> users;
|
||||||
|
private List<String> hits;
|
||||||
|
private List<String> errors;
|
||||||
|
|
||||||
public String getxAxis() {
|
public String getxAxis() {
|
||||||
return xAxis;
|
return xAxis;
|
||||||
}
|
}
|
||||||
|
@ -38,4 +46,36 @@ public class ChartsData {
|
||||||
public void setSerices(String serices) {
|
public void setSerices(String serices) {
|
||||||
this.serices = serices;
|
this.serices = serices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(List<String> time) {
|
||||||
|
this.time=time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUsers() {
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsers(List<String> users) {
|
||||||
|
this.users=users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHits() {
|
||||||
|
return hits;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHits(List<String> hits) {
|
||||||
|
this.hits=hits;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getErrors() {
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrors(List<String> errors) {
|
||||||
|
this.errors=errors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import io.metersphere.base.mapper.ext.ExtLoadTestReportMapper;
|
||||||
import io.metersphere.controller.request.ReportRequest;
|
import io.metersphere.controller.request.ReportRequest;
|
||||||
import io.metersphere.dto.ReportDTO;
|
import io.metersphere.dto.ReportDTO;
|
||||||
import io.metersphere.report.JtlResolver;
|
import io.metersphere.report.JtlResolver;
|
||||||
|
import io.metersphere.report.base.ChartsData;
|
||||||
import io.metersphere.report.base.Errors;
|
import io.metersphere.report.base.Errors;
|
||||||
import io.metersphere.report.base.TestOverview;
|
import io.metersphere.report.base.TestOverview;
|
||||||
import io.metersphere.report.dto.ErrorsTop5DTO;
|
import io.metersphere.report.dto.ErrorsTop5DTO;
|
||||||
|
@ -75,4 +76,11 @@ public class ReportService {
|
||||||
TestOverview testOverview = JtlResolver.getTestOverview(content);
|
TestOverview testOverview = JtlResolver.getTestOverview(content);
|
||||||
return testOverview;
|
return testOverview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChartsData getLoadChartData(String id) {
|
||||||
|
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||||
|
String content = loadTestReport.getContent();
|
||||||
|
ChartsData chartsData = JtlResolver.getLoadChartData(content);
|
||||||
|
return chartsData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,6 +265,7 @@ CREATE TABLE IF NOT EXISTS `test_case_node` (
|
||||||
CREATE TABLE IF NOT EXISTS `test_case` (
|
CREATE TABLE IF NOT EXISTS `test_case` (
|
||||||
`id` varchar(50) NOT NULL COMMENT 'Test case ID',
|
`id` varchar(50) NOT NULL COMMENT 'Test case ID',
|
||||||
`node_id` int(13) NOT NULL COMMENT 'Node ID this case belongs to',
|
`node_id` int(13) NOT NULL COMMENT 'Node ID this case belongs to',
|
||||||
|
`node_path` varchar(50) NOT NULL COMMENT 'Node path this case belongs to',
|
||||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
||||||
`name` varchar(64) NOT NULL COMMENT 'Case name',
|
`name` varchar(64) NOT NULL COMMENT 'Case name',
|
||||||
`type` varchar(25) NOT NULL COMMENT 'Test case type',
|
`type` varchar(25) NOT NULL COMMENT 'Test case type',
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<chart ref="chart1" :options="option1" :autoresize="true"></chart>
|
<chart ref="chart1" :options="option" :autoresize="true"></chart>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<chart ref="chart2" :options="option2" :autoresize="true"></chart>
|
<chart ref="chart2" :options="option2" :autoresize="true"></chart>
|
||||||
|
@ -79,53 +79,7 @@
|
||||||
avgResponseTime: "0",
|
avgResponseTime: "0",
|
||||||
responseTime90: "0",
|
responseTime90: "0",
|
||||||
avgBandwidth: "0",
|
avgBandwidth: "0",
|
||||||
option1: {
|
option: {},
|
||||||
legend: {
|
|
||||||
top: 20,
|
|
||||||
data: ['Users', 'Hits/s', 'Error(s)']
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: ["10:22:01", "10:22:02", "10:22:04", "10:22:06",
|
|
||||||
"10:22:07", "10:22:08", "10:22:09", "10:22:10", "10:22:11", "10:22:12"]
|
|
||||||
},
|
|
||||||
yAxis: [{
|
|
||||||
name: 'User',
|
|
||||||
type: 'value',
|
|
||||||
min: 0,
|
|
||||||
max: 30,
|
|
||||||
splitNumber: 5,
|
|
||||||
interval: 30 / 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Hits/s',
|
|
||||||
type: 'value'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: 'Users',
|
|
||||||
color: '#0CA74A',
|
|
||||||
data: [6,9,10,15,1,10,25,19,15,2],
|
|
||||||
type: 'line',
|
|
||||||
yAxisIndex: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Hits/s',
|
|
||||||
color: '#65A2FF',
|
|
||||||
data: [1,1,1,1,1,1,1,1,1,1],
|
|
||||||
type: 'line',
|
|
||||||
yAxisIndex: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Error(s)',
|
|
||||||
color: '#E6113C',
|
|
||||||
data: [0,0,0,0,1,1,2,0,5,2],
|
|
||||||
type: 'line',
|
|
||||||
yAxisIndex: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
option2: {
|
option2: {
|
||||||
legend: {
|
legend: {
|
||||||
top: 20,
|
top: 20,
|
||||||
|
@ -173,6 +127,59 @@
|
||||||
this.responseTime90 = data.responseTime90;
|
this.responseTime90 = data.responseTime90;
|
||||||
this.avgBandwidth = data.avgBandwidth;
|
this.avgBandwidth = data.avgBandwidth;
|
||||||
})
|
})
|
||||||
|
this.$get("/report/content/load_chart/" + this.id, res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.option = this.generateOption(data);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
generateOption(data) {
|
||||||
|
let option = {
|
||||||
|
legend: {
|
||||||
|
top: 20,
|
||||||
|
data: ['Users', 'Hits/s', 'Error(s)']
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
},
|
||||||
|
yAxis: [{
|
||||||
|
name: 'User',
|
||||||
|
type: 'value',
|
||||||
|
min: 0,
|
||||||
|
splitNumber: 5,
|
||||||
|
interval: 10 / 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Hits/s',
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: 'Users',
|
||||||
|
color: '#0CA74A',
|
||||||
|
type: 'line',
|
||||||
|
yAxisIndex: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Hits/s',
|
||||||
|
color: '#65A2FF',
|
||||||
|
type: 'line',
|
||||||
|
yAxisIndex: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Error(s)',
|
||||||
|
color: '#E6113C',
|
||||||
|
type: 'line',
|
||||||
|
yAxisIndex: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$set(option.xAxis, "data", data.time);
|
||||||
|
this.$set(option.series[0], "data", data.users);
|
||||||
|
this.$set(option.series[1], "data", data.hits);
|
||||||
|
this.$set(option.series[2], "data", data.errors);
|
||||||
|
return option;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -193,6 +200,10 @@
|
||||||
this.responseTime90 = data.responseTime90;
|
this.responseTime90 = data.responseTime90;
|
||||||
this.avgBandwidth = data.avgBandwidth;
|
this.avgBandwidth = data.avgBandwidth;
|
||||||
})
|
})
|
||||||
|
this.$get("/report/content/load_chart/" + reportId, res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.option1 = this.generateOption(data);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,14 @@
|
||||||
ref="nodeTree"></node-tree>
|
ref="nodeTree"></node-tree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
|
|
||||||
<test-case-list
|
<el-main class="main-content">
|
||||||
@openTestCaseEditDialog="openTestCaseEditDialog"
|
|
||||||
@testCaseEdit="openTestCaseEditDialog"
|
<test-case-list
|
||||||
ref="testCaseList"></test-case-list>
|
@openTestCaseEditDialog="openTestCaseEditDialog"
|
||||||
|
@testCaseEdit="openTestCaseEditDialog"
|
||||||
|
ref="testCaseList"></test-case-list>
|
||||||
|
</el-main>
|
||||||
|
|
||||||
|
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
|
@ -130,7 +134,7 @@
|
||||||
moduleOptions.push(option);
|
moduleOptions.push(option);
|
||||||
if(node.children){
|
if(node.children){
|
||||||
for (let i = 0; i < node.children.length; i++){
|
for (let i = 0; i < node.children.length; i++){
|
||||||
this.buildNodePath(node.children[i], { path: '/' + node.name }, moduleOptions);
|
this.buildNodePath(node.children[i], { path: option.path }, moduleOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -145,10 +149,12 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.testplan-container {
|
.case_container {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
background: white;
|
||||||
|
height: 1000px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,21 +164,6 @@
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.test-content {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-page {
|
|
||||||
padding-top: 20px;
|
|
||||||
margin-right: -9px;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.case_container {
|
|
||||||
background: white;
|
|
||||||
height: 600px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_tree {
|
.node_tree {
|
||||||
margin: 10%;
|
margin: 10%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,6 +256,11 @@
|
||||||
Object.assign(param, this.form);
|
Object.assign(param, this.form);
|
||||||
param.steps = JSON.stringify(this.form.steps);
|
param.steps = JSON.stringify(this.form.steps);
|
||||||
param.nodeId = this.form.module;
|
param.nodeId = this.form.module;
|
||||||
|
this.moduleOptions.forEach(item => {
|
||||||
|
if(this.form.module === item.id){
|
||||||
|
param.nodePath = item.path;
|
||||||
|
}
|
||||||
|
});
|
||||||
if(localStorage.getItem('currentProject')){
|
if(localStorage.getItem('currentProject')){
|
||||||
param.projectId = JSON.parse(localStorage.getItem('currentProject')).id;
|
param.projectId = JSON.parse(localStorage.getItem('currentProject')).id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,19 +36,19 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="name"
|
prop="name"
|
||||||
:label="$t('commons.name')"
|
:label="$t('commons.name')"
|
||||||
width="130"
|
width="120"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="priority"
|
prop="priority"
|
||||||
:label="$t('test_track.priority')"
|
:label="$t('test_track.priority')"
|
||||||
width="130"
|
width="120"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="type"
|
prop="type"
|
||||||
:label="$t('test_track.type')"
|
:label="$t('test_track.type')"
|
||||||
width="130"
|
width="120"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.type == 'functional'">{{$t('commons.functional')}}</span>
|
<span v-if="scope.row.type == 'functional'">{{$t('commons.functional')}}</span>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="method"
|
prop="method"
|
||||||
:label="$t('test_track.method')"
|
:label="$t('test_track.method')"
|
||||||
width="130"
|
width="120"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.method == 'manual'">{{$t('test_track.manual')}}</span>
|
<span v-if="scope.row.method == 'manual'">{{$t('test_track.manual')}}</span>
|
||||||
|
@ -67,8 +67,8 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="remark"
|
prop="nodePath"
|
||||||
:label="$t('commons.remark')"
|
:label="$t('test_track.module')"
|
||||||
width="160"
|
width="160"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
width="160"
|
width="100"
|
||||||
:label="$t('commons.operating')">
|
:label="$t('commons.operating')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
|
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
|
||||||
|
@ -96,7 +96,6 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="22" :offset="1">
|
<el-col :span="22" :offset="1">
|
||||||
|
@ -204,4 +203,10 @@
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
.table-page {
|
||||||
|
padding-top: 20px;
|
||||||
|
margin-right: -9px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue