fix: 解决冲突

This commit is contained in:
chenjianxing 2020-12-22 17:35:29 +08:00
commit 9ecb428004
84 changed files with 1164 additions and 2033 deletions

View File

@ -3,12 +3,12 @@ package io.metersphere.api.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.*;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult;
import io.metersphere.api.dto.dataCount.request.ScheduleInfoRequest;
import io.metersphere.api.dto.dataCount.response.ApiDataCountDTO;
import io.metersphere.api.dto.dataCount.response.ExecutedCaseInfoDTO;
import io.metersphere.api.dto.dataCount.response.TaskInfoResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult;
import io.metersphere.api.dto.datacount.request.ScheduleInfoRequest;
import io.metersphere.api.dto.datacount.response.ApiDataCountDTO;
import io.metersphere.api.dto.datacount.response.ExecutedCaseInfoDTO;
import io.metersphere.api.dto.datacount.response.TaskInfoResult;
import io.metersphere.api.dto.scenario.request.dubbo.RegistryCenter;
import io.metersphere.api.service.*;
import io.metersphere.base.domain.ApiTest;

View File

@ -1,56 +0,0 @@
package io.metersphere.api.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.automation.ApiTagRequest;
import io.metersphere.api.dto.automation.SaveApiTagRequest;
import io.metersphere.api.service.ApiTagService;
import io.metersphere.base.domain.ApiTag;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "/api/tag")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR)
public class ApiTagController {
@Resource
ApiTagService apiTagService;
@PostMapping("/list")
public List<ApiTag> list(@RequestBody ApiTagRequest request) {
return apiTagService.list(request);
}
@PostMapping("/getTgas/{goPage}/{pageSize}")
public Pager<List<ApiTag>> getTgas(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTagRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, apiTagService.getTgas(request));
}
@PostMapping(value = "/create")
public void create(@RequestBody SaveApiTagRequest request) {
apiTagService.create(request);
}
@PostMapping(value = "/update")
public void update(@RequestBody SaveApiTagRequest request) {
apiTagService.update(request);
}
@GetMapping("/delete/{id}")
public void delete(@PathVariable String id) {
apiTagService.delete(id);
}
}

View File

@ -13,7 +13,7 @@ public class SaveApiScenarioRequest {
private String projectId;
private String tagId;
private String tags;
private String userId;

View File

@ -1,4 +1,4 @@
package io.metersphere.api.dto.dataCount;
package io.metersphere.api.dto.datacount;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,4 +1,4 @@
package io.metersphere.api.dto.dataCount;
package io.metersphere.api.dto.datacount;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,4 +1,4 @@
package io.metersphere.api.dto.dataCount.request;
package io.metersphere.api.dto.datacount.request;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,14 +1,11 @@
package io.metersphere.api.dto.dataCount.response;
package io.metersphere.api.dto.datacount.response;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.scenario.request.RequestType;
import io.metersphere.base.domain.ApiDefinition;
import io.metersphere.commons.constants.APITestStatus;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Locale;
/**
* 接口数据统计返回
@ -118,7 +115,7 @@ public class ApiDataCountDTO {
/**
* 对Protocal视角对查询结果进行统计
* @param countResultList
* @param countResultList 查询参数
*/
public void countProtocal(List<ApiDataCountResult> countResultList){
for (ApiDataCountResult countResult :
@ -146,16 +143,17 @@ public class ApiDataCountDTO {
/**
* 对Status视角对查询结果进行统计
* @param countResultList
* @param countResultList 查询参数
*/
public void countStatus(List<ApiDataCountResult> countResultList){
for (ApiDataCountResult countResult :
countResultList) {
if("Underway".equals(countResult.getGroupField())){
//未开始
this.runningCount+= countResult.getCountNumber();
}else if("Completed".equals(countResult.getGroupField())){
this.finishedCount+= countResult.getCountNumber();
}else if("Trash".equals(countResult.getGroupField())){
}else if("Prepare".equals(countResult.getGroupField())){
this.notStartedCount+= countResult.getCountNumber();
}
}

View File

@ -1,4 +1,4 @@
package io.metersphere.api.dto.dataCount.response;
package io.metersphere.api.dto.datacount.response;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,8 +1,7 @@
package io.metersphere.api.dto.dataCount.response;
package io.metersphere.api.dto.datacount.response;
import lombok.Getter;
import lombok.Setter;
import org.python.antlr.ast.Str;
/**
* 任务信息 返回DTO

View File

@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import io.metersphere.api.dto.APIReportResult;
import io.metersphere.api.dto.DeleteAPIReportRequest;
import io.metersphere.api.dto.QueryAPIReportRequest;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.jmeter.TestResult;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiDataViewMapper;

View File

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.client.utils.StringUtils;
import io.github.ningyu.jmeter.plugin.dubbo.sample.ProviderService;
import io.metersphere.api.dto.*;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.parse.ApiImport;
import io.metersphere.api.dto.scenario.request.dubbo.RegistryCenter;
import io.metersphere.api.jmeter.JMeterService;

View File

@ -5,9 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import io.metersphere.api.dto.automation.*;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.RunDefinitionRequest;
import io.metersphere.api.dto.definition.request.*;
import io.metersphere.api.dto.scenario.KeyValue;
@ -15,7 +14,6 @@ import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
import io.metersphere.api.jmeter.JMeterService;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiScenarioMapper;
import io.metersphere.base.mapper.ApiTagMapper;
import io.metersphere.base.mapper.ext.ExtApiScenarioMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanScenarioCaseMapper;
@ -56,8 +54,6 @@ public class ApiAutomationService {
@Resource
private ExtApiScenarioMapper extApiScenarioMapper;
@Resource
private ApiTagMapper apiTagMapper;
@Resource
private JMeterService jMeterService;
@Resource
private ApiTestEnvironmentService environmentService;
@ -71,33 +67,9 @@ public class ApiAutomationService {
public List<ApiScenarioDTO> list(ApiScenarioRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<ApiScenarioDTO> list = extApiScenarioMapper.list(request);
// buildScenarioInfo(request.getProjectId(), list); todo tag?
return list;
}
public void buildScenarioInfo(String projectId, List<ApiScenarioDTO> list) {
ApiTagExample example = new ApiTagExample();
example.createCriteria().andProjectIdEqualTo(projectId);
List<ApiTag> tags = apiTagMapper.selectByExample(example);
Map<String, String> tagMap = tags.stream().collect(Collectors.toMap(ApiTag::getId, ApiTag::getName));
Gson gs = new Gson();
list.forEach(item -> {
if (item.getTagId() != null) {
StringBuilder buf = new StringBuilder();
gs.fromJson(item.getTagId(), List.class).forEach(t -> {
buf.append(tagMap.get(t));
buf.append(",");
});
if (buf != null && buf.length() > 0) {
String tagNames = buf.toString().substring(0, buf.toString().length() - 1);
List<String> tagList = Arrays.asList(tagNames.split(","));
item.setTagNames(tagList);
} else {
item.setTagNames(new ArrayList<>());
}
}
});
}
public List<String> selectIdsNotExistsInPlan(String projectId, String planId) {
return extApiScenarioMapper.selectIdsNotExistsInPlan(projectId, planId);
@ -117,7 +89,7 @@ public class ApiAutomationService {
scenario.setId(request.getId());
scenario.setName(request.getName());
scenario.setProjectId(request.getProjectId());
scenario.setTagId(request.getTagId());
scenario.setTags(request.getTags());
scenario.setApiScenarioModuleId(request.getApiScenarioModuleId());
scenario.setModulePath(request.getModulePath());
scenario.setLevel(request.getLevel());
@ -154,7 +126,7 @@ public class ApiAutomationService {
scenario.setId(request.getId());
scenario.setName(request.getName());
scenario.setProjectId(request.getProjectId());
scenario.setTagId(request.getTagId());
scenario.setTags(request.getTags());
scenario.setApiScenarioModuleId(request.getApiScenarioModuleId());
scenario.setModulePath(request.getModulePath());
scenario.setLevel(request.getLevel());
@ -215,19 +187,6 @@ public class ApiAutomationService {
return new ArrayList<>();
}
public void deleteTag(String id) {
List<ApiScenarioWithBLOBs> list = extApiScenarioMapper.selectByTagId(id);
if (!list.isEmpty()) {
Gson gs = new Gson();
list.forEach(item -> {
List<String> tagIds = gs.fromJson(item.getTagId(), List.class);
tagIds.remove(id);
item.setTagId(JSON.toJSONString(tagIds));
apiScenarioMapper.updateByPrimaryKeySelective(item);
});
}
}
private void createAPIScenarioReportResult(String id, String triggerMode, String execType, String projectId) {
APIScenarioReportResult report = new APIScenarioReportResult();
report.setId(id);
@ -317,6 +276,7 @@ public class ApiAutomationService {
ParameterConfig config = new ParameterConfig();
config.setConfig(envConfig);
HashTree hashTree = request.getTestElement().generateHashTree(config);
request.getTestElement().getJmx(hashTree);
// 调用执行方法
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
createAPIScenarioReportResult(request.getId(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId());

View File

@ -1,7 +1,7 @@
package io.metersphere.api.service;
import com.alibaba.fastjson.JSON;
import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult;
import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult;
import io.metersphere.api.jmeter.TestResult;
import io.metersphere.base.domain.ApiDefinitionExecResult;
import io.metersphere.base.domain.ApiDefinitionExecResultExample;

View File

@ -6,7 +6,7 @@ import io.metersphere.api.dto.APIReportResult;
import io.metersphere.api.dto.ApiTestImportRequest;
import io.metersphere.api.dto.automation.ApiScenarioRequest;
import io.metersphere.api.dto.automation.ReferenceDTO;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.*;
import io.metersphere.api.dto.definition.parse.ApiDefinitionImport;
import io.metersphere.api.dto.scenario.request.RequestType;

View File

@ -1,77 +0,0 @@
package io.metersphere.api.service;
import io.metersphere.api.dto.automation.ApiTagRequest;
import io.metersphere.api.dto.automation.SaveApiTagRequest;
import io.metersphere.base.domain.ApiTag;
import io.metersphere.base.domain.ApiTagExample;
import io.metersphere.base.mapper.ApiTagMapper;
import io.metersphere.base.mapper.ext.ExtApiTagMapper;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.SessionUtils;
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 ApiTagService {
@Resource
private ApiTagMapper apiTagMapper;
@Resource
private ExtApiTagMapper extApiTagMapper;
@Resource
private ApiAutomationService apiAutomationService;
public List<ApiTag> list(ApiTagRequest request) {
ApiTagExample example = new ApiTagExample();
example.createCriteria().andProjectIdEqualTo(request.getProjectId());
return apiTagMapper.selectByExample(example);
}
public List<ApiTag> getTgas(ApiTagRequest request) {
return extApiTagMapper.list(request);
}
public void create(SaveApiTagRequest request) {
checkNameExist(request);
final ApiTag apiTag = new ApiTag();
apiTag.setId(request.getId());
apiTag.setName(request.getName());
apiTag.setProjectId(request.getProjectId());
apiTag.setCreateTime(System.currentTimeMillis());
apiTag.setUpdateTime(System.currentTimeMillis());
if (request.getUserId() == null) {
apiTag.setUserId(SessionUtils.getUserId());
} else {
apiTag.setUserId(request.getUserId());
}
apiTagMapper.insert(apiTag);
}
public void update(SaveApiTagRequest request) {
checkNameExist(request);
final ApiTag apiTag = new ApiTag();
apiTag.setId(request.getId());
apiTag.setName(request.getName());
apiTag.setProjectId(request.getProjectId());
apiTag.setUpdateTime(System.currentTimeMillis());
apiTag.setUserId(request.getUserId());
apiTagMapper.updateByPrimaryKeySelective(apiTag);
}
public void delete(String id) {
apiTagMapper.deleteByPrimaryKey(id);
apiAutomationService.deleteTag(id);
}
private void checkNameExist(SaveApiTagRequest request) {
ApiTagExample example = new ApiTagExample();
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId())
.andIdNotEqualTo(request.getId());
if (apiTagMapper.countByExample(example) > 0) {
MSException.throwException("名称不能重复");
}
}
}

View File

@ -1,15 +1,12 @@
package io.metersphere.api.service;
import com.alibaba.fastjson.JSONObject;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.ApiTestCaseResult;
import io.metersphere.api.dto.definition.SaveApiTestCaseRequest;
import io.metersphere.api.dto.ApiCaseBatchRequest;
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.ApiTestCaseResult;
import io.metersphere.api.dto.definition.SaveApiTestCaseRequest;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiTestCaseMapper;
import io.metersphere.base.mapper.ApiTestFileMapper;

View File

@ -9,7 +9,7 @@ public class ApiScenario implements Serializable {
private String projectId;
private String tagId;
private String tags;
private String userId;

View File

@ -244,73 +244,73 @@ public class ApiScenarioExample {
return (Criteria) this;
}
public Criteria andTagIdIsNull() {
addCriterion("tag_id is null");
public Criteria andTagsIsNull() {
addCriterion("tags is null");
return (Criteria) this;
}
public Criteria andTagIdIsNotNull() {
addCriterion("tag_id is not null");
public Criteria andTagsIsNotNull() {
addCriterion("tags is not null");
return (Criteria) this;
}
public Criteria andTagIdEqualTo(String value) {
addCriterion("tag_id =", value, "tagId");
public Criteria andTagsEqualTo(String value) {
addCriterion("tags =", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdNotEqualTo(String value) {
addCriterion("tag_id <>", value, "tagId");
public Criteria andTagsNotEqualTo(String value) {
addCriterion("tags <>", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdGreaterThan(String value) {
addCriterion("tag_id >", value, "tagId");
public Criteria andTagsGreaterThan(String value) {
addCriterion("tags >", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdGreaterThanOrEqualTo(String value) {
addCriterion("tag_id >=", value, "tagId");
public Criteria andTagsGreaterThanOrEqualTo(String value) {
addCriterion("tags >=", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdLessThan(String value) {
addCriterion("tag_id <", value, "tagId");
public Criteria andTagsLessThan(String value) {
addCriterion("tags <", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdLessThanOrEqualTo(String value) {
addCriterion("tag_id <=", value, "tagId");
public Criteria andTagsLessThanOrEqualTo(String value) {
addCriterion("tags <=", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdLike(String value) {
addCriterion("tag_id like", value, "tagId");
public Criteria andTagsLike(String value) {
addCriterion("tags like", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdNotLike(String value) {
addCriterion("tag_id not like", value, "tagId");
public Criteria andTagsNotLike(String value) {
addCriterion("tags not like", value, "tags");
return (Criteria) this;
}
public Criteria andTagIdIn(List<String> values) {
addCriterion("tag_id in", values, "tagId");
public Criteria andTagsIn(List<String> values) {
addCriterion("tags in", values, "tags");
return (Criteria) this;
}
public Criteria andTagIdNotIn(List<String> values) {
addCriterion("tag_id not in", values, "tagId");
public Criteria andTagsNotIn(List<String> values) {
addCriterion("tags not in", values, "tags");
return (Criteria) this;
}
public Criteria andTagIdBetween(String value1, String value2) {
addCriterion("tag_id between", value1, value2, "tagId");
public Criteria andTagsBetween(String value1, String value2) {
addCriterion("tags between", value1, value2, "tags");
return (Criteria) this;
}
public Criteria andTagIdNotBetween(String value1, String value2) {
addCriterion("tag_id not between", value1, value2, "tagId");
public Criteria andTagsNotBetween(String value1, String value2) {
addCriterion("tags not between", value1, value2, "tags");
return (Criteria) this;
}

View File

@ -1,21 +0,0 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class ApiTag implements Serializable {
private String id;
private String projectId;
private String name;
private String userId;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -1,600 +0,0 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class ApiTagExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ApiTagExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -20,5 +20,7 @@ public class TestResourcePool implements Serializable {
private Long updateTime;
private String image;
private static final long serialVersionUID = 1L;
}

View File

@ -175,142 +175,142 @@ public class TestResourcePoolExample {
}
public Criteria andNameIsNull() {
addCriterion("name is null");
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
addCriterion("`type` like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
addCriterion("`type` not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
@ -385,72 +385,72 @@ public class TestResourcePoolExample {
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
@ -573,6 +573,76 @@ public class TestResourcePoolExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andImageIsNull() {
addCriterion("image is null");
return (Criteria) this;
}
public Criteria andImageIsNotNull() {
addCriterion("image is not null");
return (Criteria) this;
}
public Criteria andImageEqualTo(String value) {
addCriterion("image =", value, "image");
return (Criteria) this;
}
public Criteria andImageNotEqualTo(String value) {
addCriterion("image <>", value, "image");
return (Criteria) this;
}
public Criteria andImageGreaterThan(String value) {
addCriterion("image >", value, "image");
return (Criteria) this;
}
public Criteria andImageGreaterThanOrEqualTo(String value) {
addCriterion("image >=", value, "image");
return (Criteria) this;
}
public Criteria andImageLessThan(String value) {
addCriterion("image <", value, "image");
return (Criteria) this;
}
public Criteria andImageLessThanOrEqualTo(String value) {
addCriterion("image <=", value, "image");
return (Criteria) this;
}
public Criteria andImageLike(String value) {
addCriterion("image like", value, "image");
return (Criteria) this;
}
public Criteria andImageNotLike(String value) {
addCriterion("image not like", value, "image");
return (Criteria) this;
}
public Criteria andImageIn(List<String> values) {
addCriterion("image in", values, "image");
return (Criteria) this;
}
public Criteria andImageNotIn(List<String> values) {
addCriterion("image not in", values, "image");
return (Criteria) this;
}
public Criteria andImageBetween(String value1, String value2) {
addCriterion("image between", value1, value2, "image");
return (Criteria) this;
}
public Criteria andImageNotBetween(String value1, String value2) {
addCriterion("image not between", value1, value2, "image");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiScenario">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="tag_id" jdbcType="VARCHAR" property="tagId" />
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="api_scenario_module_id" jdbcType="VARCHAR" property="apiScenarioModuleId" />
<result column="module_path" jdbcType="VARCHAR" property="modulePath" />
@ -84,7 +84,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, tag_id, user_id, api_scenario_module_id, module_path, `name`, `level`,
id, project_id, tags, user_id, api_scenario_module_id, module_path, `name`, `level`,
`status`, principal, step_total, follow_people, schedule, create_time, update_time,
pass_rate, last_result, report_id
</sql>
@ -140,7 +140,7 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
insert into api_scenario (id, project_id, tag_id,
insert into api_scenario (id, project_id, tags,
user_id, api_scenario_module_id, module_path,
`name`, `level`, `status`,
principal, step_total, follow_people,
@ -148,7 +148,7 @@
pass_rate, last_result, report_id,
scenario_definition, description
)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tagId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{apiScenarioModuleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{principal,jdbcType=VARCHAR}, #{stepTotal,jdbcType=INTEGER}, #{followPeople,jdbcType=VARCHAR},
@ -166,8 +166,8 @@
<if test="projectId != null">
project_id,
</if>
<if test="tagId != null">
tag_id,
<if test="tags != null">
tags,
</if>
<if test="userId != null">
user_id,
@ -228,8 +228,8 @@
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="tagId != null">
#{tagId,jdbcType=VARCHAR},
<if test="tags != null">
#{tags,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
@ -299,8 +299,8 @@
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.tagId != null">
tag_id = #{record.tagId,jdbcType=VARCHAR},
<if test="record.tags != null">
tags = #{record.tags,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
@ -362,7 +362,7 @@
update api_scenario
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
tag_id = #{record.tagId,jdbcType=VARCHAR},
tags = #{record.tags,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
@ -388,7 +388,7 @@
update api_scenario
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
tag_id = #{record.tagId,jdbcType=VARCHAR},
tags = #{record.tags,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
@ -414,8 +414,8 @@
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="tagId != null">
tag_id = #{tagId,jdbcType=VARCHAR},
<if test="tags != null">
tags = #{tags,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
@ -474,7 +474,7 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
update api_scenario
set project_id = #{projectId,jdbcType=VARCHAR},
tag_id = #{tagId,jdbcType=VARCHAR},
tags = #{tags,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
@ -497,7 +497,7 @@
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiScenario">
update api_scenario
set project_id = #{projectId,jdbcType=VARCHAR},
tag_id = #{tagId,jdbcType=VARCHAR},
tags = #{tags,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},

View File

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

View File

@ -1,228 +0,0 @@
<?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">
<mapper namespace="io.metersphere.base.mapper.ApiTagMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTag">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, user_id, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTagExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_tag
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from api_tag
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_tag
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTagExample">
delete from api_tag
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTag">
insert into api_tag (id, project_id, `name`,
user_id, create_time, update_time
)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTag">
insert into api_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiTagExample" resultType="java.lang.Long">
select count(*) from api_tag
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_tag
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update api_tag
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiTag">
update api_tag
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTag">
update api_tag
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,13 +1,9 @@
package io.metersphere.base.mapper;
import io.metersphere.api.dto.dataCount.response.TaskInfoResult;
import io.metersphere.base.domain.Schedule;
import io.metersphere.base.domain.ScheduleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.python.antlr.ast.Str;
public interface ScheduleMapper {
long countByExample(ScheduleExample example);

View File

@ -9,6 +9,7 @@
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="image" jdbcType="VARCHAR" property="image" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -69,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, type, description, status, create_time, update_time
id, `name`, `type`, description, `status`, create_time, update_time, image
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultMap="BaseResultMap">
select
@ -102,12 +103,12 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestResourcePool">
insert into test_resource_pool (id, name, type,
description, status, create_time,
update_time)
insert into test_resource_pool (id, `name`, `type`,
description, `status`, create_time,
update_time, image)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
#{updateTime,jdbcType=BIGINT}, #{image,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResourcePool">
insert into test_resource_pool
@ -116,16 +117,16 @@
id,
</if>
<if test="name != null">
name,
`name`,
</if>
<if test="type != null">
type,
`type`,
</if>
<if test="description != null">
description,
</if>
<if test="status != null">
status,
`status`,
</if>
<if test="createTime != null">
create_time,
@ -133,6 +134,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="image != null">
image,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -156,6 +160,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="image != null">
#{image,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultType="java.lang.Long">
@ -171,16 +178,16 @@
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
@ -188,6 +195,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.image != null">
image = #{record.image,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -196,12 +206,13 @@
<update id="updateByExample" parameterType="map">
update test_resource_pool
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
update_time = #{record.updateTime,jdbcType=BIGINT},
image = #{record.image,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -210,16 +221,16 @@
update test_resource_pool
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
@ -227,17 +238,21 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="image != null">
image = #{image,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestResourcePool">
update test_resource_pool
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
set `name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=BIGINT},
image = #{image,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,9 +1,8 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult;
import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult;
import io.metersphere.base.domain.ApiDefinitionExecResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

View File

@ -32,7 +32,7 @@
WHERE testCase.project_id = #{projectId})
</select>
<select id="findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber" resultType="io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult">
<select id="findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber" resultType="io.metersphere.api.dto.datacount.ExecutedCaseInfoResult">
SELECT * FROM (
SELECT testCase.testCaseName AS caseName,testCase.testPlanName AS testPlan ,caseErrorCountData.dataCountNumber AS failureTimes,'apiCase' AS caseType
FROM (

View File

@ -1,11 +1,10 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.ApiComputeResult;
import io.metersphere.api.dto.definition.ApiDefinitionRequest;
import io.metersphere.api.dto.definition.ApiDefinitionResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

View File

@ -274,10 +274,10 @@
</foreach>
</update>
<select id="countProtocolByProjectID" resultType="io.metersphere.api.dto.dataCount.ApiDataCountResult">
<select id="countProtocolByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT protocol AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY protocol
</select>
<select id="countStateByProjectID" resultType="io.metersphere.api.dto.dataCount.ApiDataCountResult">
<select id="countStateByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT status AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY status
</select>
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">
@ -285,7 +285,7 @@
WHERE project_id = #{projectId}
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
</select>
<select id="countApiCoverageByProjectID" resultType="io.metersphere.api.dto.dataCount.ApiDataCountResult">
<select id="countApiCoverageByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT count(api.id) AS countNumber, if(test_case_api.api_definition_id is null,"uncoverage","coverage") AS groupField FROM api_definition api left Join (
SELECT DISTINCT api_definition_id FROM api_test_case
) test_case_api ON api.id = test_case_api.api_definition_id

View File

@ -2,7 +2,7 @@ package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.automation.ApiScenarioDTO;
import io.metersphere.api.dto.automation.ApiScenarioRequest;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.base.domain.ApiScenario;
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
import org.apache.ibatis.annotations.Param;

View File

@ -9,7 +9,7 @@
</resultMap>
<select id="list" resultMap="BaseResultMap">
select api_scenario.id, api_scenario.project_id, api_scenario.tag_id, api_scenario.user_id,
select api_scenario.id, api_scenario.project_id, api_scenario.tags, api_scenario.user_id,
api_scenario.api_scenario_module_id,api_scenario.module_path, api_scenario.name, api_scenario.level,
api_scenario.status, api_scenario.principal, api_scenario.step_total, api_scenario.follow_people,
api_scenario.last_result,api_scenario.pass_rate,api_scenario.report_id,
@ -68,7 +68,7 @@
</select>
<select id="selectByTagId" resultType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
select * from api_scenario where tag_id like CONCAT('%', #{id},'%')
select * from api_scenario where tags like CONCAT('%', #{id},'%')
</select>
<select id="selectIds" resultType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
@ -123,7 +123,7 @@
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
</select>
<select id="countRunResultByProjectID" resultType="io.metersphere.api.dto.dataCount.ApiDataCountResult">
<select id="countRunResultByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT count(id) AS countNumber, if(last_result is null,"notRun",last_result) AS groupField FROM api_scenario
WHERE project_id = #{0}
GROUP BY groupField

View File

@ -1,11 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.automation.ApiTagRequest;
import io.metersphere.base.domain.ApiTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtApiTagMapper {
List<ApiTag> list(@Param("request") ApiTagRequest request);
}

View File

@ -1,21 +0,0 @@
<?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">
<mapper namespace="io.metersphere.base.mapper.ext.ExtApiTagMapper">
<select id="list" resultType="io.metersphere.base.domain.ApiTag">
select * from api_tag
<where>
<if test="request.name != null">
and api_tag.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.projectId != null">
AND api_tag.project_id = #{request.projectId}
</if>
<if test="request.id != null">
AND api_tag.id = #{request.id}
</if>
<if test="request.userId != null">
AND api_tag.user_id = #{request.userId}
</if>
</where>
</select>
</mapper>

View File

@ -1,6 +1,6 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.ApiTestCaseResult;

View File

@ -2,11 +2,9 @@ package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.APIReportResult;
import io.metersphere.api.dto.QueryAPIReportRequest;
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
import io.metersphere.dto.ApiReportDTO;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.dto.DashboardTestDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

View File

@ -152,7 +152,7 @@
GROUP BY x
</select>
<select id="countByWorkspaceIdAndGroupGroupByExecuteResult" resultType="io.metersphere.api.dto.dataCount.ApiDataCountResult">
<select id="countByWorkspaceIdAndGroupGroupByExecuteResult" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT testReport.`status` AS groupField,COUNT(testReportDetail.report_id) AS countNumber
FROM api_test_report_detail testReportDetail
INNER JOIN `schedule` sch ON sch.resource_id = testReportDetail.test_id

View File

@ -1,10 +1,9 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.dataCount.response.TaskInfoResult;
import io.metersphere.api.dto.datacount.response.TaskInfoResult;
import io.metersphere.controller.request.QueryScheduleRequest;
import io.metersphere.dto.ScheduleDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

View File

@ -45,7 +45,7 @@
AND `group` = #{group}
AND create_time BETWEEN #{startTime} and #{endTime}
</select>
<select id="findRunningTaskInfoByWorkspaceID" resultType="io.metersphere.api.dto.dataCount.response.TaskInfoResult">
<select id="findRunningTaskInfoByWorkspaceID" resultType="io.metersphere.api.dto.datacount.response.TaskInfoResult">
SELECT apiTest.`name` AS scenario,sch.id AS taskID,sch.`value` AS rule,sch.`enable` AS `taskStatus`,u.`name` AS creator,sch.update_time AS updateTime
FROM api_test apiTest
INNER JOIN `schedule` sch ON apiTest.id = sch.resource_id

View File

@ -2,6 +2,7 @@ package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.Schedule;
import io.metersphere.controller.request.QueryScheduleRequest;
import io.metersphere.dto.ScheduleDao;
import io.metersphere.service.ScheduleService;
@ -22,4 +23,9 @@ public class ScheduleController {
return scheduleService.list(request);
}
@GetMapping("/findOne/{testId}/{group}")
public Schedule schedule(@PathVariable String testId,@PathVariable String group) {
Schedule schedule = scheduleService.getScheduleByResource(testId,group);
return schedule;
}
}

View File

@ -11,5 +11,5 @@ public class TestOverview {
private String avgResponseTime;
private String responseTime90;
private String avgBandwidth;
private String avgTransactions;
}

View File

@ -30,8 +30,8 @@ public abstract class AbstractEngine implements Engine {
protected Integer threadNum;
protected List<TestResource> resourceList;
private TestResourcePoolService testResourcePoolService;
private TestResourceService testResourceService;
private final TestResourcePoolService testResourcePoolService;
private final TestResourceService testResourceService;
public AbstractEngine() {
testResourcePoolService = CommonBeanFactory.getBean(TestResourcePoolService.class);
@ -62,6 +62,11 @@ public abstract class AbstractEngine implements Engine {
&& !ResourcePoolTypeEnum.NODE.name().equals(resourcePool.getType())) {
MSException.throwException("Invalid Resource Pool type.");
}
// image
String image = resourcePool.getImage();
if (StringUtils.isNotEmpty(image)) {
JMETER_IMAGE = image;
}
this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId());
if (CollectionUtils.isEmpty(this.resourceList)) {
MSException.throwException("Test Resource is empty");

View File

@ -193,11 +193,13 @@ public class ReportService {
public List<LogDetailDTO> getReportLogResource(String reportId) {
List<LogDetailDTO> result = new ArrayList<>();
List<String> resourceIds = extLoadTestReportMapper.selectResourceId(reportId);
resourceIds.forEach(resourceId -> {
List<String> resourceIdAndIndexes = extLoadTestReportMapper.selectResourceId(reportId);
resourceIdAndIndexes.forEach(resourceIdAndIndex -> {
LogDetailDTO detailDTO = new LogDetailDTO();
String[] split = StringUtils.split(resourceIdAndIndex, "_");
String resourceId = split[0];
TestResource testResource = testResourceService.getTestResource(resourceId);
detailDTO.setResourceId(resourceId);
detailDTO.setResourceId(resourceIdAndIndex);
if (testResource == null) {
detailDTO.setResourceName(resourceId);
result.add(detailDTO);

View File

@ -1,7 +1,7 @@
package io.metersphere.service;
import com.alibaba.fastjson.JSON;
import io.metersphere.api.dto.dataCount.response.TaskInfoResult;
import io.metersphere.api.dto.datacount.response.TaskInfoResult;
import io.metersphere.base.domain.Schedule;
import io.metersphere.base.domain.ScheduleExample;
import io.metersphere.base.domain.User;

View File

@ -16,7 +16,7 @@ CREATE TABLE `api_scenario` (
`follow_people` varchar(100) DEFAULT NULL COMMENT 'api scenario Follow people ',
`schedule` varchar(255) DEFAULT NULL COMMENT 'Test schedule (cron list)',
`scenario_definition` longtext COMMENT 'Test scenario_definition json',
`description` varchar(255) DEFAULT NULL COMMENT 'api scenario description',
`description` longtext DEFAULT NULL COMMENT 'api scenario description',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
`pass_rate` varchar(100) DEFAULT NULL,
@ -43,12 +43,13 @@ CREATE TABLE `api_scenario_report` (
`id` varchar(50) NOT NULL COMMENT 'Test report ID',
`project_id` varchar(50) NOT NULL COMMENT 'scenario ID this test report belongs to',
`name` varchar(64) NOT NULL COMMENT 'Test report name',
`description` varchar(255) DEFAULT NULL COMMENT 'Test report name',
`description` longtext DEFAULT NULL COMMENT 'Test report name',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
`status` varchar(64) NOT NULL COMMENT 'Status of this test run',
`user_id` varchar(64) DEFAULT NULL,
`trigger_mode` varchar(64) DEFAULT NULL,
`execute_type` varchar(200) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@ -57,14 +58,4 @@ CREATE TABLE `api_scenario_report_detail` (
`project_id` varchar(64) NOT NULL COMMENT 'scenario ID',
`content` longblob COMMENT 'Report Content',
PRIMARY KEY (`report_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `api_tag` (
`id` varchar(50) NOT NULL COMMENT 'Test ID',
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
`name` varchar(200) NOT NULL COMMENT 'api tag',
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View File

@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS `api_definition` (
`protocol` varchar(255) NOT NULL COMMENT 'request protocol',
`path` varchar(1000) DEFAULT NULL COMMENT 'request path',
`module_path` varchar(1000) COMMENT 'module path',
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
`description` longtext DEFAULT NULL COMMENT 'Test description',
`environment_id` varchar(50) DEFAULT NULL COMMENT 'environment id',
`request` longtext COMMENT 'request (JSON format)',
`response` longtext COMMENT 'request (JSON format)',
@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS `api_test_case` (
`name` varchar(64) NOT NULL COMMENT 'Test name',
`priority` varchar(64) NOT NULL COMMENT 'priority',
`api_definition_id` varchar(50) NOT NULL COMMENT 'api definition id',
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
`description` longtext DEFAULT NULL COMMENT 'Test description',
`request` longtext COMMENT 'request (JSON format)',
`response` longtext COMMENT 'response (JSON format)',
`create_user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
@ -59,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `api_definition_exec_result` (
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
`start_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`end_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
`create_time` bigint(13) NULL COMMENT 'Create time',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View File

@ -1 +0,0 @@
ALTER TABLE api_definition_exec_result ADD create_time BIGINT(13) NULL;

View File

@ -1,5 +1 @@
ALTER TABLE api_scenario_report ADD execute_type varchar(200) NULL;
ALTER TABLE api_definition MODIFY COLUMN description LONGTEXT NULL COMMENT 'Test description';
ALTER TABLE api_test_case MODIFY COLUMN description LONGTEXT NULL COMMENT 'Test case description';
ALTER TABLE api_scenario MODIFY COLUMN description LONGTEXT NULL COMMENT 'Api scenario description';
ALTER TABLE api_scenario_report MODIFY COLUMN description LONGTEXT NULL COMMENT 'Api scenario report description';
ALTER TABLE api_scenario CHANGE tag_id tags varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'tag list';

View File

@ -0,0 +1,2 @@
ALTER TABLE test_resource_pool
ADD image VARCHAR(100) NULL;

View File

@ -64,7 +64,7 @@
<!--要生成的数据库表 -->
<table tableName="test_plan_api_scenario"/>
<table tableName="api_scenario"/>
<!--<table tableName="test_plan_api_scenario"/>-->
<!--<table tableName="test_plan"/>-->
<!--<table tableName="api_scenario_report"/>-->

View File

@ -17,29 +17,30 @@
"@fortawesome/vue-fontawesome": "^0.1.9",
"axios": "^0.19.0",
"core-js": "^3.4.3",
"diffable-html": "^4.0.0",
"echarts": "^4.6.0",
"el-table-infinite-scroll": "^1.0.10",
"element-ui": "^2.13.0",
"html2canvas": "^1.0.0-rc.7",
"js-base64": "^3.4.4",
"json-bigint": "^1.0.0",
"jsoneditor": "^9.1.2",
"jspdf": "^2.1.1",
"md5": "^2.3.0",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"sha.js": "^2.4.11",
"vue": "^2.6.10",
"vue-calendar-heatmap": "^0.8.4",
"vue-echarts": "^4.1.0",
"vue-i18n": "^8.15.3",
"vue-input-tag": "^2.0.7",
"vue-pdf": "^4.2.0",
"vue-router": "^3.1.3",
"vuedraggable": "^2.23.2",
"vuex": "^3.1.2",
"vue-calendar-heatmap": "^0.8.4",
"mockjs": "^1.1.0",
"md5": "^2.3.0",
"sha.js": "^2.4.11",
"js-base64": "^3.4.4",
"json-bigint": "^1.0.0",
"html2canvas": "^1.0.0-rc.7",
"jspdf": "^2.1.1",
"yan-progress": "^1.0.3",
"nprogress": "^0.2.0",
"el-table-infinite-scroll": "^1.0.10",
"vue-pdf": "^4.2.0",
"diffable-html": "^4.0.0",
"xml-js": "^1.6.11",
"jsoneditor": "^9.1.2"
"yan-progress": "^1.0.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",

View File

@ -73,7 +73,6 @@
methods: {
active() {
this.isActive = !this.isActive;
console.log(this.request)
//this.$emit("requestResult", {request: this.request, scenarioName: this.scenarioName});
}
},

View File

@ -59,7 +59,6 @@
methods: {
active() {
this.isActive = !this.isActive;
console.log(this.request)
//this.$emit("requestResult", {request: this.request, scenarioName: this.scenarioName});
}
},

View File

@ -1,126 +0,0 @@
<template>
<el-dialog :close-on-click-modal="false" :title="$t('api_test.automation.create_tag')" :visible.sync="visible"
width="45%"
:destroy-on-close="true">
<el-form :model="tagForm" label-position="right" label-width="80px" size="small" :rules="rule" ref="tagForm">
<el-form-item :label="$t('commons.name')" prop="name">
<el-row>
<el-col :span="20">
<el-input v-model="tagForm.name" autocomplete="off" :placeholder="$t('commons.name')"/>
</el-col>
<el-col :span="4">
<el-button style="margin-left: 20px" @click="saveTag">{{$t('commons.save')}}</el-button>
</el-col>
</el-row>
</el-form-item>
</el-form>
<el-table :data="tagData" row-key="id">
<el-table-column prop="name" :label="$t('commons.name')" show-overflow-tooltip/>
<el-table-column :label="$t('commons.operating')" min-width="130" align="center">
<template v-slot:default="scope">
<el-button type="text" @click="editApi(scope.row)">{{$t('commons.edit')}}</el-button>
<el-button type="text" @click="handleDelete(scope.row)" style="color: #F56C6C">{{$t('commons.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<template v-slot:footer>
<ms-dialog-footer
@cancel="confirm"
@confirm="confirm">
</ms-dialog-footer>
</template>
</el-dialog>
</template>
<script>
import {WORKSPACE_ID} from '@/common/js/constants';
import {getCurrentUser, getUUID, getCurrentProjectID} from "@/common/js/utils";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import MsTablePagination from "../../../common/pagination/TablePagination";
export default {
name: "MsAddTag",
components: {MsDialogFooter, MsTablePagination},
props: {},
data() {
return {
tagForm: {},
visible: false,
currentModule: {},
projectId: "",
userOptions: [],
currentPage: 1,
pageSize: 10,
total: 0,
tagData: [],
path: "/api/tag/create",
rule: {
name: [
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
{max: 50, message: this.$t('test_track.length_less_than') + '50', trigger: 'blur'}
],
principal: [{
required: true,
message: this.$t('api_test.automation.scenario.select_principal'),
trigger: 'change'
}],
},
}
},
methods: {
saveTag() {
if (this.tagForm.id != undefined && this.tagForm.id != null) {
this.path = "/api/tag/update";
} else {
this.path = "/api/tag/create";
this.tagForm.id = getUUID();
}
this.$refs['tagForm'].validate((valid) => {
if (valid) {
this.setParameter();
this.result = this.$post(this.path, this.tagForm, () => {
this.$success(this.$t('commons.save_success'));
this.initTable();
this.tagForm = {};
});
} else {
return false;
}
})
},
setParameter() {
this.tagForm.projectId = this.projectId;
},
open() {
this.projectId = getCurrentProjectID();
this.visible = true;
this.initTable();
},
initTable() {
let condition = {};
condition.projectId = this.projectId;
this.result = this.$post("/api/tag/getTgas/" + this.currentPage + "/" + this.pageSize, condition, response => {
this.total = response.data.itemCount;
this.tagData = response.data.listObject;
});
},
editApi(row) {
this.tagForm = row;
},
handleDelete(row) {
this.result = this.$get("/api/tag/delete/" + row.id, response => {
this.$success(this.$t('commons.delete_success'));
this.initTable();
});
},
confirm() {
this.visible = false
this.$emit('refreshTags');
}
}
}
</script>

View File

@ -2,18 +2,18 @@
<div v-loading="loading">
<el-card>
<el-row>
<div class="el-step__icon is-text ms-api-col" v-if="request.referenced!=undefined && request.referenced==='Deleted' || request.referenced=='REF'">
<div class="el-step__icon is-text ms-api-col" v-if="request.referenced!=undefined && request.referenced==='Deleted' || request.referenced=='REF' || request.referenced==='Copy'">
<div class="el-step__icon-inner">{{request.index}}</div>
</div>
<div class="el-step__icon is-text ms-api-col-create" v-else>
<div class="el-step__icon-inner">{{request.index}}</div>
</div>
<el-button v-if="request.referenced!=undefined && request.referenced==='Deleted' || request.referenced=='REF'" class="ms-left-buttion" size="small">
<el-button v-if="request.referenced!=undefined && request.referenced==='Deleted' || request.referenced=='REF' || request.referenced==='Copy'" class="ms-left-buttion" size="small">
{{$t('api_test.automation.api_list_import')}}
</el-button>
<el-button v-if="request.referenced==undefined || request.referenced==='Created' || request.referenced==='Copy'" class="ms-create-buttion" size="small">
<el-button v-if="request.referenced==undefined || request.referenced==='Created' " class="ms-create-buttion" size="small">
{{$t('api_test.automation.customize_req')}}
</el-button>
@ -21,6 +21,7 @@
<el-input size="small" v-model="request.name" style="width: 40%;" :placeholder="$t('commons.input_name')" v-else/>
<el-tag size="mini" style="margin-left: 20px" v-if="request.referenced==='Deleted'" type="danger">{{$t('api_test.automation.reference_deleted')}}</el-tag>
<el-tag size="mini" style="margin-left: 20px" v-if="request.referenced==='Copy'">{{ $t('commons.copy') }}</el-tag>
<el-tag size="mini" style="margin-left: 20px" v-if="request.referenced ==='REF'">{{ $t('api_test.scenario.reference') }}</el-tag>
<div style="margin-right: 20px; float: right">
<i class="icon el-icon-arrow-right" :class="{'is-active': request.active}"

View File

@ -2,7 +2,7 @@
<div>
<el-card>
<el-form :model="request" :rules="rules" label-width="auto" ref="request">
<el-form-item :label="$t('api_test.request.assertions.script_name')" prop="name">
<el-form-item :label="$t('api_test.request.name')" prop="name">
<el-input v-model="request.name" maxlength="200" show-word-limit size="small"/>
</el-form-item>
<el-form-item :label="$t('api_test.definition.api_type')" prop="protocol">

View File

@ -8,6 +8,7 @@
<el-button class="ms-title-buttion" size="small">{{$t('api_test.automation.scenario_import')}}</el-button>
{{scenario.name}}
<el-tag size="mini" style="margin-left: 20px" v-if="scenario.referenced==='Deleted'" type="danger">{{$t('api_test.automation.reference_deleted')}}</el-tag>
<el-tag size="mini" style="margin-left: 20px" v-if="scenario.referenced==='Copy'">{{ $t('commons.copy') }}</el-tag>
<el-tag size="mini" style="margin-left: 20px" v-if="scenario.referenced==='REF'">{{ $t('api_test.scenario.reference') }}</el-tag>
<div style="margin-right: 20px; float: right">
<el-switch v-model="scenario.enable" style="margin-left: 10px"/>

View File

@ -25,9 +25,9 @@
</template>
</el-table-column>
<el-table-column prop="tagNames" :label="$t('api_test.automation.tag')" width="200px">
<el-table-column prop="tags" :label="$t('api_test.automation.tag')" width="200px">
<template v-slot:default="scope">
<div v-for="itemName in scope.row.tagNames" :key="itemName">
<div v-for="(itemName,index) in scope.row.tags" :key="index">
<ms-tag type="success" effect="plain" :content="itemName"/>
</div>
</template>
@ -167,6 +167,11 @@
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
})
this.loading = false;
});
},

View File

@ -79,25 +79,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="Tag" prop="tagId">
<el-select v-model="currentScenario.tagId" size="small" class="ms-scenario-input" placeholder="Tag" :multiple="true">
<el-option
v-for="item in tags"
:key="item.id"
:label="item.name"
:value="item.id"/>
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
{{ $t('api_test.automation.create_tag') }}
</el-button>
<template v-slot:empty>
<div>
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
{{ $t('api_test.automation.create_tag') }}
</el-button>
</div>
</template>
</el-select>
<el-form-item label="Tag" prop="tags">
<ms-input-tag :currentScenario="currentScenario" ref="tag"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -123,21 +106,21 @@
<!-- 调试部分 -->
<div class="ms-debug-div" @click="showAll">
<el-row style="margin: 5px">
<el-col :span="6" class="ms-col-one">
<el-col :span="6" class="ms-col-one ms-font">
{{currentScenario.name ===undefined || ''? $t('api_test.scenario.name') : currentScenario.name}}
</el-col>
<el-col :span="3" class="ms-col-one">
<el-col :span="3" class="ms-col-one ms-font">
{{$t('api_test.automation.step_total')}}{{scenarioDefinition.length}}
</el-col>
<el-col :span="3" class="ms-col-one">
<el-col :span="3" class="ms-col-one ms-font">
<el-link class="head" @click="showScenarioParameters">{{$t('api_test.automation.scenario_total')}}</el-link>
{{this.currentScenario.variables!=undefined?this.currentScenario.variables.length-1: 0}}
</el-col>
<el-col :span="3">
<el-checkbox v-model="enableCookieShare" style="margin-top: 5px">{{ '共享cookie' }}</el-checkbox>
<el-col :span="3" class="ms-col-one ms-font">
<el-checkbox v-model="enableCookieShare">共享cookie</el-checkbox>
</el-col>
<el-col :span="7">
{{$t('api_test.definition.request.run_env')}}:
<el-col :span="7" class="ms-font">
{{$t('api_test.definition.request.run_env')}}
<el-select v-model="currentEnvironmentId" size="small" class="ms-htt-width"
:placeholder="$t('api_test.definition.request.run_env')"
clearable>
@ -259,8 +242,6 @@
<!-- 环境 -->
<api-environment-config ref="environmentConfig" @close="environmentConfigClose"/>
<!--TAG-->
<ms-add-tag @refreshTags="refreshTags" ref="tag"/>
<!--执行组件-->
<ms-run :debug="true" :environment="currentEnvironmentId" :reportId="reportId" :run-data="debugData"
@runRefresh="runRefresh" ref="runTest"/>
@ -293,13 +274,14 @@
import MsApiCustomize from "./ApiCustomize";
import {getUUID, getCurrentProjectID} from "@/common/js/utils";
import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig";
import MsAddTag from "./AddTag";
import MsInputTag from "./MsInputTag";
import MsRun from "./DebugRun";
import MsImportApiScenario from "./ImportApiScenario";
import MsApiScenarioComponent from "./ApiScenarioComponent";
import MsApiReportDetail from "../report/ApiReportDetail";
import MsScenarioParameters from "./ScenarioParameters";
import ApiImport from "../../definition/components/import/ApiImport";
import InputTag from 'vue-input-tag'
export default {
name: "EditApiScenario",
@ -311,7 +293,7 @@
ApiEnvironmentConfig,
MsScenarioParameters,
MsApiReportDetail,
MsAddTag, MsRun,
MsInputTag, MsRun,
MsApiScenarioComponent,
MsImportApiScenario,
MsJsr233Processor,
@ -323,6 +305,7 @@
MsApiComponent,
MsApiCustomize,
ApiImport,
InputTag,
},
data() {
return {
@ -341,7 +324,6 @@
principal: [{required: true, message: this.$t('api_test.definition.request.responsible'), trigger: 'change'}],
},
environments: [],
tags: [],
currentEnvironmentId: "",
maintainerOptions: [],
value: API_STATUS[0].id,
@ -366,7 +348,8 @@
visibleRef: "",
enableCookieShare: false,
}
},
}
,
created() {
if (!this.currentScenario.apiScenarioModuleId) {
this.currentScenario.apiScenarioModuleId = "";
@ -374,11 +357,12 @@
this.projectId = getCurrentProjectID();
this.operatingElements = ELEMENTS.get("ALL");
this.getMaintainerOptions();
this.refreshTags();
this.getApiScenario();
this.getEnvironments();
},
watch: {},
}
,
watch: {}
,
methods: {
addComponent(type) {
switch (type) {
@ -423,7 +407,8 @@
}
this.sort();
this.reload();
},
}
,
nodeClick(e) {
if (e.referenced != 'REF' && e.referenced != 'Deleted') {
this.operatingElements = ELEMENTS.get(e.type);
@ -431,16 +416,19 @@
this.operatingElements = [];
}
this.selectedTreeNode = e;
},
}
,
showAll() {
this.operatingElements = ELEMENTS.get("ALL");
this.selectedTreeNode = undefined;
this.reload();
},
}
,
apiListImport() {
this.visibleRef = getUUID();
this.apiListVisible = true;
},
}
,
recursiveSorting(arr) {
for (let i in arr) {
arr[i].index = Number(i) + 1;
@ -448,7 +436,8 @@
this.recursiveSorting(arr[i].hashTree);
}
}
},
}
,
sort() {
for (let i in this.scenarioDefinition) {
this.scenarioDefinition[i].index = Number(i) + 1;
@ -456,7 +445,8 @@
this.recursiveSorting(this.scenarioDefinition[i].hashTree);
}
}
},
}
,
addCustomizeApi(request) {
this.customizeVisible = false;
request.enable === undefined ? request.enable = true : request.enable;
@ -468,7 +458,8 @@
this.customizeRequest = {};
this.sort();
this.reload();
},
}
,
addScenario(arr) {
if (arr && arr.length > 0) {
arr.forEach(item => {
@ -483,7 +474,8 @@
this.sort();
this.reload();
this.scenarioVisible = false;
},
}
,
setApiParameter(item, refType, referenced) {
let request = {};
if (Object.prototype.toString.call(item.request).indexOf("String") > 0) {
@ -512,7 +504,8 @@
} else {
this.scenarioDefinition.push(request);
}
},
}
,
pushApiOrCase(referenced) {
if (this.currentRow.cases.length === 0 && this.currentRow.apis.length === 0) {
this.$warning(this.$t('api_test.automation.reference_info'));
@ -529,13 +522,15 @@
this.currentRow.apis = [];
this.sort();
this.reload();
},
}
,
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.maintainerOptions = response.data;
});
},
}
,
openTagConfig() {
if (!this.projectId) {
this.$error(this.$t('api_test.select_project'));
@ -543,20 +538,6 @@
}
this.$refs.tag.open();
},
refreshTags() {
let obj = {projectId: this.projectId};
let tagIds = [];
this.$post('/api/tag/list', obj, response => {
this.tags = response.data;
this.tags.forEach(item => {
tagIds.push(item.id);
})
if (this.currentScenario.tagId != undefined && this.currentScenario.tagId.length > 0) {
this.currentScenario.tagId = this.currentScenario.tagId.filter(id => tagIds.indexOf(id) != -1);
}
});
},
remove(row, node) {
const parent = node.parent
const hashTree = parent.data.hashTree || parent.data;
@ -564,7 +545,8 @@
hashTree.splice(index, 1);
this.sort();
this.reload();
},
}
,
copyRow(row, node) {
const parent = node.parent
const hashTree = parent.data.hashTree || parent.data;
@ -574,13 +556,15 @@
hashTree.push(obj);
this.sort();
this.reload();
},
}
,
reload() {
this.loading = true
this.$nextTick(() => {
this.loading = false
})
},
}
,
runDebug() {
/*触发执行操作*/
if (!this.currentEnvironmentId) {
@ -593,7 +577,8 @@
environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
};
this.reportId = getUUID().substring(0, 8);
},
}
,
getEnvironments() {
if (this.projectId) {
this.$get('/api/environment/list/' + this.projectId, response => {
@ -603,17 +588,20 @@
});
});
}
},
}
,
openEnvironmentConfig() {
if (!this.projectId) {
this.$error(this.$t('api_test.select_project'));
return;
}
this.$refs.environmentConfig.open(this.projectId);
},
}
,
environmentConfigClose() {
this.getEnvironments();
},
}
,
allowDrop(draggingNode, dropNode, dropType) {
if (dropType != "inner") {
return true;
@ -622,21 +610,25 @@
return true;
}
return false;
},
}
,
allowDrag(draggingNode, dropNode, dropType) {
this.sort();
this.reload();
},
}
,
nodeExpand(data) {
if (data.resourceId) {
this.expandedNode.push(data.resourceId);
}
},
}
,
nodeCollapse(data) {
if (data.resourceId) {
this.expandedNode.splice(this.expandedNode.indexOf(data.resourceId), 1);
}
},
}
,
getPath(id) {
if (id === null) {
return null;
@ -645,7 +637,8 @@
return item.id === id ? item.path : "";
});
return path[0].path;
},
}
,
setFiles(item, bodyUploadFiles, obj) {
if (item.body) {
if (item.body.kvs) {
@ -683,7 +676,8 @@
});
}
}
},
}
,
recursiveFile(arr, bodyUploadFiles, obj) {
arr.forEach(item => {
this.setFiles(item, bodyUploadFiles, obj);
@ -691,7 +685,8 @@
this.recursiveFile(item.hashTree, bodyUploadFiles, obj);
}
});
},
}
,
getBodyUploadFiles(obj) {
let bodyUploadFiles = [];
obj.bodyUploadIds = [];
@ -702,7 +697,8 @@
}
})
return bodyUploadFiles;
},
}
,
editScenario() {
this.$refs['currentScenario'].validate((valid) => {
if (valid) {
@ -714,15 +710,18 @@
if (response.data) {
this.currentScenario.id = response.data.id;
}
this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId);
if (this.currentScenario.tags instanceof String) {
this.currentScenario.tags = JSON.parse(this.currentScenario.tags);
}
this.$emit('refresh');
})
}
})
},
}
,
getApiScenario() {
if (this.currentScenario.tagId != undefined && !(this.currentScenario.tagId instanceof Array)) {
this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId);
if (this.currentScenario.tags != undefined && !(this.currentScenario.tags instanceof Array)) {
this.currentScenario.tags = JSON.parse(this.currentScenario.tags);
}
if (this.currentScenario.id) {
this.result = this.$get("/api/automation/getApiScenario/" + this.currentScenario.id, response => {
@ -743,7 +742,8 @@
}
})
}
},
}
,
setParameter() {
this.currentScenario.stepTotal = this.scenarioDefinition.length;
this.currentScenario.projectId = getCurrentProjectID();
@ -754,26 +754,30 @@
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
};
this.currentScenario.scenarioDefinition = scenario;
if (this.currentScenario.tagId instanceof Array) {
this.currentScenario.tagId = JSON.stringify(this.currentScenario.tagId);
if (this.currentScenario.tags instanceof Array) {
this.currentScenario.tags = JSON.stringify(this.currentScenario.tags);
}
if (this.currentModule != null) {
this.currentScenario.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null;
this.currentScenario.apiScenarioModuleId = this.currentModule.id;
}
this.currentScenario.projectId = this.projectId;
},
}
,
runRefresh() {
this.debugVisible = true;
this.loading = false;
},
}
,
showScenarioParameters() {
this.$refs.scenarioParameters.open(this.currentScenario.variables);
},
}
,
addParameters(data) {
this.currentScenario.variables = data;
this.reload();
},
}
,
apiImport(importData) {
if (importData && importData.data) {
importData.data.forEach(item => {
@ -827,6 +831,12 @@
color: white;
}
.ms-font {
color: #303133;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
}
.ms-col-one {
margin-top: 6px;
}
@ -912,8 +922,30 @@
margin-bottom: 0px;
}
/deep/ .el-link {
font-weight: normal;
}
/deep/ .el-checkbox {
color: #303133;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
font-weight: normal;
}
/deep/ .el-checkbox__label {
padding-left: 5px;
}
.head {
border-bottom: 1px solid #474849;
border-bottom: 1px solid #303133;
color: #303133;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
}
/deep/ .el-form-item__content {
line-height: 100%;
}
</style>

View File

@ -0,0 +1,69 @@
<template>
<input-tag v-model="data"></input-tag>
</template>
<script>
import InputTag from 'vue-input-tag'
export default {
name: "MsInputTag",
components: {InputTag},
props: {currentScenario: {}},
created() {
if (!this.currentScenario.tags) {
this.currentScenario.tags = [];
}
console.log(this.currentScenario.tags)
this.data = this.currentScenario.tags;
},
data() {
return {
data: [],
}
},
watch: {
data() {
this.currentScenario.tags = this.data;
}
},
methods: {}
}
</script>
<style scoped>
/deep/ .vue-input-tag-wrapper {
border-radius: 2px;
border: 1px solid #a5d24a;
color: #909399;
display: inline-block;
}
/deep/ .input-tag {
display: inline-block;
font-size: 12px;
min-width: auto;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
background-color: #fff;
border-color: #909399;
color: #909399;
width: auto;
height: 23px;
padding: 0 5px;
line-height: 19px;
}
/deep/ .remove {
color: #909399;
}
/deep/ .el-form-item__content {
line-height: 100%;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div>
<div style="min-width: 1000px;margin-bottom: 20px">
<el-radio-group v-model="body.type" size="mini">
<el-radio :disabled="isReadOnly" :label="type.FORM_DATA" @change="modeChange">
{{ $t('api_test.definition.request.body_form_data') }}

View File

@ -23,7 +23,7 @@
<el-col :span="16">
<el-form-item :label="$t('api_report.request')" prop="path">
<el-input :placeholder="$t('api_test.definition.request.path_info')" v-model="httpForm.path"
class="ms-http-input" size="small" style="margin-top: 5px">
class="ms-http-input" size="small" style="margin-top: 5px" @change="urlChange">
<el-select v-model="httpForm.method" slot="prepend" style="width: 100px" size="small">
<el-option v-for="item in reqOptions" :key="item.id" :label="item.label" :value="item.id"/>
</el-select>
@ -95,6 +95,7 @@
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import {REQ_METHOD, API_STATUS} from "../../model/JsonData";
import MsJsr233Processor from "../processor/Jsr233Processor";
import {KeyValue} from "../../model/ApiTestModel";
export default {
name: "MsAddCompleteHttpApi",
@ -169,6 +170,35 @@
});
return path[0].path;
},
urlChange() {
if (!this.httpForm.path) return;
let url = this.getURL(this.addProtocol(this.httpForm.path));
if (url) {
this.httpForm.path = decodeURIComponent("/" + url.hostname + url.pathname);
}
},
addProtocol(url) {
if (url) {
if (!url.toLowerCase().startsWith("https") && !url.toLowerCase().startsWith("http")) {
return "https://" + url;
}
}
return url;
},
getURL(urlStr) {
try {
let url = new URL(urlStr);
console.log(urlStr)
url.searchParams.forEach((value, key) => {
if (key && value) {
this.request.arguments.splice(0, 0, new KeyValue({name: key, required: false, value: value}));
}
});
return url;
} catch (e) {
this.$error(this.$t('api_test.request.url_invalid'), 2000);
}
},
},
created() {

View File

@ -18,9 +18,6 @@
<span style="margin-right: 10px">
<el-checkbox class="follow-redirects-item" v-model="request.followRedirects">{{$t('api_test.request.follow_redirects')}}</el-checkbox>
</span>
<span style="margin-right: 10px">
<el-checkbox class="do-multipart-post" v-model="request.doMultipartPost">{{$t('api_test.request.do_multipart_post')}}</el-checkbox>
</span>
</el-row>
</div>
</template>

View File

@ -48,7 +48,7 @@
</el-tab-pane>
<!--请求体-->
<el-tab-pane v-if="isBodyShow" :label="$t('api_test.request.body')" name="body">
<el-tab-pane v-if="isBodyShow" :label="$t('api_test.request.body')" name="body" style="overflow: auto">
<ms-api-body @headersChange="reloadBody" :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :headers="headers" :body="request.body"/>
</el-tab-pane>

View File

@ -10,7 +10,7 @@
<ms-code-edit v-if="!isSqlType" :mode="mode" :read-only="true" :modes="modes" :data.sync="response.responseResult.body" ref="codeEdit"/>
</el-tab-pane>
<!--<el-tab-pane label="Cookie" name="cookie" class="pane cookie">-->
<!--<pre>{{response.cookies}}</pre>-->
<!--<pre>{{response.cookies}}</pre>-->
<!--</el-tab-pane>-->
<el-tab-pane :label="$t('api_test.definition.request.console')" name="console" class="pane">
@ -26,17 +26,21 @@
</el-tab-pane>
<el-tab-pane :label="$t('api_report.request_body')" name="request_body" class="pane">
<div>
{{$t('api_test.request.address')}} : {{ response.url }}
<div class="ms-div">
{{$t('api_test.request.address')}} :
<pre>{{ response.url }}</pre>
</div>
<div>
{{$t('api_test.scenario.headers')}} : {{ response.headers }}
<div class="ms-div">
{{$t('api_test.scenario.headers')}} :
<pre>{{ response.headers }}</pre>
</div>
<div>
Cookies : {{response.cookies}}
<div class="ms-div">
Cookies :
<pre>{{response.cookies}}</pre>
</div>
<div>
Body : {{response.body}}
<div class="ms-div">
Body :
<pre>{{response.body}}</pre>
</div>
</el-tab-pane>
@ -45,7 +49,6 @@
<template v-slot:label>
<ms-dropdown v-if="currentProtocol==='SQL'" :commands="sqlModes" :default-command="mode" @command="sqlModeChange"/>
<ms-dropdown v-else :commands="modes" :default-command="mode" @command="modeChange"/>
</template>
</el-tab-pane>
</el-tabs>
@ -139,6 +142,10 @@
height: 0px;
}
.ms-div {
margin-top: 20px;
}
pre {
margin: 0;
}

View File

@ -24,79 +24,83 @@
</template>
<script>
export default {
name: "MsSqlResultTable",
data() {
return {
tables: [],
titles: []
}
},
props: {
body: String
},
created() {
if (!this.body) {
return;
}
let rowArry = this.body.split("\n");
this.getTableData(rowArry);
if (this.tables.length > 1) {
for (let i = 0; i < this.tables.length; i++) {
if (this.tables[i].titles.length === 1 && i < this.tables.length - 1) {
this.tables[i].tableData.splice(this.tables[i].tableData.length - 1, 1);
}
export default {
name: "MsSqlResultTable",
data() {
return {
tables: [],
titles: []
}
},
props: {
body: String
},
created() {
if (!this.body) {
return;
}
let rowArry = this.body.split("\n");
//
if (rowArry.length > 100) {
rowArry = rowArry.slice(0, 100);
}
this.getTableData(rowArry);
if (this.tables.length > 1) {
for (let i = 0; i < this.tables.length; i++) {
if (this.tables[i].titles.length === 1 && i < this.tables.length - 1) {
this.tables[i].tableData.splice(this.tables[i].tableData.length - 1, 1);
}
}
let lastTable = this.tables[this.tables.length - 1];
if (lastTable.titles.length === 1) {
if (lastTable.tableData.length > 4) {
lastTable.tableData.splice(lastTable.tableData.length - 4, 4);
} else {
this.tables.splice(this.tables.length - 1, 1);
}
let lastTable = this.tables[this.tables.length - 1];
if (lastTable.titles.length === 1) {
if (lastTable.tableData.length > 4) {
lastTable.tableData.splice(lastTable.tableData.length - 4, 4);
} else {
this.tables.splice(this.tables.length - 1, 1);
}
} else {
let table = this.tables[0];
table.tableData.splice(table.tableData.length - 4, 4);
this.tables.splice(this.tables.length - 1, 1);
}
},
methods: {
getTableData(rowArry) {
let titles;
let result = [];
for (let i = 0; i < rowArry.length; i++) {
let colArray = rowArry[i].split("\t");
if (i === 0) {
titles = colArray;
} else {
if (colArray.length != titles.length) {
//
if (colArray.length === 1 && colArray[0] === '') {
this.getTableData(rowArry.slice(i + 1));
} else {
this.getTableData(rowArry.slice(i));
}
break;
} else {
let table = this.tables[0];
table.tableData.splice(table.tableData.length - 4, 4);
}
},
methods: {
getTableData(rowArry) {
let titles;
let result = [];
for (let i = 0; i < rowArry.length; i++) {
let colArray = rowArry[i].split("\t");
if (i === 0) {
titles = colArray;
} else {
if (colArray.length != titles.length) {
//
if (colArray.length === 1 && colArray[0] === '') {
this.getTableData(rowArry.slice(i + 1));
} else {
let item = {};
for (let j = 0; j < colArray.length; j++) {
item[titles[j]] = (colArray[j] ? colArray[j] : "");
}
result.push(item);
this.getTableData(rowArry.slice(i));
}
break;
} else {
let item = {};
for (let j = 0; j < colArray.length; j++) {
item[titles[j]] = (colArray[j] ? colArray[j] : "");
}
result.push(item);
}
}
this.tables.splice(0, 0, {
titles: titles,
tableData: result
});
}
this.tables.splice(0, 0, {
titles: titles,
tableData: result
});
}
}
}
</script>
<style scoped>
@ -114,7 +118,7 @@
}
.el-container {
overflow:auto;
overflow: auto;
max-height: 500px;
}

View File

@ -216,6 +216,7 @@
updateApi() {
let url = "/api/definition/update";
let bodyFiles = this.getBodyUploadFiles();
this.api.method = this.api.request.method;
this.$fileUpload(url, null, bodyFiles, this.api, () => {
this.$success(this.$t('commons.save_success'));
this.$emit('saveApi', this.api);

View File

@ -18,7 +18,22 @@
</el-aside>
<el-main style="padding-left: 0px;padding-right: 0px;">
<div style="width: 200px;margin:0 auto">
<el-row align="center">
<el-row align="center" class="hidden-lg-and-down">
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="apiCountData.httpCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="apiCountData.rpcCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="apiCountData.tcpCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;">
<div class="count-info-div" v-html="apiCountData.sqlCountStr"></div>
</el-col>
</el-row>
<el-row align="right" style="margin-left: 20px" class="hidden-xl-only">
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="apiCountData.httpCountStr"></div>
</el-col>

View File

@ -11,8 +11,16 @@
<el-table-column prop="rule" :label="$t('api_test.home_page.running_task_list.table_coloum.run_rule')" width="120" show-overflow-tooltip/>
<el-table-column width="100" :label="$t('api_test.home_page.running_task_list.table_coloum.task_status')">
<template v-slot:default="scope">
<el-switch @click.stop.native v-model="scope.row.taskStatus" @change="updateTask(scope.row)"/>
<div>
<el-switch
v-model="scope.row.taskStatus"
class="captcha-img"
@click.native="closeTaskConfirm(scope.row)"
></el-switch>
</div>
</template>
</el-table-column>
<el-table-column width="170" :label="$t('api_test.home_page.running_task_list.table_coloum.next_execution_time')">
<template v-slot:default="scope">
@ -41,6 +49,7 @@ export default {
value: '100',
result: {},
tableData: [],
visible: false,
loading: false
}
},
@ -53,6 +62,19 @@ export default {
});
},
closeTaskConfirm(row){
let flag = row.taskStatus;
row.taskStatus = !flag; //switch
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.updateTask(row);
}).catch(() => {
});
},
updateTask(taskRow){
this.result = this.$post('/api/schedule/updateEnableByPrimyKey', taskRow, response => {
@ -66,8 +88,11 @@ export default {
},
activated() {
this.search();
},
handleStatus(scope) {
console.log(scope.row.userId)
}
}
}
</script>
<style scoped>

View File

@ -18,7 +18,21 @@
</el-aside>
<el-main style="padding-left: 0px;padding-right: 0px">
<div style="width: 200px;margin:0 auto">
<el-row align="center">
<el-row align="center" class="hidden-lg-and-down">
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="testCaseCountData.httpCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="testCaseCountData.rpcCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="testCaseCountData.tcpCountStr"></div>
</el-col>
<el-col :span="6" style="padding: 5px;">
<div class="count-info-div" v-html="testCaseCountData.sqlCountStr"></div>
</el-col>
</el-row>
<el-row align="right" style="margin-left: 20px" class="hidden-xl-only">
<el-col :span="6" style="padding: 5px;border-right-style: solid;border-right-width: 1px;border-right-color: #ECEEF4;">
<div class="count-info-div" v-html="testCaseCountData.httpCountStr"></div>
</el-col>

View File

@ -2,7 +2,7 @@
<div id="menu-bar">
<el-row type="flex">
<project-change :project-name="currentProject"/>
<el-col :span="12">
<el-col :span="9">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
<el-menu-item :index="'/performance/home'">
{{ $t("i18n.home") }}
@ -32,7 +32,7 @@
<ms-create-test :to="'/performance/test/create'"/>
</el-row>
</el-col>
<el-col :span="10"/>
<el-col :span="11"/>
</el-row>
</div>
</template>

View File

@ -13,10 +13,10 @@
<el-col :span="4">
<el-card shadow="always" class="ms-card-index-2">
<span class="ms-card-data">
<span class="ms-card-data-digital">{{ avgThroughput }}</span>
<span class="ms-card-data-unit"> Hits/s</span>
<span class="ms-card-data-digital">{{ avgTransactions }}</span>
<span class="ms-card-data-unit"> Transactions/s</span>
</span>
<span class="ms-card-desc">Avg.Throughput</span>
<span class="ms-card-desc">Avg.Transactions</span>
</el-card>
</el-col>
<el-col :span="4">
@ -86,6 +86,7 @@ export default {
return {
maxUsers: "0",
avgThroughput: "0",
avgTransactions: "0",
errors: "0",
avgResponseTime: "0",
responseTime90: "0",
@ -103,6 +104,7 @@ export default {
let data = res.data.data;
this.maxUsers = data.maxUsers;
this.avgThroughput = data.avgThroughput;
this.avgTransactions = data.avgTransactions;
this.errors = data.errors;
this.avgResponseTime = data.avgResponseTime;
this.responseTime90 = data.responseTime90;
@ -110,6 +112,7 @@ export default {
}).catch(() => {
this.maxUsers = '0';
this.avgThroughput = '0';
this.avgTransactions = '0';
this.errors = '0';
this.avgResponseTime = '0';
this.responseTime90 = '0';

View File

@ -114,6 +114,7 @@
}
],
phone: [
{required: true, message: this.$t('user.input_phone'), trigger: 'blur'},
{
required: false,
pattern: PHONE_REGEX,

View File

@ -61,6 +61,9 @@
<el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.image')" prop="image">
<el-input v-model="form.image" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('test_resource_pool.type')" prop="type">
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">
@ -148,6 +151,9 @@
<el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.image')" prop="image">
<el-input v-model="form.image" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('test_resource_pool.type')" prop="type">
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">

View File

@ -5,7 +5,7 @@
<i class="el-icon-refresh" @click="getComments()"
style="margin-left:10px;font-size: 14px; cursor: pointer"/>
</template>
<div class="comment-list" style="height: 500px; overflow: auto;">
<div style="height: 100%;overflow:auto;">
<review-comment-item v-for="(comment,index) in comments"
:key="index"
:comment="comment"

View File

@ -1,6 +1,6 @@
<template>
<el-row :gutter="5">
<el-col :span="16">
<el-col :span="15">
<el-card class="case-detail-form-card">
<el-form :model="form" ref="caseFrom" v-loading="result.loading">
@ -11,13 +11,13 @@
:label="$t('test_track.case.name')"
:label-width="formLabelWidth"
prop="name">
<el-input class="case-name" :disabled="readOnly" v-model="testCase.name"></el-input>
<el-input :disabled="readOnly" v-model="testCase.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
<el-input class="case-name" :disabled="readOnly" v-model="testCase.nodePath"></el-input>
<el-input :disabled="readOnly" v-model="testCase.nodePath"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -156,8 +156,8 @@
</el-form>
</el-card>
</el-col>
<el-col :span="8">
<case-comment :case-id="testCaseId" :read-only="true"/>
<el-col :span="9">
<case-comment :case-id="testCaseId" :read-only="true" class="case-detail-comment"/>
</el-col>
</el-row>
@ -193,7 +193,7 @@ export default {
remark: '',
},
workspaceId: '',
formLabelWidth: "120px",
formLabelWidth: "80px",
isStepTableAlive: true,
methodOptions: [
@ -223,6 +223,12 @@ export default {
}
.case-detail-form-card >>> .el-card__body {
padding: 20px 28px;
padding: 20px 0;
}
.case-detail-comment {
min-width: 320px;
height: 600px;
overflow: auto;
}
</style>

View File

@ -3,13 +3,13 @@
<el-dialog :close-on-click-modal="false" class="case-dialog"
@close="close"
:title="operationType == 'edit' ? ( readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')"
:visible.sync="dialogFormVisible" width="88%">
:visible.sync="dialogFormVisible" width="85%">
<el-row :gutter="10">
<div>
<el-col :span="17">
<el-card>
<el-form :model="form" :rules="rules" ref="caseFrom" v-loading="result.loading">
<el-card class="container">
<el-form :model="form" :rules="rules" ref="caseFrom" v-loading="result.loading" class="case-form">
<el-row>
<el-col :span="8" :offset="1">
@ -170,7 +170,7 @@
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.input_content')" min-width="20%">
<el-table-column :label="$t('commons.input_content')" min-width="25%">
<template v-slot:default="scope">
<el-button
type="primary"
@ -237,22 +237,20 @@
</el-col>
</el-row>
<el-row style="float: right; margin-bottom: 10px;">
<el-switch v-if="operationType == 'add'"
v-model="isCreateContinue"
:active-text="$t('test_track.case.save_create_continue')">
</el-switch>
<ms-dialog-footer v-if="!readOnly"
@cancel="dialogFormVisible = false"
@confirm="saveCase"/>
</el-row>
</el-form>
<el-row style="float: right; margin-bottom: 20px;margin-top: 20px">
<el-switch v-if="operationType == 'add'"
v-model="isCreateContinue"
:active-text="$t('test_track.case.save_create_continue')">
</el-switch>
<ms-dialog-footer v-if="!readOnly"
@cancel="dialogFormVisible = false"
@confirm="saveCase"/>
</el-row>
</el-card>
</el-col>
<el-col :span="7">
<case-comment :case-id="testCase ? testCase.id : ''"/>
<case-comment :case-id="testCase ? testCase.id : ''" class="comment-card"/>
</el-col>
</div>
</el-row>
@ -712,8 +710,28 @@ export default {
width: 194px;
}
.container {
height: 100vh;
}
.case-form {
height: 95%;
overflow: auto;
}
.case-dialog >>> .el-dialog__body {
padding: 0 20px 10px 20px;
}
.container >>> .el-card__body {
height: calc(100vh - 120px);
}
.comment-card >>> .el-card__header {
padding: 27px 20px;
}
.comment-card >>> .el-card__body {
height: calc(100vh - 120px);
}
</style>

View File

@ -62,7 +62,6 @@
<el-popover
placement="right-end"
:title="$t('test_track.case.view_case')"
width="70%"
trigger="hover"
>
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>

View File

@ -10,338 +10,348 @@
v-loading="result.loading">
<template v-slot:default="scope">
<div class="container">
<el-row :gutter="10">
<div class="container">
<el-col :span="17">
<el-card>
<el-scrollbar>
<el-scrollbar>
<el-header>
<el-header>
<el-row type="flex" class="head-bar">
<el-row type="flex" class="head-bar">
<el-col :span="12">
<el-button plain size="mini"
icon="el-icon-back"
@click="cancel">{{ $t('test_track.return') }}
</el-button>
</el-col>
<el-col :span="12">
<el-button plain size="mini"
icon="el-icon-back"
@click="cancel">{{ $t('test_track.return') }}
</el-button>
</el-col>
<el-col :span="11" class="head-right">
<el-col :span="11" class="head-right">
<span class="head-right-tip" v-if="index + 1 === testCases.length">
{{ $t('test_track.plan_view.pre_case') }} : {{
testCases[index - 1] ? testCases[index - 1].name : ''
}}
</span>
<span class="head-right-tip" v-if="index + 1 !== testCases.length">
<span class="head-right-tip" v-if="index + 1 !== testCases.length">
{{ $t('test_track.plan_view.next_case') }} : {{
testCases[index + 1] ? testCases[index + 1].name : ''
}}
testCases[index + 1] ? testCases[index + 1].name : ''
}}
</span>
<el-button plain size="mini" icon="el-icon-arrow-up"
:disabled="index + 1 <= 1"
@click="handlePre()"/>
<span> {{ index + 1 }}/{{ testCases.length }} </span>
<el-button plain size="mini" icon="el-icon-arrow-down"
:disabled="index + 1 >= testCases.length"
@click="handleNext()"/>
</el-col>
<el-button plain size="mini" icon="el-icon-arrow-up"
:disabled="index + 1 <= 1"
@click="handlePre()"/>
<span> {{ index + 1 }}/{{ testCases.length }} </span>
<el-button plain size="mini" icon="el-icon-arrow-down"
:disabled="index + 1 >= testCases.length"
@click="handleNext()"/>
</el-col>
</el-row>
</el-row>
<el-row style="margin-top: 0;">
<el-col>
<el-divider content-position="left">{{ testCase.name }}</el-divider>
</el-col>
</el-row>
<el-row style="margin-top: 0;">
<el-col>
<el-divider content-position="left">{{ testCase.name }}</el-divider>
</el-col>
</el-row>
</el-header>
</el-header>
<div class="case_container">
<el-row>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.case.priority') }}</span>
<span class="cast_item">{{ testCase.priority }}</span>
</el-col>
<el-col :span="5">
<span class="cast_label">{{ $t('test_track.case.case_type') }}</span>
<span class="cast_item" v-if="testCase.type === 'functional'">{{ $t('commons.functional') }}</span>
<span class="cast_item" v-if="testCase.type === 'performance'">{{ $t('commons.performance') }}</span>
<span class="cast_item" v-if="testCase.type === 'api'">{{ $t('commons.api') }}</span>
</el-col>
<el-col :span="13">
<test-plan-test-case-status-button class="status-button"
@statusChange="statusChange"
:is-read-only="isReadOnly"
:is-failure="isFailure"
:status="testCase.status"/>
</el-col>
</el-row>
<div class="case_container">
<el-row>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.case.priority') }}</span>
<span class="cast_item">{{ testCase.priority }}</span>
</el-col>
<el-col :span="5">
<span class="cast_label">{{ $t('test_track.case.case_type') }}</span>
<span class="cast_item" v-if="testCase.type === 'functional'">{{ $t('commons.functional') }}</span>
<span class="cast_item" v-if="testCase.type === 'performance'">{{ $t('commons.performance') }}</span>
<span class="cast_item" v-if="testCase.type === 'api'">{{ $t('commons.api') }}</span>
</el-col>
<el-col :span="10">
<test-plan-test-case-status-button class="status-button"
@statusChange="statusChange"
:is-read-only="isReadOnly"
:is-failure="isFailure"
:status="testCase.status"/>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.case.method') }}</span>
<span v-if="testCase.method === 'manual'">{{ $t('test_track.case.manual') }}</span>
<span v-if="testCase.method === 'auto'">{{ $t('test_track.case.auto') }}</span>
</el-col>
<el-col :span="5">
<span class="cast_label">{{ $t('test_track.case.module') }}</span>
<span class="cast_item">{{ testCase.nodePath }}</span>
</el-col>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.plan.plan_project') }}</span>
<span class="cast_item">{{ testCase.projectName }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.case.method') }}</span>
<span v-if="testCase.method === 'manual'">{{ $t('test_track.case.manual') }}</span>
<span v-if="testCase.method === 'auto'">{{ $t('test_track.case.auto') }}</span>
</el-col>
<el-col :span="5">
<span class="cast_label">{{ $t('test_track.case.module') }}</span>
<span class="cast_item">{{ testCase.nodePath }}</span>
</el-col>
<el-col :span="4" :offset="1">
<span class="cast_label">{{ $t('test_track.plan.plan_project') }}</span>
<span class="cast_item">{{ testCase.projectName }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :offset="1" v-if="testCase.testId == 'other'">
<span class="cast_label">{{ $t('test_track.case.test_name') }}</span>
<span class="cast_item">{{ testCase.otherTestName }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :offset="1" v-if="testCase.testId == 'other'">
<span class="cast_label">{{ $t('test_track.case.test_name') }}</span>
<span class="cast_item">{{ testCase.otherTestName }}</span>
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.case.prerequisite') }}</span>
<span class="cast_item"><p>{{ testCase.prerequisite }}</p></span>
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.case.prerequisite') }}</span>
<span class="cast_item"><p>{{ testCase.prerequisite }}</p></span>
</el-col>
</el-row>
<el-row v-if="testCase.method === 'auto' && testCase.testId && testCase.testId != 'other'">
<el-col class="test-detail" :span="20" :offset="1">
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
<api-test-detail :is-read-only="isReadOnly" v-if="testCase.type === 'api'" @runTest="testRun"
:id="testCase.testId" ref="apiTestDetail"/>
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type === 'performance'"
@runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/>
</el-tab-pane>
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">
<api-test-result :report-id="testCase.reportId" v-if=" testCase.type === 'api'"
ref="apiTestResult"/>
<performance-test-result :is-read-only="isReadOnly" :report-id="testCase.reportId"
v-if="testCase.type === 'performance'" ref="performanceTestResult"/>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-row v-if="testCase.method === 'auto' && testCase.testId && testCase.testId != 'other'">
<el-col class="test-detail" :span="20" :offset="1">
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
<api-test-detail :is-read-only="isReadOnly" v-if="testCase.type === 'api'" @runTest="testRun"
:id="testCase.testId" ref="apiTestDetail"/>
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type === 'performance'"
@runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/>
</el-tab-pane>
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">
<api-test-result :report-id="testCase.reportId" v-if=" testCase.type === 'api'"
ref="apiTestResult"/>
<performance-test-result :is-read-only="isReadOnly" :report-id="testCase.reportId"
v-if="testCase.type === 'performance'" ref="performanceTestResult"/>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-row v-if="testCase.method && testCase.method !== 'auto'">
<el-col :span="20" :offset="1">
<div>
<span class="cast_label">{{ $t('test_track.case.steps') }}</span>
</div>
<el-table
:data="testCase.steptResults"
class="tb-edit"
size="mini"
:border="true"
:default-sort="{prop: 'num', order: 'ascending'}"
highlight-current-row>
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="5%"></el-table-column>
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="21%">
<template v-slot:default="scope">
<el-input
<el-row v-if="testCase.method && testCase.method !== 'auto'">
<el-col :span="22" :offset="1">
<div>
<span class="cast_label">{{ $t('test_track.case.steps') }}</span>
</div>
<el-table
:data="testCase.steptResults"
class="tb-edit"
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.desc"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="21%">
<template v-slot:default="scope">
<el-input
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.result"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.actual_result')" min-width="21%">
<template v-slot:default="scope">
<el-input
class="table-edit-input"
size="mini"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:rows="2"
:border="true"
:default-sort="{prop: 'num', order: 'ascending'}"
highlight-current-row>
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="5%"></el-table-column>
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="21%">
<template v-slot:default="scope">
<el-input
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.desc"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="21%">
<template v-slot:default="scope">
<el-input
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.result"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.actual_result')" min-width="21%">
<template v-slot:default="scope">
<el-input
class="table-edit-input"
size="mini"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:rows="2"
:disabled="isReadOnly"
v-model="scope.row.actualResult"
:placeholder="$t('commons.input_content')"
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.step_result')" min-width="12%">
<template v-slot:default="scope">
<el-select
:disabled="isReadOnly"
v-model="scope.row.executeResult"
@change="stepResultChange()"
filterable
size="mini">
<el-option :label="$t('test_track.plan_view.pass')" value="Pass"
style="color: #7ebf50;"></el-option>
<el-option :label="$t('test_track.plan_view.failure')" value="Failure"
style="color: #e57471;"></el-option>
<el-option :label="$t('test_track.plan_view.blocking')" value="Blocking"
style="color: #dda451;"></el-option>
<el-option :label="$t('test_track.plan_view.skip')" value="Skip"
style="color: #919399;"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="5" :offset="1">
<el-switch
:disabled="isReadOnly"
v-model="scope.row.actualResult"
:placeholder="$t('commons.input_content')"
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.step_result')" min-width="12%">
<template v-slot:default="scope">
<el-select
:disabled="isReadOnly"
v-model="scope.row.executeResult"
@change="stepResultChange()"
filterable
size="mini">
<el-option :label="$t('test_track.plan_view.pass')" value="Pass"
style="color: #7ebf50;"></el-option>
<el-option :label="$t('test_track.plan_view.failure')" value="Failure"
style="color: #e57471;"></el-option>
<el-option :label="$t('test_track.plan_view.blocking')" value="Blocking"
style="color: #dda451;"></el-option>
<el-option :label="$t('test_track.plan_view.skip')" value="Skip"
style="color: #919399;"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="5" :offset="1">
<el-switch
:disabled="isReadOnly"
v-model="issuesSwitch"
@change="issuesChange"
:active-text="$t('test_track.plan_view.submit_issues')">
</el-switch>
<el-tooltip class="item" effect="dark"
:content="$t('test_track.issue.platform_tip')"
placement="right">
<i class="el-icon-info"/>
</el-tooltip>
</el-col>
</el-row>
<el-row v-if="issuesSwitch">
<el-col :span="20" :offset="1" class="issues-edit">
<el-input
type="text"
:placeholder="$t('test_track.issue.input_title')"
v-model="testCase.issues.title"
maxlength="60"
show-word-limit
/>
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig"
v-model="testCase.issues.content"/>
<el-row v-if="hasTapdId">
{{ $t('test_track.issue.tapd_current_owner') }}
<el-select v-model="testCase.tapdUsers"
multiple
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.please_choose_current_owner')"
collapse-tags size="small">
<el-option v-for="(userInfo, index) in users" :key="index" :label="userInfo.user"
:value="userInfo.user"/>
</el-select>
</el-row>
<el-row v-if="hasZentaoId">
{{ $t('test_track.issue.zentao_bug_build') }}
<el-select v-model="testCase.zentaoBuilds"
multiple
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.zentao_bug_build')"
collapse-tags size="small">
<el-option v-for="(build, index) in Builds" :key="index" :label="build.name"
:value="build.id"/>
</el-select>
{{ $t('test_track.issue.zentao_bug_assigned') }}
<el-select v-model="testCase.zentaoAssigned"
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.please_choose_current_owner')"
collapse-tags size="small">
<el-option v-for="(userInfo, index) in zentaoUsers" :key="index" :label="userInfo.name"
:value="userInfo.user"/>
</el-select>
</el-row>
<el-button type="primary" size="small" @click="saveIssues">{{ $t('commons.save') }}</el-button>
<el-button size="small" @click="issuesSwitch=false">{{ $t('commons.cancel') }}</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="20" :offset="1" class="issues-edit">
<el-table border class="adjust-table" :data="issues" style="width: 100%">
<el-table-column prop="id" :label="$t('test_track.issue.id')" show-overflow-tooltip/>
<el-table-column prop="title" :label="$t('test_track.issue.title')" show-overflow-tooltip/>
<el-table-column prop="description" :label="$t('test_track.issue.description')">
<template v-slot:default="scope">
<el-popover
placement="left"
width="400"
trigger="hover"
>
<ckeditor :editor="editor" disabled :config="readConfig"
v-model="scope.row.description"/>
<el-button slot="reference" type="text">{{ $t('test_track.issue.preview') }}</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('test_track.issue.status')"/>
<el-table-column prop="platform" :label="$t('test_track.issue.platform')"/>
<el-table-column :label="$t('test_track.issue.operate')">
<template v-slot:default="scope">
<el-tooltip :content="$t('test_track.issue.close')"
placement="top" :enterable="false">
<el-button type="danger" icon="el-icon-circle-close" size="mini"
circle v-if="scope.row.platform === 'Local'"
@click="closeIssue(scope.row)"
/>
v-model="issuesSwitch"
@change="issuesChange"
:active-text="$t('test_track.plan_view.submit_issues')">
</el-switch>
<el-tooltip class="item" effect="dark"
:content="$t('test_track.issue.platform_tip')"
placement="right">
<i class="el-icon-info"/>
</el-tooltip>
<el-tooltip :content="$t('test_track.issue.delete')"
placement="top" :enterable="false">
<el-button type="danger" icon="el-icon-delete" size="mini"
circle v-if="scope.row.platform === 'Local'"
@click="deleteIssue(scope.row)"
</el-col>
</el-row>
<el-row v-if="issuesSwitch">
<el-col :span="20" :offset="1" class="issues-edit">
<el-input
type="text"
:placeholder="$t('test_track.issue.input_title')"
v-model="testCase.issues.title"
maxlength="60"
show-word-limit
/>
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig"
v-model="testCase.issues.content"/>
<el-row v-if="hasTapdId">
{{ $t('test_track.issue.tapd_current_owner') }}
<el-select v-model="testCase.tapdUsers"
multiple
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.please_choose_current_owner')"
collapse-tags size="small">
<el-option v-for="(userInfo, index) in users" :key="index" :label="userInfo.user"
:value="userInfo.user"/>
</el-select>
</el-row>
<el-row v-if="hasZentaoId">
{{ $t('test_track.issue.zentao_bug_build') }}
<el-select v-model="testCase.zentaoBuilds"
multiple
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.zentao_bug_build')"
collapse-tags size="small">
<el-option v-for="(build, index) in Builds" :key="index" :label="build.name"
:value="build.id"/>
</el-select>
{{ $t('test_track.issue.zentao_bug_assigned') }}
<el-select v-model="testCase.zentaoAssigned"
filterable
style="width: 20%"
:placeholder="$t('test_track.issue.please_choose_current_owner')"
collapse-tags size="small">
<el-option v-for="(userInfo, index) in zentaoUsers" :key="index" :label="userInfo.name"
:value="userInfo.user"/>
</el-select>
</el-row>
<el-button type="primary" size="small" @click="saveIssues">{{ $t('commons.save') }}</el-button>
<el-button size="small" @click="issuesSwitch=false">{{ $t('commons.cancel') }}</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="20" :offset="1" class="issues-edit">
<el-table border class="adjust-table" :data="issues" style="width: 100%">
<el-table-column prop="id" :label="$t('test_track.issue.id')" show-overflow-tooltip/>
<el-table-column prop="title" :label="$t('test_track.issue.title')" show-overflow-tooltip/>
<el-table-column prop="description" :label="$t('test_track.issue.description')">
<template v-slot:default="scope">
<el-popover
placement="left"
width="400"
trigger="hover"
>
<ckeditor :editor="editor" disabled :config="readConfig"
v-model="scope.row.description"/>
<el-button slot="reference" type="text">{{ $t('test_track.issue.preview') }}</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('test_track.issue.status')"/>
<el-table-column prop="platform" :label="$t('test_track.issue.platform')"/>
<el-table-column :label="$t('test_track.issue.operate')">
<template v-slot:default="scope">
<el-tooltip :content="$t('test_track.issue.close')"
placement="top" :enterable="false">
<el-button type="danger" icon="el-icon-circle-close" size="mini"
circle v-if="scope.row.platform === 'Local'"
@click="closeIssue(scope.row)"
/>
</el-tooltip>
<el-tooltip :content="$t('test_track.issue.delete')"
placement="top" :enterable="false">
<el-button type="danger" icon="el-icon-delete" size="mini"
circle v-if="scope.row.platform === 'Local'"
@click="deleteIssue(scope.row)"
/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="15" :offset="1">
<div>
<span class="cast_label">{{ $t('commons.remark') }}</span>
<span v-if="testCase.remark == null || testCase.remark === ''"
style="color: darkgrey">{{ $t('commons.not_filled') }}</span>
</div>
<div>
<el-input :rows="3"
type="textarea"
v-if="testCase.remark"
disabled
v-model="testCase.remark"></el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="15" :offset="1">
<div>
<span class="cast_label">{{ $t('test_track.case.attachment') }}:</span>
</div>
<div>
<test-case-attachment :table-data="tableData"
:read-only="isReadOnly"
:is-delete="false"
@handleDelete="handleDelete"
/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="15" :offset="1">
<div>
<span class="cast_label">{{ $t('commons.remark') }}</span>
<span v-if="testCase.remark == null || testCase.remark === ''"
style="color: darkgrey">{{ $t('commons.not_filled') }}</span>
</div>
</el-col>
</el-row>
</div>
<div>
<el-input :rows="3"
type="textarea"
v-if="testCase.remark"
disabled
v-model="testCase.remark"></el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="15" :offset="1">
<div>
<span class="cast_label">{{ $t('test_track.case.attachment') }}:</span>
</div>
<div>
<test-case-attachment :table-data="tableData"
:read-only="isReadOnly"
:is-delete="false"
@handleDelete="handleDelete"
/>
</div>
</el-col>
</el-row>
</div>
</el-scrollbar>
</el-card>
</el-col>
<el-col :span="7">
<case-comment :case-id="testCase ? testCase.caseId : ''" class="comment-card"/>
</el-col>
</el-scrollbar>
</div>
</div>
</el-row>
</template>
@ -359,10 +369,12 @@ import PerformanceTestDetail from "../test/PerformanceTestDetail";
import PerformanceTestResult from "../test/PerformanceTestResult";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import CaseComment from "@/business/components/track/case/components/CaseComment";
export default {
name: "FunctionalTestCaseEdit",
components: {
CaseComment,
PerformanceTestResult,
PerformanceTestDetail,
ApiTestResult,
@ -722,6 +734,18 @@ export default {
height: 100vh;
}
.container >>> .el-card__body {
height: calc(100vh - 70px);
}
.comment-card >>> .el-card__header {
padding: 0 20px;
}
.comment-card >>> .el-card__body {
height: calc(100vh - 120px);
}
.case_container > .el-row {
margin-top: 1%;
}

View File

@ -7,7 +7,7 @@ export default {
install(Vue) {
// 登入请求不重定向
let unRedirectUrls = new Set(['signin']);
let unRedirectUrls = new Set(['signin','ldap/signin']);
if (!axios) {
window.console.error('You have to install axios');

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "all",
review: "all"
}
},
image: 'Image'
},
license: {
title: 'Authorization management',
@ -795,88 +796,88 @@ export default {
suffixFormatErr: "The file format does not meet the requirements",
swagger_url_import: "Import using URL",
},
home_page:{
unit_of_measurement:"",
api_count_card:{
home_page: {
unit_of_measurement: "",
api_count_card: {
title: "API count",
},
test_case_count_card:{
test_case_count_card: {
title: "Api test case count",
},
test_scene_count_card:{
test_scene_count_card: {
title: "Scene test case count",
},
schedule_task_count_card:{
schedule_task_count_card: {
title: "Schedule task count",
},
detail_card:{
running:"Running",
not_started:"Not started",
finished:"Finished",
uncoverage:"Uncoverage",
coverage:"Coverage",
unexecute:"Unexecute",
execution_failed:"Execution failed",
execution_pass:"Execution passed",
failed:"Failure",
success:"Success",
rate:{
completion:"Completion rate",
coverage:"Coverage rate",
pass:"Pass rate",
success:"Success rate",
detail_card: {
running: "Running",
not_started: "Not started",
finished: "Finished",
uncoverage: "Uncoverage",
coverage: "Coverage",
unexecute: "Unexecute",
execution_failed: "Execution failed",
execution_pass: "Execution passed",
failed: "Failure",
success: "Success",
rate: {
completion: "Completion rate",
coverage: "Coverage rate",
pass: "Pass rate",
success: "Success rate",
},
},
api_details_card:{
api_details_card: {
title: "API",
this_week_add:"Added {0} this week",
this_week_add: "Added {0} this week",
},
test_case_details_card:{
test_case_details_card: {
title: "Test case",
this_week_add:"Added {0} this week",
this_week_execute:"Executed {0} this week",
executed:"Executed {0} in history",
this_week_add_sm:"Added {0}<br/> this week",
this_week_execute_sm:"Executed {0}<br/> this week",
executed_sm:"Executed {0}<br/> in history",
this_week_add: "Added {0} this week",
this_week_execute: "Executed {0} this week",
executed: "Executed {0} in history",
this_week_add_sm: "Added {0}<br/> this week",
this_week_execute_sm: "Executed {0}<br/> this week",
executed_sm: "Executed {0}<br/> in history",
},
test_scene_details_card:{
test_scene_details_card: {
title: "Scene",
this_week_add:"Added {0} this week",
this_week_execute:"Executed {0} this week",
executed:"Executed {0} in history",
this_week_add_sm:"Added {0}<br/> this week",
this_week_execute_sm:"Executed {0}<br/> this week",
executed_sm:"Executed {0}<br/> in history",
this_week_add: "Added {0} this week",
this_week_execute: "Executed {0} this week",
executed: "Executed {0} in history",
this_week_add_sm: "Added {0}<br/> this week",
this_week_execute_sm: "Executed {0}<br/> this week",
executed_sm: "Executed {0}<br/> in history",
},
schedule_task_details_card:{
schedule_task_details_card: {
title: "Schedule task",
this_week_add:"Added {0} this week",
this_week_execute:"Executed {0} this week",
executed:"Executed {0} in history",
this_week_add_sm:"Added {0}<br/> this week",
this_week_execute_sm:"Executed {0}<br/> this week",
executed_sm:"Executed {0}<br/> in history",
this_week_add: "Added {0} this week",
this_week_execute: "Executed {0} this week",
executed: "Executed {0} in history",
this_week_add_sm: "Added {0}<br/> this week",
this_week_execute_sm: "Executed {0}<br/> this week",
executed_sm: "Executed {0}<br/> in history",
},
failed_case_list:{
failed_case_list: {
title: "Top 10 failure cases about test plan in the past 7 days",
table_coloum:{
table_coloum: {
index: "Ranking",
case_name: "Case name",
case_type: "Case Type",
test_plan: "Test plan",
failure_times: "Failure times",
},
table_value:{
case_type:{
table_value: {
case_type: {
api: "Api case",
scene: "Scenario case",
}
}
},
running_task_list:{
running_task_list: {
title: "Running schedule task",
table_coloum:{
table_coloum: {
index: "Index",
scenario: "Scene",
run_rule: "Rule",
@ -885,6 +886,9 @@ export default {
create_user: "Creator",
update_time: "Update time",
},
confirm: {
close_title: "Do you want to close this scheduled task",
}
}
}
},

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "全部用例",
review: "全部评审"
}
},
image: '镜像'
},
license: {
title: '授权管理',
@ -796,88 +797,88 @@ export default {
suffixFormatErr: "文件格式不符合要求",
swagger_url_import: "使用URL导入",
},
home_page:{
unit_of_measurement:"个",
api_count_card:{
home_page: {
unit_of_measurement: "个",
api_count_card: {
title: "接口数量统计",
},
test_case_count_card:{
test_case_count_card: {
title: "接口用例数量统计",
},
test_scene_count_card:{
test_scene_count_card: {
title: "场景用例数量统计",
},
schedule_task_count_card:{
schedule_task_count_card: {
title: "定时任务数量统计",
},
detail_card:{
running:"进行中",
not_started:"未开始",
finished:"已完成",
uncoverage:"未覆盖",
coverage:"已覆盖",
unexecute:"未执行",
execution_failed:"未通过",
execution_pass:"已通过",
failed:"失败",
success:"成功",
rate:{
completion:"完成率",
coverage:"覆盖率",
pass:"通过率",
success:"成功率",
detail_card: {
running: "进行中",
not_started: "未开始",
finished: "已完成",
uncoverage: "未覆盖",
coverage: "已覆盖",
unexecute: "未执行",
execution_failed: "未通过",
execution_pass: "已通过",
failed: "失败",
success: "成功",
rate: {
completion: "完成率",
coverage: "覆盖率",
pass: "通过率",
success: "成功率",
},
},
api_details_card:{
api_details_card: {
title: "接口",
this_week_add:"本周新增: {0}个",
this_week_add: "本周新增: {0}个",
},
test_case_details_card:{
test_case_details_card: {
title: "用例",
this_week_add:"本周新增: {0}个",
this_week_execute:"本周执行: {0}次",
executed:"历史总执行: {0}次",
this_week_add_sm:"本周新增:<br/>{0}个",
this_week_execute_sm:"本周执行:<br/>{0}次",
executed_sm:"历史总执行:<br/>{0}次",
this_week_add: "本周新增: {0}个",
this_week_execute: "本周执行: {0}次",
executed: "历史总执行: {0}次",
this_week_add_sm: "本周新增:<br/>{0}个",
this_week_execute_sm: "本周执行:<br/>{0}次",
executed_sm: "历史总执行:<br/>{0}次",
},
test_scene_details_card:{
test_scene_details_card: {
title: "场景",
this_week_add:"本周新增: {0}个",
this_week_execute:"本周执行: {0}次",
executed:"历史总执行: {0}次",
this_week_add_sm:"本周新增:<br/>{0}个",
this_week_execute_sm:"本周执行:<br/>{0}次",
executed_sm:"历史总执行:<br/>{0}次",
this_week_add: "本周新增: {0}个",
this_week_execute: "本周执行: {0}次",
executed: "历史总执行: {0}次",
this_week_add_sm: "本周新增:<br/>{0}个",
this_week_execute_sm: "本周执行:<br/>{0}次",
executed_sm: "历史总执行:<br/>{0}次",
},
schedule_task_details_card:{
schedule_task_details_card: {
title: "定时任务",
this_week_add:"本周新增: {0}个",
this_week_execute:"本周执行: {0}次",
executed:"历史总执行: {0}次",
this_week_add_sm:"本周新增:<br/>{0}个",
this_week_execute_sm:"本周执行:<br/>{0}次",
executed_sm:"历史总执行:<br/>{0}次",
this_week_add: "本周新增: {0}个",
this_week_execute: "本周执行: {0}次",
executed: "历史总执行: {0}次",
this_week_add_sm: "本周新增:<br/>{0}个",
this_week_execute_sm: "本周执行:<br/>{0}次",
executed_sm: "历史总执行:<br/>{0}次",
},
failed_case_list:{
failed_case_list: {
title: "过去7天测试计划失败用例TOP 10",
table_coloum:{
table_coloum: {
index: "排名",
case_name: "用例名称",
case_type: "用例类型",
test_plan: "所属测试计划",
failure_times: "失败次数",
},
table_value:{
case_type:{
table_value: {
case_type: {
api: "接口用例",
scene: "场景用例",
}
}
},
running_task_list:{
running_task_list: {
title: "运行中的定时任务",
table_coloum:{
table_coloum: {
index: "序号",
scenario: "场景名称",
run_rule: "运行规则",
@ -886,6 +887,9 @@ export default {
create_user: "创建人",
update_time: "更新时间",
},
confirm: {
close_title: "要关闭这条定时任务吗?",
}
}
}
},

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "全部用例",
review: "全部評審"
}
},
image: '鏡像'
},
license: {
title: '授權管理',
@ -885,6 +886,9 @@ export default {
create_user: "創建人",
update_time: "更新時間",
},
confirm:{
close_title: "要關閉這條定時任務嗎?",
}
}
}
},