功能测试->接口测试

This commit is contained in:
chenjianxing 2020-04-03 11:25:23 +08:00
parent 38e9810a97
commit d421965476
50 changed files with 421 additions and 447 deletions

View File

@ -2,7 +2,7 @@ package io.metersphere.base.domain;
import java.io.Serializable; import java.io.Serializable;
public class FucTest implements Serializable { public class ApiTest implements Serializable {
private String id; private String id;
private String projectId; private String projectId;

View File

@ -3,14 +3,14 @@ package io.metersphere.base.domain;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class FucTestExample { public class ApiTestExample {
protected String orderByClause; protected String orderByClause;
protected boolean distinct; protected boolean distinct;
protected List<Criteria> oredCriteria; protected List<Criteria> oredCriteria;
public FucTestExample() { public ApiTestExample() {
oredCriteria = new ArrayList<Criteria>(); oredCriteria = new ArrayList<Criteria>();
} }

View File

@ -2,7 +2,7 @@ package io.metersphere.base.domain;
import java.io.Serializable; import java.io.Serializable;
public class FucTestFile implements Serializable { public class ApiTestFile implements Serializable {
private String testId; private String testId;
private String fileId; private String fileId;

View File

@ -3,14 +3,14 @@ package io.metersphere.base.domain;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class FucTestFileExample { public class ApiTestFileExample {
protected String orderByClause; protected String orderByClause;
protected boolean distinct; protected boolean distinct;
protected List<Criteria> oredCriteria; protected List<Criteria> oredCriteria;
public FucTestFileExample() { public ApiTestFileExample() {
oredCriteria = new ArrayList<Criteria>(); oredCriteria = new ArrayList<Criteria>();
} }

View File

@ -2,7 +2,7 @@ package io.metersphere.base.domain;
import java.io.Serializable; import java.io.Serializable;
public class FucTestReport implements Serializable { public class ApiTestReport implements Serializable {
private String id; private String id;
private String testId; private String testId;

View File

@ -3,14 +3,14 @@ package io.metersphere.base.domain;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class FucTestReportExample { public class ApiTestReportExample {
protected String orderByClause; protected String orderByClause;
protected boolean distinct; protected boolean distinct;
protected List<Criteria> oredCriteria; protected List<Criteria> oredCriteria;
public FucTestReportExample() { public ApiTestReportExample() {
oredCriteria = new ArrayList<Criteria>(); oredCriteria = new ArrayList<Criteria>();
} }

View File

@ -2,7 +2,7 @@ package io.metersphere.base.domain;
import java.io.Serializable; import java.io.Serializable;
public class FucTestWithBLOBs extends FucTest implements Serializable { public class ApiTestWithBLOBs extends ApiTest implements Serializable {
private String runtimeConfiguration; private String runtimeConfiguration;
private String schedule; private String schedule;

View File

@ -1,23 +0,0 @@
package io.metersphere.base.domain;
public class FucTestLog {
private String seleniumLog;
private String browserDriverLog;
public String getSeleniumLog() {
return seleniumLog;
}
public void setSeleniumLog(String seleniumLog) {
this.seleniumLog = seleniumLog;
}
public String getBrowserDriverLog() {
return browserDriverLog;
}
public void setBrowserDriverLog(String browserDriverLog) {
this.browserDriverLog = browserDriverLog;
}
}

View File

@ -0,0 +1,22 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.ApiTestFile;
import io.metersphere.base.domain.ApiTestFileExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ApiTestFileMapper {
long countByExample(ApiTestFileExample example);
int deleteByExample(ApiTestFileExample example);
int insert(ApiTestFile record);
int insertSelective(ApiTestFile record);
List<ApiTestFile> selectByExample(ApiTestFileExample example);
int updateByExampleSelective(@Param("record") ApiTestFile record, @Param("example") ApiTestFileExample example);
int updateByExample(@Param("record") ApiTestFile record, @Param("example") ApiTestFileExample example);
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.FucTestFileMapper"> <mapper namespace="io.metersphere.base.mapper.ApiTestFileMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.FucTestFile"> <resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTestFile">
<result column="test_id" jdbcType="VARCHAR" property="testId" /> <result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="file_id" jdbcType="VARCHAR" property="fileId" /> <result column="file_id" jdbcType="VARCHAR" property="fileId" />
</resultMap> </resultMap>
@ -66,13 +66,13 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
test_id, file_id test_id, file_id
</sql> </sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.FucTestFileExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTestFileExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from fuc_test_file from api_test_file
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -80,18 +80,18 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.FucTestFileExample"> <delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTestFileExample">
delete from fuc_test_file delete from api_test_file
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.FucTestFile"> <insert id="insert" parameterType="io.metersphere.base.domain.ApiTestFile">
insert into fuc_test_file (test_id, file_id) insert into api_test_file (test_id, file_id)
values (#{testId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}) values (#{testId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FucTestFile"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestFile">
insert into fuc_test_file insert into api_test_file
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="testId != null"> <if test="testId != null">
test_id, test_id,
@ -109,14 +109,14 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.FucTestFileExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.metersphere.base.domain.ApiTestFileExample" resultType="java.lang.Long">
select count(*) from fuc_test_file select count(*) from api_test_file
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update fuc_test_file update api_test_file
<set> <set>
<if test="record.testId != null"> <if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR},
@ -130,7 +130,7 @@
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update fuc_test_file update api_test_file
set test_id = #{record.testId,jdbcType=VARCHAR}, set test_id = #{record.testId,jdbcType=VARCHAR},
file_id = #{record.fileId,jdbcType=VARCHAR} file_id = #{record.fileId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">

View File

@ -0,0 +1,37 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.ApiTest;
import io.metersphere.base.domain.ApiTestExample;
import io.metersphere.base.domain.ApiTestWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ApiTestMapper {
long countByExample(ApiTestExample example);
int deleteByExample(ApiTestExample example);
int deleteByPrimaryKey(String id);
int insert(ApiTestWithBLOBs record);
int insertSelective(ApiTestWithBLOBs record);
List<ApiTestWithBLOBs> selectByExampleWithBLOBs(ApiTestExample example);
List<ApiTest> selectByExample(ApiTestExample example);
ApiTestWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ApiTestWithBLOBs record, @Param("example") ApiTestExample example);
int updateByExampleWithBLOBs(@Param("record") ApiTestWithBLOBs record, @Param("example") ApiTestExample example);
int updateByExample(@Param("record") ApiTest record, @Param("example") ApiTestExample example);
int updateByPrimaryKeySelective(ApiTestWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(ApiTestWithBLOBs record);
int updateByPrimaryKey(ApiTest record);
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.FucTestMapper"> <mapper namespace="io.metersphere.base.mapper.ApiTestMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.FucTest"> <resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTest">
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<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" />
@ -9,7 +9,7 @@
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.FucTestWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestWithBLOBs">
<result column="runtime_configuration" jdbcType="LONGVARCHAR" property="runtimeConfiguration" /> <result column="runtime_configuration" jdbcType="LONGVARCHAR" property="runtimeConfiguration" />
<result column="schedule" jdbcType="LONGVARCHAR" property="schedule" /> <result column="schedule" jdbcType="LONGVARCHAR" property="schedule" />
</resultMap> </resultMap>
@ -77,7 +77,7 @@
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
runtime_configuration, schedule runtime_configuration, schedule
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.FucTestExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestExample" resultMap="ResultMapWithBLOBs">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -85,7 +85,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from fuc_test from api_test
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -93,13 +93,13 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.FucTestExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTestExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from fuc_test from api_test
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -112,29 +112,29 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from fuc_test from api_test
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from fuc_test delete from api_test
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.FucTestExample"> <delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTestExample">
delete from fuc_test delete from api_test
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.FucTestWithBLOBs"> <insert id="insert" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
insert into fuc_test (id, project_id, name, insert into api_test (id, project_id, name,
description, create_time, update_time, description, create_time, update_time,
runtime_configuration, schedule) runtime_configuration, schedule)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{runtimeConfiguration,jdbcType=LONGVARCHAR}, #{schedule,jdbcType=LONGVARCHAR}) #{runtimeConfiguration,jdbcType=LONGVARCHAR}, #{schedule,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FucTestWithBLOBs"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
insert into fuc_test insert into api_test
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
@ -188,14 +188,14 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.FucTestExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.metersphere.base.domain.ApiTestExample" resultType="java.lang.Long">
select count(*) from fuc_test select count(*) from api_test
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update fuc_test update api_test
<set> <set>
<if test="record.id != null"> <if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR}, id = #{record.id,jdbcType=VARCHAR},
@ -227,7 +227,7 @@
</if> </if>
</update> </update>
<update id="updateByExampleWithBLOBs" parameterType="map"> <update id="updateByExampleWithBLOBs" parameterType="map">
update fuc_test update api_test
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
@ -241,7 +241,7 @@
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update fuc_test update api_test
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
@ -252,8 +252,8 @@
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.FucTestWithBLOBs"> <update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
update fuc_test update api_test
<set> <set>
<if test="projectId != null"> <if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
@ -279,8 +279,8 @@
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.FucTestWithBLOBs"> <update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
update fuc_test update api_test
set project_id = #{projectId,jdbcType=VARCHAR}, set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR},
@ -290,8 +290,8 @@
schedule = #{schedule,jdbcType=LONGVARCHAR} schedule = #{schedule,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.FucTest"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTest">
update fuc_test update api_test
set project_id = #{projectId,jdbcType=VARCHAR}, set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR},

View File

@ -0,0 +1,36 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.ApiTestReport;
import io.metersphere.base.domain.ApiTestReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ApiTestReportMapper {
long countByExample(ApiTestReportExample example);
int deleteByExample(ApiTestReportExample example);
int deleteByPrimaryKey(String id);
int insert(ApiTestReport record);
int insertSelective(ApiTestReport record);
List<ApiTestReport> selectByExampleWithBLOBs(ApiTestReportExample example);
List<ApiTestReport> selectByExample(ApiTestReportExample example);
ApiTestReport selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example);
int updateByExampleWithBLOBs(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example);
int updateByExample(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example);
int updateByPrimaryKeySelective(ApiTestReport record);
int updateByPrimaryKeyWithBLOBs(ApiTestReport record);
int updateByPrimaryKey(ApiTestReport record);
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.FucTestReportMapper"> <mapper namespace="io.metersphere.base.mapper.ApiTestReportMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.FucTestReport"> <resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTestReport">
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_id" jdbcType="VARCHAR" property="testId" /> <result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
@ -10,7 +10,7 @@
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="status" jdbcType="VARCHAR" property="status" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.FucTestReport"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestReport">
<result column="content" jdbcType="LONGVARCHAR" property="content" /> <result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
@ -77,7 +77,7 @@
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.FucTestReportExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestReportExample" resultMap="ResultMapWithBLOBs">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -85,7 +85,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from fuc_test_report from api_test_report
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -93,13 +93,13 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.FucTestReportExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTestReportExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from fuc_test_report from api_test_report
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -112,29 +112,29 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from fuc_test_report from api_test_report
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from fuc_test_report delete from api_test_report
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.FucTestReportExample"> <delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTestReportExample">
delete from fuc_test_report delete from api_test_report
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.FucTestReport"> <insert id="insert" parameterType="io.metersphere.base.domain.ApiTestReport">
insert into fuc_test_report (id, test_id, name, insert into api_test_report (id, test_id, name,
description, create_time, update_time, description, create_time, update_time,
status, content) status, content)
values (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{status,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}) #{status,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FucTestReport"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestReport">
insert into fuc_test_report insert into api_test_report
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
@ -188,14 +188,14 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.FucTestReportExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.metersphere.base.domain.ApiTestReportExample" resultType="java.lang.Long">
select count(*) from fuc_test_report select count(*) from api_test_report
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update fuc_test_report update api_test_report
<set> <set>
<if test="record.id != null"> <if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR}, id = #{record.id,jdbcType=VARCHAR},
@ -227,7 +227,7 @@
</if> </if>
</update> </update>
<update id="updateByExampleWithBLOBs" parameterType="map"> <update id="updateByExampleWithBLOBs" parameterType="map">
update fuc_test_report update api_test_report
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
@ -241,7 +241,7 @@
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update fuc_test_report update api_test_report
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
@ -253,8 +253,8 @@
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.FucTestReport"> <update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiTestReport">
update fuc_test_report update api_test_report
<set> <set>
<if test="testId != null"> <if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR}, test_id = #{testId,jdbcType=VARCHAR},
@ -280,8 +280,8 @@
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.FucTestReport"> <update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestReport">
update fuc_test_report update api_test_report
set test_id = #{testId,jdbcType=VARCHAR}, set test_id = #{testId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR},
@ -291,8 +291,8 @@
content = #{content,jdbcType=LONGVARCHAR} content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.FucTestReport"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTestReport">
update fuc_test_report update api_test_report
set test_id = #{testId,jdbcType=VARCHAR}, set test_id = #{testId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR},

View File

@ -1,22 +0,0 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.FucTestFile;
import io.metersphere.base.domain.FucTestFileExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface FucTestFileMapper {
long countByExample(FucTestFileExample example);
int deleteByExample(FucTestFileExample example);
int insert(FucTestFile record);
int insertSelective(FucTestFile record);
List<FucTestFile> selectByExample(FucTestFileExample example);
int updateByExampleSelective(@Param("record") FucTestFile record, @Param("example") FucTestFileExample example);
int updateByExample(@Param("record") FucTestFile record, @Param("example") FucTestFileExample example);
}

View File

@ -1,37 +0,0 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.FucTest;
import io.metersphere.base.domain.FucTestExample;
import io.metersphere.base.domain.FucTestWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface FucTestMapper {
long countByExample(FucTestExample example);
int deleteByExample(FucTestExample example);
int deleteByPrimaryKey(String id);
int insert(FucTestWithBLOBs record);
int insertSelective(FucTestWithBLOBs record);
List<FucTestWithBLOBs> selectByExampleWithBLOBs(FucTestExample example);
List<FucTest> selectByExample(FucTestExample example);
FucTestWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") FucTestWithBLOBs record, @Param("example") FucTestExample example);
int updateByExampleWithBLOBs(@Param("record") FucTestWithBLOBs record, @Param("example") FucTestExample example);
int updateByExample(@Param("record") FucTest record, @Param("example") FucTestExample example);
int updateByPrimaryKeySelective(FucTestWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(FucTestWithBLOBs record);
int updateByPrimaryKey(FucTest record);
}

View File

@ -1,36 +0,0 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.FucTestReport;
import io.metersphere.base.domain.FucTestReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface FucTestReportMapper {
long countByExample(FucTestReportExample example);
int deleteByExample(FucTestReportExample example);
int deleteByPrimaryKey(String id);
int insert(FucTestReport record);
int insertSelective(FucTestReport record);
List<FucTestReport> selectByExampleWithBLOBs(FucTestReportExample example);
List<FucTestReport> selectByExample(FucTestReportExample example);
FucTestReport selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example);
int updateByExampleWithBLOBs(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example);
int updateByExample(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example);
int updateByPrimaryKeySelective(FucTestReport record);
int updateByPrimaryKeyWithBLOBs(FucTestReport record);
int updateByPrimaryKey(FucTestReport record);
}

View File

@ -1,11 +1,11 @@
package io.metersphere.base.mapper.ext; package io.metersphere.base.mapper.ext;
import io.metersphere.controller.request.testplan.QueryTestPlanRequest; import io.metersphere.controller.request.testplan.QueryTestPlanRequest;
import io.metersphere.dto.FunctionalTestDTO; import io.metersphere.dto.ApiTestDTO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface ExtFunctionalTestMapper { public interface ExtApiTestMapper {
List<FunctionalTestDTO> list(@Param("request") QueryTestPlanRequest params); List<ApiTestDTO> list(@Param("request") QueryTestPlanRequest params);
} }

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.metersphere.base.mapper.ext.ExtFunctionalTestMapper"> <mapper namespace="io.metersphere.base.mapper.ext.ExtApiTestMapper">
<resultMap id="BaseResultMap" type="io.metersphere.dto.FunctionalTestDTO" <resultMap id="BaseResultMap" type="io.metersphere.dto.ApiTestDTO"
extends="io.metersphere.base.mapper.FucTestMapper.BaseResultMap"> extends="io.metersphere.base.mapper.ApiTestMapper.BaseResultMap">
<result column="project_name" property="projectName"/> <result column="project_name" property="projectName"/>
</resultMap> </resultMap>
<select id="list" resultMap="BaseResultMap" parameterType="io.metersphere.controller.request.testplan.QueryTestPlanRequest"> <select id="list" resultMap="BaseResultMap" parameterType="io.metersphere.controller.request.testplan.QueryTestPlanRequest">
select fuc_test.*, project.name as project_name select api_test.*, project.name as project_name
from fuc_test from api_test
left join project on fuc_test.project_id = project.id left join project on api_test.project_id = project.id
<where> <where>
<if test="request.name != null"> <if test="request.name != null">
and fuc_test.name like CONCAT('%', #{request.name},'%') and api_test.name like CONCAT('%', #{request.name},'%')
</if> </if>
<if test="request.workspaceId != null"> <if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId} AND project.workspace_id = #{request.workspaceId}
@ -22,11 +22,11 @@
AND project.id = #{request.projectId} AND project.id = #{request.projectId}
</if> </if>
<if test="request.id != null"> <if test="request.id != null">
AND fuc_test.id = #{request.id} AND api_test.id = #{request.id}
</if> </if>
</where> </where>
<if test="request.recent"> <if test="request.recent">
order by fuc_test.update_time desc order by api_test.update_time desc
</if> </if>
</select> </select>

View File

@ -0,0 +1,14 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ApiReportDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtApiTestReportMapper {
List<ApiReportDTO> getReportList(@Param("reportRequest") ReportRequest request);
ApiReportDTO getReportTestAndProInfo(@Param("id") String id);
}

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.metersphere.base.mapper.ext.ExtFunctionalTestReportMapper"> <mapper namespace="io.metersphere.base.mapper.ext.ExtApiTestReportMapper">
<select id="getReportList" resultType="io.metersphere.dto.FunctionalReportDTO"> <select id="getReportList" resultType="io.metersphere.dto.ApiReportDTO">
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description, select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName
from fuc_test_report ltr left join fuc_test lt on ltr.test_id = lt.id from api_test_report ltr left join api_test lt on ltr.test_id = lt.id
<where> <where>
<if test="reportRequest.name != null"> <if test="reportRequest.name != null">
AND ltr.name like CONCAT('%', #{reportRequest.name},'%') AND ltr.name like CONCAT('%', #{reportRequest.name},'%')
@ -13,12 +13,12 @@
</where> </where>
</select> </select>
<select id="getReportTestAndProInfo" resultType="io.metersphere.dto.FunctionalReportDTO"> <select id="getReportTestAndProInfo" resultType="io.metersphere.dto.ApiReportDTO">
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description, select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, ltr.content as content, ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, ltr.content as content,
lt.name as testName, lt.name as testName,
p.id as projectId, p.name as projectName p.id as projectId, p.name as projectName
from fuc_test_report ltr left join fuc_test lt on ltr.test_id = lt.id left join project p on lt.project_id = p.id from api_test_report ltr left join api_test lt on ltr.test_id = lt.id left join project p on lt.project_id = p.id
where ltr.id = #{id} where ltr.id = #{id}
</select> </select>

View File

@ -1,15 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.FunctionalReportDTO;
import io.metersphere.dto.ReportDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtFunctionalTestReportMapper {
List<FunctionalReportDTO> getReportList(@Param("reportRequest") ReportRequest request);
FunctionalReportDTO getReportTestAndProInfo(@Param("id") String id);
}

View File

@ -2,14 +2,13 @@ package io.metersphere.controller;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.FucTestLog; import io.metersphere.base.domain.ApiTestReport;
import io.metersphere.base.domain.FucTestReport;
import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils; 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.FunctionalReportDTO; import io.metersphere.dto.ApiReportDTO;
import io.metersphere.service.FunctionalReportService; import io.metersphere.service.ApiReportService;
import io.metersphere.user.SessionUtils; import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
@ -19,36 +18,36 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
@RestController @RestController
@RequestMapping(value = "/functional/report") @RequestMapping(value = "/api/report")
public class FunctionalReportController { public class ApiReportController {
@Resource @Resource
private FunctionalReportService functionalReportService; private ApiReportService apiReportService;
@GetMapping("/recent/{count}") @GetMapping("/recent/{count}")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR) @RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public List<FucTestReport> recentProjects(@PathVariable int count) { public List<ApiTestReport> recentProjects(@PathVariable int count) {
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
ReportRequest request = new ReportRequest(); ReportRequest request = new ReportRequest();
request.setWorkspaceId(currentWorkspaceId); request.setWorkspaceId(currentWorkspaceId);
PageHelper.startPage(1, count); PageHelper.startPage(1, count);
return functionalReportService.getRecentReportList(request); return apiReportService.getRecentReportList(request);
} }
@PostMapping("/list/all/{goPage}/{pageSize}") @PostMapping("/list/all/{goPage}/{pageSize}")
public Pager<List<FunctionalReportDTO>> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) { public Pager<List<ApiReportDTO>> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true); Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, functionalReportService.getReportList(request)); return PageUtils.setPageInfo(page, apiReportService.getReportList(request));
} }
@PostMapping("/delete/{reportId}") @PostMapping("/delete/{reportId}")
public void deleteReport(@PathVariable String reportId) { public void deleteReport(@PathVariable String reportId) {
functionalReportService.deleteReport(reportId); apiReportService.deleteReport(reportId);
} }
@GetMapping("/test/pro/info/{reportId}") @GetMapping("/test/pro/info/{reportId}")
public FunctionalReportDTO getReportTestAndProInfo(@PathVariable String reportId) { public ApiReportDTO getReportTestAndProInfo(@PathVariable String reportId) {
return functionalReportService.getReportTestAndProInfo(reportId); return apiReportService.getReportTestAndProInfo(reportId);
} }
} }

View File

@ -7,9 +7,9 @@ import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.testplan.*; import io.metersphere.controller.request.testplan.*;
import io.metersphere.dto.FunctionalTestDTO; import io.metersphere.dto.ApiTestDTO;
import io.metersphere.service.FileService; import io.metersphere.service.FileService;
import io.metersphere.service.FuctionalTestService; import io.metersphere.service.ApiTestService;
import io.metersphere.user.SessionUtils; import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
@ -23,28 +23,28 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
@RestController @RestController
@RequestMapping(value = "/functional/test") @RequestMapping(value = "/api")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR) @RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public class FunctionalTestController { public class ApiTestController {
@Resource @Resource
private FuctionalTestService fuctionalTestService; private ApiTestService apiTestService;
@Resource @Resource
private FileService fileService; private FileService fileService;
@GetMapping("recent/{count}") @GetMapping("recent/{count}")
public List<FunctionalTestDTO> recentTestPlans(@PathVariable int count) { public List<ApiTestDTO> recentTestPlans(@PathVariable int count) {
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
QueryTestPlanRequest request = new QueryTestPlanRequest(); QueryTestPlanRequest request = new QueryTestPlanRequest();
request.setWorkspaceId(currentWorkspaceId); request.setWorkspaceId(currentWorkspaceId);
PageHelper.startPage(1, count, true); PageHelper.startPage(1, count, true);
return fuctionalTestService.recentTestPlans(request); return apiTestService.recentTestPlans(request);
} }
@PostMapping("/list/{goPage}/{pageSize}") @PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<FunctionalTestDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) { public Pager<List<ApiTestDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true); Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, fuctionalTestService.list(request)); return PageUtils.setPageInfo(page, apiTestService.list(request));
} }
@PostMapping(value = "/save", consumes = {"multipart/form-data"}) @PostMapping(value = "/save", consumes = {"multipart/form-data"})
@ -52,7 +52,7 @@ public class FunctionalTestController {
@RequestPart("request") SaveTestPlanRequest request, @RequestPart("request") SaveTestPlanRequest request,
@RequestPart(value = "file") MultipartFile file @RequestPart(value = "file") MultipartFile file
) { ) {
return fuctionalTestService.save(request, file); return apiTestService.save(request, file);
} }
@PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @PostMapping(value = "/edit", consumes = {"multipart/form-data"})
@ -60,32 +60,32 @@ public class FunctionalTestController {
@RequestPart("request") EditTestPlanRequest request, @RequestPart("request") EditTestPlanRequest request,
@RequestPart(value = "file", required = false) MultipartFile file @RequestPart(value = "file", required = false) MultipartFile file
) { ) {
return fuctionalTestService.edit(request, file); return apiTestService.edit(request, file);
} }
@GetMapping("/get/{testId}") @GetMapping("/get/{testId}")
public FunctionalTestDTO get(@PathVariable String testId) { public ApiTestDTO get(@PathVariable String testId) {
return fuctionalTestService.get(testId); return apiTestService.get(testId);
} }
@GetMapping("/get-runtime-config/{testId}") @GetMapping("/get-runtime-config/{testId}")
public String getAdvancedConfiguration(@PathVariable String testId) { public String getAdvancedConfiguration(@PathVariable String testId) {
return fuctionalTestService.getRuntimeConfiguration(testId); return apiTestService.getRuntimeConfiguration(testId);
} }
@PostMapping("/delete") @PostMapping("/delete")
public void delete(@RequestBody DeleteTestPlanRequest request) { public void delete(@RequestBody DeleteTestPlanRequest request) {
fuctionalTestService.delete(request); apiTestService.delete(request);
} }
@PostMapping("/run") @PostMapping("/run")
public void run(@RequestBody RunTestPlanRequest request) { public void run(@RequestBody RunTestPlanRequest request) {
fuctionalTestService.run(request); apiTestService.run(request);
} }
@GetMapping("/file/metadata/{testId}") @GetMapping("/file/metadata/{testId}")
public FileMetadata getFileMetadata(@PathVariable String testId) { public FileMetadata getFileMetadata(@PathVariable String testId) {
return fileService.getFucFileMetadataByTestId(testId); return fileService.getApiFileMetadataByTestId(testId);
} }
@PostMapping("/file/download") @PostMapping("/file/download")

View File

@ -1,6 +1,6 @@
package io.metersphere.dto; package io.metersphere.dto;
public class FunctionalReportDTO { public class ApiReportDTO {
private String id; private String id;
private String testId; private String testId;

View File

@ -2,7 +2,7 @@ package io.metersphere.dto;
import io.metersphere.base.domain.LoadTest; import io.metersphere.base.domain.LoadTest;
public class FunctionalTestDTO extends LoadTest { public class ApiTestDTO extends LoadTest {
private String projectName; private String projectName;
public String getProjectName() { public String getProjectName() {

View File

@ -0,0 +1,42 @@
package io.metersphere.service;
import io.metersphere.base.domain.ApiTestReport;
import io.metersphere.base.domain.ApiTestReportExample;
import io.metersphere.base.mapper.ApiTestReportMapper;
import io.metersphere.base.mapper.ext.ExtApiTestReportMapper;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ApiReportDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiReportService {
@Resource
private ApiTestReportMapper ApiTestReportMapper;
@Resource
private ExtApiTestReportMapper extApiTestReportMapper;
public List<ApiTestReport> getRecentReportList(ReportRequest request) {
ApiTestReportExample example = new ApiTestReportExample();
example.setOrderByClause("update_time desc");
return ApiTestReportMapper.selectByExample(example);
}
public List<ApiReportDTO> getReportList(ReportRequest request) {
return extApiTestReportMapper.getReportList(request);
}
public void deleteReport(String reportId) {
ApiTestReportMapper.deleteByPrimaryKey(reportId);
}
public ApiReportDTO getReportTestAndProInfo(String reportId) {
return extApiTestReportMapper.getReportTestAndProInfo(reportId);
}
}

View File

@ -2,10 +2,10 @@ package io.metersphere.service;
import io.metersphere.base.domain.*; import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*; import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtFunctionalTestMapper; import io.metersphere.base.mapper.ext.ExtApiTestMapper;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.controller.request.testplan.*; import io.metersphere.controller.request.testplan.*;
import io.metersphere.dto.FunctionalTestDTO; import io.metersphere.dto.ApiTestDTO;
import io.metersphere.i18n.Translator; import io.metersphere.i18n.Translator;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -20,11 +20,11 @@ import java.util.UUID;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class FuctionalTestService { public class ApiTestService {
@Resource @Resource
private FucTestMapper fucTestMapper; private ApiTestMapper ApiTestMapper;
@Resource @Resource
private ExtFunctionalTestMapper extFucTestMapper; private ExtApiTestMapper extApiTestMapper;
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Resource @Resource
@ -32,16 +32,16 @@ public class FuctionalTestService {
@Resource @Resource
private FileContentMapper fileContentMapper; private FileContentMapper fileContentMapper;
@Resource @Resource
private FucTestFileMapper fucTestFileMapper; private ApiTestFileMapper ApiTestFileMapper;
@Resource @Resource
private FileService fileService; private FileService fileService;
public List<FunctionalTestDTO> list(QueryTestPlanRequest request) { public List<ApiTestDTO> list(QueryTestPlanRequest request) {
return extFucTestMapper.list(request); return extApiTestMapper.list(request);
} }
public void delete(DeleteTestPlanRequest request) { public void delete(DeleteTestPlanRequest request) {
fucTestMapper.deleteByPrimaryKey(request.getId()); ApiTestMapper.deleteByPrimaryKey(request.getId());
fileService.deleteFileByTestId(request.getId()); fileService.deleteFileByTestId(request.getId());
} }
@ -53,34 +53,34 @@ public class FuctionalTestService {
final FileMetadata fileMetadata = saveFile(file); final FileMetadata fileMetadata = saveFile(file);
final FucTestWithBLOBs fucTest = saveFucTest(request); final ApiTestWithBLOBs ApiTest = saveApiTest(request);
FucTestFile fucTestFile = new FucTestFile(); ApiTestFile ApiTestFile = new ApiTestFile();
fucTestFile.setTestId(fucTest.getId()); ApiTestFile.setTestId(ApiTest.getId());
fucTestFile.setFileId(fileMetadata.getId()); ApiTestFile.setFileId(fileMetadata.getId());
fucTestFileMapper.insert(fucTestFile); ApiTestFileMapper.insert(ApiTestFile);
return fucTest.getId(); return ApiTest.getId();
} }
private FucTestWithBLOBs saveFucTest(SaveTestPlanRequest request) { private ApiTestWithBLOBs saveApiTest(SaveTestPlanRequest request) {
FucTestExample example = new FucTestExample(); ApiTestExample example = new ApiTestExample();
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()); example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId());
if (fucTestMapper.countByExample(example) > 0) { if (ApiTestMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("function_test_already_exists")); MSException.throwException(Translator.get("function_test_already_exists"));
} }
final FucTestWithBLOBs fucTes = new FucTestWithBLOBs(); final ApiTestWithBLOBs ApiTes = new ApiTestWithBLOBs();
fucTes.setId(UUID.randomUUID().toString()); ApiTes.setId(UUID.randomUUID().toString());
fucTes.setName(request.getName()); ApiTes.setName(request.getName());
fucTes.setProjectId(request.getProjectId()); ApiTes.setProjectId(request.getProjectId());
fucTes.setCreateTime(System.currentTimeMillis()); ApiTes.setCreateTime(System.currentTimeMillis());
fucTes.setUpdateTime(System.currentTimeMillis()); ApiTes.setUpdateTime(System.currentTimeMillis());
fucTes.setDescription("todo"); ApiTes.setDescription("todo");
fucTes.setRuntimeConfiguration(request.getRuntimeConfiguration()); ApiTes.setRuntimeConfiguration(request.getRuntimeConfiguration());
fucTestMapper.insert(fucTes); ApiTestMapper.insert(ApiTes);
return fucTes; return ApiTes;
} }
private FileMetadata saveFile(MultipartFile file) { private FileMetadata saveFile(MultipartFile file) {
@ -110,30 +110,30 @@ public class FuctionalTestService {
if (file != null) { if (file != null) {
fileService.deleteFileByTestId(request.getId()); fileService.deleteFileByTestId(request.getId());
final FileMetadata fileMetadata = saveFile(file); final FileMetadata fileMetadata = saveFile(file);
FucTestFile fucTestFile = new FucTestFile(); ApiTestFile ApiTestFile = new ApiTestFile();
fucTestFile.setTestId(request.getId()); ApiTestFile.setTestId(request.getId());
fucTestFile.setFileId(fileMetadata.getId()); ApiTestFile.setFileId(fileMetadata.getId());
fucTestFileMapper.insert(fucTestFile); ApiTestFileMapper.insert(ApiTestFile);
} }
final FucTestWithBLOBs fucTest = fucTestMapper.selectByPrimaryKey(request.getId()); final ApiTestWithBLOBs ApiTest = ApiTestMapper.selectByPrimaryKey(request.getId());
if (fucTest == null) { if (ApiTest == null) {
MSException.throwException("无法编辑测试,未找到测试:" + request.getId()); MSException.throwException("无法编辑测试,未找到测试:" + request.getId());
} else { } else {
fucTest.setName(request.getName()); ApiTest.setName(request.getName());
fucTest.setProjectId(request.getProjectId()); ApiTest.setProjectId(request.getProjectId());
fucTest.setUpdateTime(System.currentTimeMillis()); ApiTest.setUpdateTime(System.currentTimeMillis());
fucTest.setDescription("todo"); ApiTest.setDescription("todo");
fucTest.setRuntimeConfiguration(request.getRuntimeConfiguration()); ApiTest.setRuntimeConfiguration(request.getRuntimeConfiguration());
fucTestMapper.updateByPrimaryKeySelective(fucTest); ApiTestMapper.updateByPrimaryKeySelective(ApiTest);
} }
return request.getId(); return request.getId();
} }
public void run(RunTestPlanRequest request) { public void run(RunTestPlanRequest request) {
final FucTestWithBLOBs fucTest = fucTestMapper.selectByPrimaryKey(request.getId()); final ApiTestWithBLOBs ApiTest = ApiTestMapper.selectByPrimaryKey(request.getId());
// if (fucTest == null) { // if (ApiTest == null) {
// MSException.throwException("无法运行测试,未找到测试:" + request.getId()); // MSException.throwException("无法运行测试,未找到测试:" + request.getId());
// } // }
// //
@ -147,7 +147,7 @@ public class FuctionalTestService {
// MSException.throwException("无法运行测试无法获取测试文件内容测试ID" + request.getId()); // MSException.throwException("无法运行测试无法获取测试文件内容测试ID" + request.getId());
// } // }
// //
// System.out.println("开始运行:" + fucTest.getName()); // System.out.println("开始运行:" + ApiTest.getName());
// final Engine engine = EngineFactory.createEngine(fileMetadata.getType()); // final Engine engine = EngineFactory.createEngine(fileMetadata.getType());
// if (engine == null) { // if (engine == null) {
// MSException.throwException(String.format("无法运行测试未识别测试文件类型测试ID%s文件类型%s", // MSException.throwException(String.format("无法运行测试未识别测试文件类型测试ID%s文件类型%s",
@ -157,7 +157,7 @@ public class FuctionalTestService {
// //
// boolean init = true; // boolean init = true;
// try { // try {
//// init = engine.init(EngineFactory.createContext(fucTest, fileMetadata, fileContent)); //// init = engine.init(EngineFactory.createContext(ApiTest, fileMetadata, fileContent));
// } catch (Exception e) { // } catch (Exception e) {
// MSException.throwException(e); // MSException.throwException(e);
// } // }
@ -170,16 +170,16 @@ public class FuctionalTestService {
/// todo通过调用stop方法能够停止正在运行的engine但是如果部署了多个backend实例页面发送的停止请求如何定位到具体的engine /// todo通过调用stop方法能够停止正在运行的engine但是如果部署了多个backend实例页面发送的停止请求如何定位到具体的engine
} }
public List<FunctionalTestDTO> recentTestPlans(QueryTestPlanRequest request) { public List<ApiTestDTO> recentTestPlans(QueryTestPlanRequest request) {
// 查询最近的测试计划 // 查询最近的测试计划
request.setRecent(true); request.setRecent(true);
return extFucTestMapper.list(request); return extApiTestMapper.list(request);
} }
public FunctionalTestDTO get(String testId) { public ApiTestDTO get(String testId) {
QueryTestPlanRequest request = new QueryTestPlanRequest(); QueryTestPlanRequest request = new QueryTestPlanRequest();
request.setId(testId); request.setId(testId);
List<FunctionalTestDTO> testDTOS = extFucTestMapper.list(request); List<ApiTestDTO> testDTOS = extApiTestMapper.list(request);
if (!CollectionUtils.isEmpty(testDTOS)) { if (!CollectionUtils.isEmpty(testDTOS)) {
return testDTOS.get(0); return testDTOS.get(0);
} }
@ -187,8 +187,8 @@ public class FuctionalTestService {
} }
public String getRuntimeConfiguration(String testId) { public String getRuntimeConfiguration(String testId) {
FucTestWithBLOBs fucTestWithBLOBs = fucTestMapper.selectByPrimaryKey(testId); ApiTestWithBLOBs ApiTestWithBLOBs = ApiTestMapper.selectByPrimaryKey(testId);
return Optional.ofNullable(fucTestWithBLOBs).orElse(new FucTestWithBLOBs()).getRuntimeConfiguration(); return Optional.ofNullable(ApiTestWithBLOBs).orElse(new ApiTestWithBLOBs()).getRuntimeConfiguration();
} }
} }

View File

@ -3,7 +3,7 @@ package io.metersphere.service;
import io.metersphere.base.domain.*; import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.FileContentMapper; import io.metersphere.base.mapper.FileContentMapper;
import io.metersphere.base.mapper.FileMetadataMapper; import io.metersphere.base.mapper.FileMetadataMapper;
import io.metersphere.base.mapper.FucTestFileMapper; import io.metersphere.base.mapper.ApiTestFileMapper;
import io.metersphere.base.mapper.LoadTestFileMapper; import io.metersphere.base.mapper.LoadTestFileMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -19,7 +19,7 @@ public class FileService {
@Resource @Resource
private LoadTestFileMapper loadTestFileMapper; private LoadTestFileMapper loadTestFileMapper;
@Resource @Resource
private FucTestFileMapper fucTestFileMapper; private ApiTestFileMapper ApiTestFileMapper;
@Resource @Resource
private FileContentMapper fileContentMapper; private FileContentMapper fileContentMapper;
@ -43,10 +43,10 @@ public class FileService {
return fileMetadataMapper.selectByExample(example); return fileMetadataMapper.selectByExample(example);
} }
public FileMetadata getFucFileMetadataByTestId(String testId) { public FileMetadata getApiFileMetadataByTestId(String testId) {
FucTestFileExample fucTestFileExample = new FucTestFileExample(); ApiTestFileExample ApiTestFileExample = new ApiTestFileExample();
fucTestFileExample.createCriteria().andTestIdEqualTo(testId); ApiTestFileExample.createCriteria().andTestIdEqualTo(testId);
final List<FucTestFile> loadTestFiles = fucTestFileMapper.selectByExample(fucTestFileExample); final List<ApiTestFile> loadTestFiles = ApiTestFileMapper.selectByExample(ApiTestFileExample);
if (CollectionUtils.isEmpty(loadTestFiles)) { if (CollectionUtils.isEmpty(loadTestFiles)) {
return null; return null;

View File

@ -1,45 +0,0 @@
package io.metersphere.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.metersphere.base.domain.FucTestLog;
import io.metersphere.base.domain.FucTestReport;
import io.metersphere.base.domain.FucTestReportExample;
import io.metersphere.base.mapper.FucTestReportMapper;
import io.metersphere.base.mapper.ext.ExtFunctionalTestReportMapper;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.FunctionalReportDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class FunctionalReportService {
@Resource
private FucTestReportMapper fucTestReportMapper;
@Resource
private ExtFunctionalTestReportMapper extFunctionalTestReportMapper;
public List<FucTestReport> getRecentReportList(ReportRequest request) {
FucTestReportExample example = new FucTestReportExample();
example.setOrderByClause("update_time desc");
return fucTestReportMapper.selectByExample(example);
}
public List<FunctionalReportDTO> getReportList(ReportRequest request) {
return extFunctionalTestReportMapper.getReportList(request);
}
public void deleteReport(String reportId) {
fucTestReportMapper.deleteByPrimaryKey(reportId);
}
public FunctionalReportDTO getReportTestAndProInfo(String reportId) {
return extFunctionalTestReportMapper.getReportTestAndProInfo(reportId);
}
}

View File

@ -182,9 +182,9 @@ CREATE TABLE IF NOT EXISTS `workspace` (
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin; COLLATE = utf8mb4_bin;
-- funcional start -- api start
CREATE TABLE IF NOT EXISTS `fuc_test` ( CREATE TABLE IF NOT EXISTS `api_test` (
`id` varchar(50) NOT NULL COMMENT 'Test ID', `id` varchar(50) NOT NULL COMMENT 'Test ID',
`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 'Test name', `name` varchar(64) NOT NULL COMMENT 'Test name',
@ -199,15 +199,15 @@ CREATE TABLE IF NOT EXISTS `fuc_test` (
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin; COLLATE = utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `fuc_test_file` ( CREATE TABLE IF NOT EXISTS `api_test_file` (
`test_id` varchar(64) DEFAULT NULL, `test_id` varchar(64) DEFAULT NULL,
`file_id` varchar(64) DEFAULT NULL, `file_id` varchar(64) DEFAULT NULL,
UNIQUE KEY `load_test_file_unique_key` (`test_id`, `file_id`) UNIQUE KEY `api_test_file_unique_key` (`test_id`, `file_id`)
) )
ENGINE = InnoDB ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='功能测试和文件的关联表'; DEFAULT CHARSET = utf8mb4 COMMENT ='Api test test file relevance table';
CREATE TABLE IF NOT EXISTS `fuc_test_report` ( CREATE TABLE IF NOT EXISTS `api_test_report` (
`id` varchar(50) NOT NULL COMMENT 'Test report ID', `id` varchar(50) NOT NULL COMMENT 'Test report ID',
`test_id` varchar(50) NOT NULL COMMENT 'Test ID this test report belongs to', `test_id` varchar(50) NOT NULL COMMENT 'Test ID this test report belongs to',
`name` varchar(64) NOT NULL COMMENT 'Test report name', `name` varchar(64) NOT NULL COMMENT 'Test report name',
@ -222,7 +222,7 @@ CREATE TABLE IF NOT EXISTS `fuc_test_report` (
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin; COLLATE = utf8mb4_bin;
-- funcional end -- api end
-- track start -- track start

View File

@ -46,10 +46,12 @@
<!--要生成的数据库表 --> <!--要生成的数据库表 -->
<!--<table tableName="test_plan"/>--> <table tableName="api_test"/>
<table tableName="test_case_node"> <table tableName="api_test_file"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/> <table tableName="api_test_report"/>
</table> <!--<table tableName="test_case_node">-->
<!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
<!--</table>-->
<!--<table tableName="test_case"/>--> <!--<table tableName="test_case"/>-->
<!--<table tableName="test_plan_test_case"/>--> <!--<table tableName="test_plan_test_case"/>-->

View File

@ -15,11 +15,11 @@
import HeaderMenus from "../common/head/HeaderMenus"; import HeaderMenus from "../common/head/HeaderMenus";
export default { export default {
name: "FunctionalTest", name: "ApiTest",
components: {HeaderMenus}, components: {HeaderMenus},
data() { data() {
return { return {
beaseUrl: "functional" beaseUrl: "api"
} }
} }
} }

View File

@ -1,13 +1,13 @@
<template> <template>
<div> <div>
<h1>功能测试首页</h1> <h1>API测试首页</h1>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "PerformanceTestHome" name: "ApiTestHome"
} }
</script> </script>

View File

@ -6,7 +6,7 @@
</div> </div>
<el-menu-item :key="p.id" v-for="p in recentProjects" <el-menu-item :key="p.id" v-for="p in recentProjects"
:index="'/functional/' + p.id" :route="{name:'fucPlan', params:{projectId:p.id, projectName:p.name}}"> :index="'/api/' + p.id" :route="{name:'fucPlan', params:{projectId:p.id, projectName:p.name}}">
{{ p.name }} {{ p.name }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
@ -18,7 +18,7 @@
import {hasRoles} from "../../../../common/utils"; import {hasRoles} from "../../../../common/utils";
export default { export default {
name: "FunctionalRecentProject", name: "ApiRecentProject",
mounted() { mounted() {
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) { if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {

View File

@ -5,7 +5,7 @@
{{$t('load_test.recent')}} {{$t('load_test.recent')}}
</div> </div>
<el-menu-item :key="p.id" v-for="p in recentReports" <el-menu-item :key="p.id" v-for="p in recentReports"
:index="'/functional/report/view/' + p.id" :route="{path: '/functional/report/view/' + p.id}"> :index="'/api/report/view/' + p.id" :route="{path: '/api/report/view/' + p.id}">
{{ p.name }} {{ p.name }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
@ -15,13 +15,13 @@
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/constants"; import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/constants";
export default { export default {
name: "FunctionalRecentReport", name: "ApiRecentReport",
mounted() { mounted() {
const rolesString = localStorage.getItem("roles"); const rolesString = localStorage.getItem("roles");
const roles = rolesString.split(','); const roles = rolesString.split(',');
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) { if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
this.$get('/functional/report/recent/5', (response) => { this.$get('/api/report/recent/5', (response) => {
this.recentReports = response.data; this.recentReports = response.data;
}); });
} }

View File

@ -52,7 +52,7 @@
import ResultDetails from './components/ResultDetails'; import ResultDetails from './components/ResultDetails';
export default { export default {
name: "FunctionalReportView", name: "ApiReportView",
components: { components: {
MsReportLogDetails, MsReportLogDetails,
ResultDetails ResultDetails
@ -68,7 +68,7 @@
methods: { methods: {
initBreadcrumb() { initBreadcrumb() {
if(this.reportId){ if(this.reportId){
this.result = this.$get("/functional/report/test/pro/info/" + this.reportId, res => { this.result = this.$get("/api/report/test/pro/info/" + this.reportId, res => {
let data = res.data; let data = res.data;
if(data){ if(data){
this.report = data; this.report = data;

View File

@ -81,15 +81,15 @@
<script> <script>
export default { export default {
name: "FunctionalTestReport", name: "ApiTestReport",
created: function () { created: function () {
this.initTableData(); this.initTableData();
}, },
data() { data() {
return { return {
result: {}, result: {},
queryPath: "/functional/report/list/all", queryPath: "/api/report/list/all",
deletePath: "/functional/report/delete/", deletePath: "/api/report/delete/",
condition: "", condition: "",
projectId: null, projectId: null,
tableData: [], tableData: [],
@ -131,7 +131,7 @@
}, },
handleEdit(report) { handleEdit(report) {
this.$router.push({ this.$router.push({
path: '/functional/report/view/' + report.id path: '/api/report/view/' + report.id
}) })
}, },
handleDelete(report) { handleDelete(report) {

View File

@ -4,7 +4,7 @@
<i class="el-icon-time"/> <i class="el-icon-time"/>
{{$t('load_test.recent')}} {{$t('load_test.recent')}}
</div> </div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/functional/test/edit/' + t.id"> <el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/api/edit/' + t.id">
{{ t.name }} {{ t.name }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
@ -15,11 +15,11 @@
import {hasRoles} from "../../../../common/utils"; import {hasRoles} from "../../../../common/utils";
export default { export default {
name: "PerformanceRecentTestPlan", name: "ApiRecentTestPlan",
mounted() { mounted() {
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) { if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
this.$get('/performance/recent/5', (response) => { this.$get('/api/recent/5', (response) => {
this.recentTestPlans = response.data; this.recentTestPlans = response.data;
}); });
} }

View File

@ -83,8 +83,8 @@
data() { data() {
return { return {
result: {}, result: {},
queryPath: "/functional/test/list", queryPath: "/api/list",
deletePath: "/functional/test/delete", deletePath: "/api/delete",
condition: "", condition: "",
projectId: null, projectId: null,
tableData: [], tableData: [],
@ -141,7 +141,7 @@
}, },
handleEdit(testPlan) { handleEdit(testPlan) {
this.$router.push({ this.$router.push({
path: '/functional/test/edit/' + testPlan.id, path: '/api/edit/' + testPlan.id,
}) })
}, },
handleDelete(testPlan) { handleDelete(testPlan) {

View File

@ -24,10 +24,10 @@
<el-tabs class="testplan-config" v-model="active" type="border-card" :stretch="true"> <el-tabs class="testplan-config" v-model="active" type="border-card" :stretch="true">
<el-tab-pane :label="$t('load_test.basic_config')"> <el-tab-pane :label="$t('load_test.basic_config')">
<functional-test-scene-config :test-plan="testPlan" /> <api-test-scene-config :test-plan="testPlan" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('load_test.runtime_config')"> <el-tab-pane :label="$t('load_test.runtime_config')">
<functional-test-runtime-config :test-plan="testPlan" ref="runtimeConfig"/> <api-test-runtime-config :test-plan="testPlan" ref="runtimeConfig"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
@ -36,33 +36,33 @@
</template> </template>
<script> <script>
import FunctionalTestSceneConfig from './components/FunctionalTestSceneConfig'; import ApiTestSceneConfig from './components/ApiTestSceneConfig';
import FunctionalTestRuntimeConfig from './components/FunctionalTestRuntimeConfig'; import ApiTestRuntimeConfig from './components/ApiTestRuntimeConfig';
export default { export default {
name: "EditFunctionalTestPlan", name: "EditApiTestPlan",
components: { components: {
FunctionalTestSceneConfig, ApiTestSceneConfig,
FunctionalTestRuntimeConfig, ApiTestRuntimeConfig,
}, },
data() { data() {
return { return {
result: {}, result: {},
testPlan: {}, testPlan: {},
listProjectPath: "/project/listAll", listProjectPath: "/project/listAll",
savePath: "/functional/test/save", savePath: "/api/save",
editPath: "/functional/test/edit", editPath: "/api/edit",
runPath: "/functional/test/run", runPath: "/api/run",
projects: [], projects: [],
active: '0', active: '0',
tabs: [{ tabs: [{
title: this.$t('load_test.basic_config'), title: this.$t('load_test.basic_config'),
id: '0', id: '0',
component: 'FunctionalTestSceneConfig' component: 'ApiTestSceneConfig'
}, { }, {
title: this.$t('load_test.runtime_config'), title: this.$t('load_test.runtime_config'),
id: '1', id: '1',
component: 'FunctionalTestRuntimeConfig' component: 'ApiTestRuntimeConfig'
}] }]
} }
}, },
@ -75,7 +75,7 @@
} }
let testId = to.path.split('/')[4]; // find testId let testId = to.path.split('/')[4]; // find testId
if (testId) { if (testId) {
this.$get('/functional/test/get/' + testId, response => { this.$get('/api/get/' + testId, response => {
this.testPlan = response.data; this.testPlan = response.data;
}); });
} }
@ -85,7 +85,7 @@
created() { created() {
let testId = this.$route.path.split('/')[4]; let testId = this.$route.path.split('/')[4];
if (testId) { if (testId) {
this.$get('/functional/test/get/' + testId, response => { this.$get('/api/get/' + testId, response => {
this.testPlan = response.data; this.testPlan = response.data;
}); });
} }
@ -111,7 +111,7 @@
type: 'success' type: 'success'
}); });
this.$refs.runtimeConfig.cancelAllEdit(); this.$refs.runtimeConfig.cancelAllEdit();
this.$router.push({path: '/functional/test/all'}) this.$router.push({path: '/api/test/all'})
}); });
}, },
saveAndRun() { saveAndRun() {
@ -165,7 +165,7 @@
}; };
}, },
cancel() { cancel() {
this.$router.push({path: '/functional/test/all'}) this.$router.push({path: '/api/test/all'})
}, },
validTestPlan() { validTestPlan() {
if (!this.testPlan.name) { if (!this.testPlan.name) {

View File

@ -42,7 +42,7 @@
<script> <script>
export default { export default {
name: "FunctionalTestRuntimeConfig", name: "ApiTestRuntimeConfig",
data() { data() {
return { return {
resourcePool: { resourcePool: {
@ -86,7 +86,7 @@
methods: { methods: {
validConfig() { validConfig() {
if (this.resourcePool.value == '') { if (this.resourcePool.value == '') {
this.$message.error(this.$t('fuc_test.select_resource_pool')); this.$message.error(this.$t('api_test.select_resource_pool'));
return false; return false;
} }
return true; return true;

View File

@ -58,14 +58,14 @@
import {Message} from "element-ui"; import {Message} from "element-ui";
export default { export default {
name: "FunctionalTestSceneConfig", name: "ApiTestSceneConfig",
props: ["testPlan"], props: ["testPlan"],
data() { data() {
return { return {
result: {}, result: {},
getFileMetadataPath: "/functional/test/file/metadata", getFileMetadataPath: "/api/file/metadata",
jmxDownloadPath: '/functional/test/file/download', jmxDownloadPath: '/api/file/download',
jmxDeletePath: '/functional/test/file/delete', jmxDeletePath: '/api/file/delete',
fileList: [], fileList: [],
tableData: [], tableData: [],
}; };

View File

@ -11,7 +11,7 @@
index="3" popper-class="submenu" v-permission="['test_manager']" > index="3" popper-class="submenu" v-permission="['test_manager']" >
<template v-slot:title>{{$t('commons.project')}}</template> <template v-slot:title>{{$t('commons.project')}}</template>
<performance-recent-project v-if="beaseUrl == 'performance'"/> <performance-recent-project v-if="beaseUrl == 'performance'"/>
<functional-recent-project v-if="beaseUrl == 'functional'"/> <api-recent-project v-if="beaseUrl == 'api'"/>
<track-recent-project v-if="beaseUrl == 'tack'"/> <track-recent-project v-if="beaseUrl == 'tack'"/>
<el-divider/> <el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/project/all'"> <el-menu-item :index="'/' + beaseUrl + '/project/all'">
@ -23,11 +23,11 @@
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')" <el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'api')"
index="4" popper-class="submenu" v-permission="['test_manager', 'test_user']"> index="4" popper-class="submenu" v-permission="['test_manager', 'test_user']">
<template v-slot:title>{{$t('commons.test')}}</template> <template v-slot:title>{{$t('commons.test')}}</template>
<performance-recent-test-plan v-if="beaseUrl == 'performance'"/> <performance-recent-test-plan v-if="beaseUrl == 'performance'"/>
<functional-recent-test-plan v-if="beaseUrl == 'functional'"/> <api-recent-test-plan v-if="beaseUrl == 'api'"/>
<el-divider/> <el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/test/all'"> <el-menu-item :index="'/' + beaseUrl + '/test/all'">
<font-awesome-icon :icon="['fa', 'list-ul']"/> <font-awesome-icon :icon="['fa', 'list-ul']"/>
@ -38,11 +38,11 @@
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')" <el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'api')"
index="5" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']"> index="5" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
<template v-slot:title>{{$t('commons.report')}}</template> <template v-slot:title>{{$t('commons.report')}}</template>
<performance-recent-report v-if="beaseUrl == 'performance'"/> <performance-recent-report v-if="beaseUrl == 'performance'"/>
<functional-recent-report v-if="beaseUrl == 'functional'"/> <api-recent-report v-if="beaseUrl == 'api'"/>
<el-divider/> <el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/report/all'"> <el-menu-item :index="'/' + beaseUrl + '/report/all'">
<font-awesome-icon :icon="['fa', 'list-ul']"/> <font-awesome-icon :icon="['fa', 'list-ul']"/>
@ -77,7 +77,7 @@
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<router-link v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')" <router-link v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'api')"
class="header-bottom" :to="'/' + beaseUrl + '/test/create'" v-permission="['test_user','test_manager']"> class="header-bottom" :to="'/' + beaseUrl + '/test/create'" v-permission="['test_user','test_manager']">
<el-button type="primary" size="small">{{$t('load_test.create')}}</el-button> <el-button type="primary" size="small">{{$t('load_test.create')}}</el-button>
</router-link> </router-link>
@ -90,19 +90,19 @@
<script> <script>
import PerformanceRecentTestPlan from "../../performance/test/PerformanceRecentTestPlan"; import PerformanceRecentTestPlan from "../../performance/test/PerformanceRecentTestPlan";
import FunctionalRecentTestPlan from "../../functional/test/FunctionalRecentTestPlan"; import ApiRecentTestPlan from "../../api/test/ApiRecentTestPlan";
import PerformanceRecentProject from "../../performance/project/PerformanceRecentProject"; import PerformanceRecentProject from "../../performance/project/PerformanceRecentProject";
import FunctionalRecentProject from "../../functional/project/FunctionalRecentProject"; import ApiRecentProject from "../../api/project/ApiRecentProject";
import PerformanceRecentReport from "../../performance/report/PerformanceRecentReport"; import PerformanceRecentReport from "../../performance/report/PerformanceRecentReport";
import FunctionalRecentReport from "../../functional/report/FunctionalRecentReport"; import ApiRecentReport from "../../api/report/ApiRecentReport";
import {checkoutCurrentWorkspace} from "../../../../common/utils"; import {checkoutCurrentWorkspace} from "../../../../common/utils";
import TrackRecentProject from "../../track/project/TrackRecentProject"; import TrackRecentProject from "../../track/project/TrackRecentProject";
import RecentCasePlan from "../../track/case/RecentCasePlan"; import RecentCasePlan from "../../track/case/RecentCasePlan";
export default { export default {
name: "MsMenus", name: "MsMenus",
components: {PerformanceRecentReport, PerformanceRecentTestPlan, FunctionalRecentTestPlan, FunctionalRecentReport, components: {PerformanceRecentReport, PerformanceRecentTestPlan, ApiRecentTestPlan, ApiRecentReport,
PerformanceRecentProject, FunctionalRecentProject, TrackRecentProject, RecentCasePlan}, PerformanceRecentProject, ApiRecentProject, TrackRecentProject, RecentCasePlan},
data() { data() {
return { return {
isCurrentWorkspaceUser: false, isCurrentWorkspaceUser: false,

View File

@ -11,8 +11,8 @@
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
{{$t('test_track.test_track')}} {{$t('test_track.test_track')}}
</el-menu-item> </el-menu-item>
<el-menu-item index="/functional" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/api" v-permission="['test_manager','test_user','test_viewer']">
{{$t('commons.functional')}} {{$t('commons.api')}}
</el-menu-item> </el-menu-item>
<el-menu-item index="/performance" onselectstart="return false" <el-menu-item index="/performance" onselectstart="return false"
v-permission="['test_manager','test_user','test_viewer']"> v-permission="['test_manager','test_user','test_viewer']">

View File

@ -15,15 +15,15 @@ import PersonSetting from "../../settings/personal/PersonSetting";
import SystemWorkspace from "../../settings/system/SystemWorkspace"; import SystemWorkspace from "../../settings/system/SystemWorkspace";
import PerformanceChart from "../../performance/report/components/PerformanceChart"; import PerformanceChart from "../../performance/report/components/PerformanceChart";
import PerformanceTestReport from "../../performance/report/PerformanceTestReport"; import PerformanceTestReport from "../../performance/report/PerformanceTestReport";
import FunctionalTestReport from "../../functional/report/FunctionalTestReport"; import ApiTestReport from "../../api/report/ApiTestReport";
import FunctionalTest from "../../functional/FunctionalTest"; import ApiTest from "../../api/ApiTest";
import PerformanceTest from "../../performance/PerformanceTest"; import PerformanceTest from "../../performance/PerformanceTest";
import EditFunctionalTestPlan from "../../functional/test/EditFunctionalTestPlan"; import EditApiTestPlan from "../../api/test/EditApiTestPlan";
import PerformanceTestHome from "../../performance/home/PerformanceTestHome"; import PerformanceTestHome from "../../performance/home/PerformanceTestHome";
import FunctionalTestPlan from "../../functional/test/FunctionalTestPlan"; import ApiTestPlan from "../../api/test/ApiTestPlan";
import FunctionalTestHome from "../../functional/home/FunctionalTestHome"; import ApiTestHome from "../../api/home/ApiTestHome";
import PerformanceReportView from "../../performance/report/PerformanceReportView"; import PerformanceReportView from "../../performance/report/PerformanceReportView";
import FunctionalReportView from "../../functional/report/FunctionalReportView"; import ApiReportView from "../../api/report/ApiReportView";
import TrackHome from "../../track/home/TrackHome"; import TrackHome from "../../track/home/TrackHome";
import TestPlan from "../../track/plan/TestPlan"; import TestPlan from "../../track/plan/TestPlan";
import TestPlanView from "../../track/plan/TestPlanView"; import TestPlanView from "../../track/plan/TestPlanView";
@ -82,27 +82,27 @@ const router = new VueRouter({
] ]
}, },
{ {
path: "/functional", path: "/api",
name: "functional", name: "api",
redirect: "/functional/home", redirect: "/api/home",
components: { components: {
content: FunctionalTest content: ApiTest
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
name: 'fucHome', name: 'fucHome',
component: FunctionalTestHome, component: ApiTestHome,
}, },
{ {
path: 'test/create', path: 'test/create',
name: "createFucTest", name: "createFucTest",
component: EditFunctionalTestPlan, component: EditApiTestPlan,
}, },
{ {
path: "test/edit/:testId", path: "test/edit/:testId",
name: "editFucTest", name: "editFucTest",
component: EditFunctionalTestPlan, component: EditApiTestPlan,
props: { props: {
content: (route) => { content: (route) => {
return { return {
@ -114,7 +114,7 @@ const router = new VueRouter({
{ {
path: "test/:projectId", path: "test/:projectId",
name: "fucPlan", name: "fucPlan",
component: FunctionalTestPlan component: ApiTestPlan
}, },
{ {
path: "project/:type", path: "project/:type",
@ -124,12 +124,12 @@ const router = new VueRouter({
{ {
path: "report/:type", path: "report/:type",
name: "fucReport", name: "fucReport",
component: FunctionalTestReport component: ApiTestReport
}, },
{ {
path: "report/view/:reportId", path: "report/view/:reportId",
name: "fucReportView", name: "fucReportView",
component: FunctionalReportView component: ApiReportView
} }
] ]
}, },

View File

@ -38,7 +38,7 @@ export default {
'personal_setting': 'Personal Setting', 'personal_setting': 'Personal Setting',
'test_resource_pool': 'Resource Pool', 'test_resource_pool': 'Resource Pool',
'system_setting': 'Settings', 'system_setting': 'Settings',
'functional': 'Functional', 'api': 'Api',
'performance': 'Performance', 'performance': 'Performance',
'interface': 'Interface test', 'interface': 'Interface test',
'input_content': 'Please enter content', 'input_content': 'Please enter content',
@ -167,7 +167,7 @@ export default {
'select_resource_pool': 'Please Select Resource Pool', 'select_resource_pool': 'Please Select Resource Pool',
'resource_pool_is_null': 'Resource Pool is empty', 'resource_pool_is_null': 'Resource Pool is empty',
}, },
fuc_test: { api_test: {
'select_resource_pool': 'Please select resource pool' 'select_resource_pool': 'Please select resource pool'
}, },
test_track: { test_track: {

View File

@ -38,7 +38,7 @@ export default {
'personal_setting': '个人设置', 'personal_setting': '个人设置',
'test_resource_pool': '测试资源池', 'test_resource_pool': '测试资源池',
'system_setting': '系统设置', 'system_setting': '系统设置',
'functional': '功能测试', 'api': '接口测试',
'performance': '性能测试', 'performance': '性能测试',
'interface': '接口测试', 'interface': '接口测试',
'input_content': '请输入内容', 'input_content': '请输入内容',
@ -167,7 +167,7 @@ export default {
'select_resource_pool': '请选择资源池', 'select_resource_pool': '请选择资源池',
'resource_pool_is_null': '资源池为空', 'resource_pool_is_null': '资源池为空',
}, },
fuc_test: { api_test: {
'select_resource_pool': '请选择资源池' 'select_resource_pool': '请选择资源池'
}, },
test_track: { test_track: {