Conflicts:
	backend/src/main/resources/db/migration/V78__v1.8_release.sql
This commit is contained in:
wenyann 2021-03-22 19:13:15 +08:00
commit f2e36b64b8
62 changed files with 1445 additions and 1070 deletions

View File

@ -153,8 +153,18 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<artifactId>xstream</artifactId>
<groupId>com.thoughtworks.xstream</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- 排除jmeter中的 xstream 解决bug -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.16</version>
</dependency>
<dependency>
<groupId>org.python</groupId>

View File

@ -64,7 +64,6 @@ public class ApiAutomationController {
public void update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
apiAutomationService.update(request, bodyFiles);
}
@GetMapping("/delete/{id}")
public void delete(@PathVariable String id) {
apiAutomationService.delete(id);

View File

@ -12,6 +12,7 @@ import io.metersphere.api.dto.definition.request.ScheduleInfoSwaggerUrlRequest;
import io.metersphere.api.dto.swaggerurl.SwaggerTaskResult;
import io.metersphere.api.dto.swaggerurl.SwaggerUrlRequest;
import io.metersphere.api.service.ApiDefinitionService;
import io.metersphere.api.service.EsbApiParamService;
import io.metersphere.base.domain.ApiDefinition;
import io.metersphere.base.domain.Schedule;
import io.metersphere.commons.constants.RoleConstants;
@ -24,6 +25,7 @@ import io.metersphere.controller.request.ScheduleRequest;
import io.metersphere.service.CheckPermissionService;
import io.metersphere.service.ScheduleService;
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
@ -45,6 +47,8 @@ public class ApiDefinitionController {
private ApiDefinitionService apiDefinitionService;
@Resource
private CheckPermissionService checkPermissionService;
@Resource
private EsbApiParamService esbApiParamService;
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<ApiDefinitionResult>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiDefinitionRequest request) {
@ -97,6 +101,15 @@ public class ApiDefinitionController {
apiDefinitionService.deleteBatch(ids);
}
@PostMapping(value = "/updateEsbRequest")
public SaveApiDefinitionRequest updateEsbRequest(@RequestBody SaveApiDefinitionRequest request) {
if(StringUtils.equals(request.getMethod(),"ESB")){
//ESB的接口类型数据采用TCP方式去发送并将方法类型改为TCP 并修改发送数据
request = esbApiParamService.updateEsbRequest(request);
}
return request;
}
@PostMapping("/deleteBatchByParams")
public void deleteBatchByParams(@RequestBody ApiBatchRequest request) {
apiDefinitionService.deleteByParams(request);

View File

@ -32,6 +32,7 @@ import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs;
import io.metersphere.commons.constants.LoopConstants;
import io.metersphere.commons.constants.MsTestElementConstants;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.FileUtils;
import io.metersphere.commons.utils.LogUtil;
@ -48,6 +49,7 @@ import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@ -211,6 +213,9 @@ public abstract class MsTestElement {
csvDataSet.setName(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName());
csvDataSet.setProperty("fileEncoding", StringUtils.isEmpty(item.getEncoding()) ? "UTF-8" : item.getEncoding());
if (CollectionUtils.isNotEmpty(item.getFiles())) {
if (new File(BODY_FILE_DIR + "/" + item.getFiles().get(0).getId() + "_" + item.getFiles().get(0).getName()).exists()) {
MSException.throwException(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName() + "[ CSV文件不存在 ]");
}
csvDataSet.setProperty("filename", BODY_FILE_DIR + "/" + item.getFiles().get(0).getId() + "_" + item.getFiles().get(0).getName());
}
csvDataSet.setIgnoreFirstLine(false);

View File

@ -67,7 +67,8 @@ public class MsAssertions extends MsTestElement {
private ResponseAssertion responseAssertion(MsAssertionRegex assertionRegex) {
ResponseAssertion assertion = new ResponseAssertion();
assertion.setEnabled(this.isEnable());
assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : assertionRegex.getDescription());
assertion.setName(assertionRegex.getDescription());
assertion.setName(StringUtils.isNotEmpty(assertionRegex.getDescription()) ? assertionRegex.getDescription() : this.getName());
assertion.setProperty(TestElement.TEST_CLASS, ResponseAssertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("AssertionGui"));
assertion.setAssumeSuccess(assertionRegex.isAssumeSuccess());
@ -92,7 +93,8 @@ public class MsAssertions extends MsTestElement {
private JSONPathAssertion jsonPathAssertion(MsAssertionJsonPath assertionJsonPath) {
JSONPathAssertion assertion = new JSONPathAssertion();
assertion.setEnabled(this.isEnable());
assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSONPathAssertion");
assertion.setName(StringUtils.isNotEmpty(assertionJsonPath.getDescription()) ? assertionJsonPath.getDescription() : this.getName());
/* assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSONPathAssertion");*/
assertion.setProperty(TestElement.TEST_CLASS, JSONPathAssertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPathAssertionGui"));
assertion.setJsonPath(assertionJsonPath.getExpression());
@ -112,7 +114,8 @@ public class MsAssertions extends MsTestElement {
private XPath2Assertion xPath2Assertion(MsAssertionXPath2 assertionXPath2) {
XPath2Assertion assertion = new XPath2Assertion();
assertion.setEnabled(this.isEnable());
assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "XPath2Assertion");
assertion.setName(StringUtils.isNotEmpty(assertionXPath2.getExpression()) ? assertionXPath2.getExpression() : this.getName());
/*assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "XPath2Assertion");*/
assertion.setProperty(TestElement.TEST_CLASS, XPath2Assertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPath2AssertionGui"));
assertion.setXPathString(assertionXPath2.getExpression());
@ -123,7 +126,8 @@ public class MsAssertions extends MsTestElement {
private DurationAssertion durationAssertion(MsAssertionDuration assertionDuration) {
DurationAssertion assertion = new DurationAssertion();
assertion.setEnabled(this.isEnable());
assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "Response In Time: " + assertionDuration.getValue());
assertion.setName("Response In Time: " + assertionDuration.getValue());
/* assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "Response In Time: " + assertionDuration.getValue());*/
assertion.setProperty(TestElement.TEST_CLASS, DurationAssertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("DurationAssertionGui"));
assertion.setAllowedDuration(assertionDuration.getValue());
@ -133,7 +137,8 @@ public class MsAssertions extends MsTestElement {
private JSR223Assertion jsr223Assertion(MsAssertionJSR223 assertionJSR223) {
JSR223Assertion assertion = new JSR223Assertion();
assertion.setEnabled(this.isEnable());
assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSR223Assertion");
assertion.setName(StringUtils.isNotEmpty(assertionJSR223.getDesc()) ? assertionJSR223.getDesc() : this.getName());
/*assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSR223Assertion");*/
assertion.setProperty(TestElement.TEST_CLASS, JSR223Assertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
assertion.setProperty("cacheKey", "true");

View File

@ -70,7 +70,8 @@ public class MsExtract extends MsTestElement {
RegexExtractor extractor = new RegexExtractor();
extractor.setEnabled(this.isEnable());
extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " RegexExtractor");
extractor.setName(StringUtils.isNotEmpty(extractRegex.getVariable()) ? extractRegex.getVariable() : this.getName());
/*extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " RegexExtractor");*/
extractor.setProperty(TestElement.TEST_CLASS, RegexExtractor.class.getName());
extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("RegexExtractorGui"));
extractor.setRefName(extractRegex.getVariable());
@ -88,7 +89,8 @@ public class MsExtract extends MsTestElement {
private XPath2Extractor xPath2Extractor(MsExtractXPath extractXPath, StringJoiner extract) {
XPath2Extractor extractor = new XPath2Extractor();
extractor.setEnabled(this.isEnable());
extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " XPath2Extractor");
extractor.setName(StringUtils.isNotEmpty(extractXPath.getVariable()) ? extractXPath.getVariable() : this.getName());
/*extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " XPath2Extractor");*/
extractor.setProperty(TestElement.TEST_CLASS, XPath2Extractor.class.getName());
extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPath2ExtractorGui"));
extractor.setRefName(extractXPath.getVariable());
@ -103,7 +105,8 @@ public class MsExtract extends MsTestElement {
private JSONPostProcessor jsonPostProcessor(MsExtractJSONPath extractJSONPath, StringJoiner extract) {
JSONPostProcessor extractor = new JSONPostProcessor();
extractor.setEnabled(this.isEnable());
extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " JSONExtractor");
extractor.setName(StringUtils.isNotEmpty(extractJSONPath.getVariable()) ? extractJSONPath.getVariable() : this.getName());
/*extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " JSONExtractor");*/
extractor.setProperty(TestElement.TEST_CLASS, JSONPostProcessor.class.getName());
extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPostProcessorGui"));
extractor.setRefNames(extractJSONPath.getVariable());

View File

@ -3,11 +3,14 @@ package io.metersphere.api.dto.definition.request.unknown;
import com.alibaba.fastjson.annotation.JSONType;
import io.metersphere.api.dto.definition.request.MsTestElement;
import io.metersphere.api.dto.definition.request.ParameterConfig;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.FileUtils;
import io.metersphere.commons.utils.LogUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.jmeter.config.CSVDataSet;
import org.apache.jmeter.save.SaveService;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
@ -15,6 +18,7 @@ import org.apache.jmeter.threads.ThreadGroup;
import org.apache.jorphan.collections.HashTree;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.List;
@ -53,6 +57,13 @@ public class MsJmeterElement extends MsTestElement {
if (!config.isOperating() && scriptWrapper instanceof ThreadGroup && !((ThreadGroup) scriptWrapper).isEnabled()) {
LogUtil.info(((ThreadGroup) scriptWrapper).getName() + "是被禁用线程组不加入执行");
} else {
// CSV数据检查文件路径是否还存在
if (scriptWrapper instanceof CSVDataSet) {
String path = ((CSVDataSet) scriptWrapper).getPropertyAsString("filename");
if (!new File(path).exists()) {
MSException.throwException(StringUtils.isEmpty(((CSVDataSet) scriptWrapper).getName()) ? "CSVDataSet" : ((CSVDataSet) scriptWrapper).getName() + "[ CSV文件不存在 ]");
}
}
if (CollectionUtils.isNotEmpty(hashTree)) {
for (MsTestElement el : hashTree) {
el.toHashTree(elementTree, el.getHashTree(), config);
@ -62,6 +73,7 @@ public class MsJmeterElement extends MsTestElement {
}
} catch (Exception ex) {
ex.printStackTrace();
MSException.throwException(ex.getMessage());
}
}

View File

@ -535,8 +535,12 @@ public class ApiAutomationService {
}
// 生成报告和HashTree
HashTree hashTree = generateHashTree(item, reportId, planEnvMap);
HashTree hashTree = null;
try {
hashTree = generateHashTree(item, reportId, planEnvMap);
} catch (Exception ex) {
MSException.throwException(ex.getMessage());
}
//存储报告
batchMapper.insert(report);
@ -602,7 +606,12 @@ public class ApiAutomationService {
}
ParameterConfig config = new ParameterConfig();
config.setConfig(envConfig);
HashTree hashTree = request.getTestElement().generateHashTree(config);
HashTree hashTree = null;
try {
hashTree = request.getTestElement().generateHashTree(config);
} catch (Exception e) {
MSException.throwException(e.getMessage());
}
// 调用执行方法
APIScenarioReportResult reportResult = createScenarioReport(request.getId(), request.getScenarioId(), request.getScenarioName(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId(),
SessionUtils.getUserId());

View File

@ -145,7 +145,9 @@ public class ApiTestCaseService {
}
public ApiTestCaseWithBLOBs get(String id) {
return apiTestCaseMapper.selectByPrimaryKey(id);
ApiTestCaseWithBLOBs returnBlobs = apiTestCaseMapper.selectByPrimaryKey(id);
esbApiParamService.handleApiEsbParams(returnBlobs);
return returnBlobs;
}
public ApiTestCase create(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
@ -435,6 +437,9 @@ public class ApiTestCaseService {
public Map<String, String> getRequest(ApiTestCaseRequest request) {
List<ApiTestCaseWithBLOBs> list = extApiTestCaseMapper.getRequest(request);
for (ApiTestCaseWithBLOBs model : list) {
esbApiParamService.handleApiEsbParams(model);
}
return list.stream().collect(Collectors.toMap(ApiTestCaseWithBLOBs::getId, ApiTestCaseWithBLOBs::getRequest));
}

View File

@ -10,6 +10,7 @@ import io.metersphere.api.dto.definition.SaveApiDefinitionRequest;
import io.metersphere.api.dto.definition.SaveApiTestCaseRequest;
import io.metersphere.api.dto.definition.request.sampler.MsTCPSampler;
import io.metersphere.api.dto.scenario.KeyValue;
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
import io.metersphere.base.domain.EsbApiParamsExample;
import io.metersphere.base.domain.EsbApiParamsWithBLOBs;
import io.metersphere.base.mapper.EsbApiParamsMapper;
@ -110,25 +111,76 @@ public class EsbApiParamService {
if (esbParamBlobs == null) {
return;
}
try {
if (StringUtils.isNotEmpty(res.getRequest())) {
JSONObject jsonObj = JSONObject.parseObject(res.getRequest());
JSONArray esbDataArray = JSONArray.parseArray(esbParamBlobs.getDataStruct());
jsonObj.put("esbDataStruct", esbDataArray);
JSONArray responseDataArray = JSONArray.parseArray(esbParamBlobs.getResponseDataStruct());
jsonObj.put("backEsbDataStruct", responseDataArray);
JSONObject backedScriptObj = JSONObject.parseObject(esbParamBlobs.getBackedScript());
jsonObj.put("backScript", backedScriptObj);
jsonObj.put("esbFrontedScript", esbParamBlobs.getFrontedScript());
if (StringUtils.isNotEmpty(res.getRequest())) {
JSONObject jsonObj = this.addEsbInfoToJsonString(esbParamBlobs, res.getRequest());
if (jsonObj != null) {
res.setRequest(jsonObj.toJSONString());
}
} catch (Exception e) {
}
// try {
// if (StringUtils.isNotEmpty(res.getRequest())) {
// JSONObject jsonObj = JSONObject.parseObject(res.getRequest());
//
// JSONArray esbDataArray = JSONArray.parseArray(esbParamBlobs.getDataStruct());
// jsonObj.put("esbDataStruct", esbDataArray);
//
// JSONArray responseDataArray = JSONArray.parseArray(esbParamBlobs.getResponseDataStruct());
// jsonObj.put("backEsbDataStruct", responseDataArray);
//
// JSONObject backedScriptObj = JSONObject.parseObject(esbParamBlobs.getBackedScript());
// jsonObj.put("backScript", backedScriptObj);
//
// jsonObj.put("esbFrontedScript", esbParamBlobs.getFrontedScript());
//
// res.setRequest(jsonObj.toJSONString());
// }
// } catch (Exception e) {
// }
}
public void handleApiEsbParams(ApiTestCaseWithBLOBs res) {
EsbApiParamsWithBLOBs esbParamBlobs = this.getEsbParamBLOBsByResourceID(res.getId());
if (esbParamBlobs == null) {
return;
}
if (StringUtils.isNotEmpty(res.getRequest())) {
JSONObject jsonObj = this.addEsbInfoToJsonString(esbParamBlobs, res.getRequest());
if (jsonObj != null) {
res.setRequest(jsonObj.toJSONString());
}
}
}
private JSONObject addEsbInfoToJsonString(EsbApiParamsWithBLOBs esbParamBlobs, String requestString) {
JSONObject returnObj = null;
try {
returnObj = JSONObject.parseObject(requestString);
JSONArray esbDataArray = JSONArray.parseArray(esbParamBlobs.getDataStruct());
if (esbDataArray == null) {
returnObj.put("esbDataStruct", "");
} else {
returnObj.put("esbDataStruct", esbDataArray);
}
JSONArray responseDataArray = JSONArray.parseArray(esbParamBlobs.getResponseDataStruct());
if (responseDataArray == null) {
returnObj.put("backEsbDataStruct", "");
} else {
returnObj.put("backEsbDataStruct", responseDataArray);
}
returnObj.put("esbFrontedScript", esbParamBlobs.getFrontedScript());
JSONObject backedScriptObj = JSONObject.parseObject(esbParamBlobs.getBackedScript());
returnObj.put("backScript", backedScriptObj);
} catch (Exception e) {
}
return returnObj;
}
public void handleApiEsbParams(ApiTestCaseResult res) {
@ -136,23 +188,30 @@ public class EsbApiParamService {
if (esbParamBlobs == null) {
return;
}
try {
if (StringUtils.isNotEmpty(res.getRequest())) {
JSONObject jsonObj = JSONObject.parseObject(res.getRequest());
JSONArray esbDataArray = JSONArray.parseArray(esbParamBlobs.getDataStruct());
jsonObj.put("esbDataStruct", esbDataArray);
jsonObj.put("esbFrontedScript", esbParamBlobs.getFrontedScript());
JSONArray responseDataArray = JSONArray.parseArray(esbParamBlobs.getResponseDataStruct());
jsonObj.put("backEsbDataStruct", responseDataArray);
if (StringUtils.isNotEmpty(res.getRequest())) {
JSONObject jsonObj = this.addEsbInfoToJsonString(esbParamBlobs, res.getRequest());
if (jsonObj != null) {
res.setRequest(jsonObj.toJSONString());
}
} catch (Exception e) {
}
// try {
// if (StringUtils.isNotEmpty(res.getRequest())) {
// JSONObject jsonObj = JSONObject.parseObject(res.getRequest());
// JSONArray esbDataArray = JSONArray.parseArray(esbParamBlobs.getDataStruct());
// jsonObj.put("esbDataStruct", esbDataArray);
// jsonObj.put("esbFrontedScript", esbParamBlobs.getFrontedScript());
//
// JSONArray responseDataArray = JSONArray.parseArray(esbParamBlobs.getResponseDataStruct());
// jsonObj.put("backEsbDataStruct", responseDataArray);
//
// res.setRequest(jsonObj.toJSONString());
// }
// } catch (Exception e) {
// }
}
public SaveApiDefinitionRequest handleEsbRequest(SaveApiDefinitionRequest request) {
public SaveApiDefinitionRequest updateEsbRequest(SaveApiDefinitionRequest request) {
try {
//修改reqeust.parameters
//用户交互感受ESB的发送数据以报文模板为主框架同时前端不再有key-value的表格数据填充
@ -162,8 +221,27 @@ public class EsbApiParamService {
MsTCPSampler tcpSampler = (MsTCPSampler) request.getRequest();
List<KeyValue> keyValueList = this.genKeyValueListByDataStruct(tcpSampler, request.getEsbDataStruct());
tcpSampler.setParameters(keyValueList);
request.setRequest(tcpSampler);
}
//更新EsbApiParams类
// EsbApiParamsWithBLOBs esbApiParams = this.createEsbApiParam(request.getId(), request.getEsbDataStruct(), request.getBackEsbDataStruct(), request.getBackScript());
} catch (Exception e) {
e.printStackTrace();
}
return request;
}
public SaveApiDefinitionRequest handleEsbRequest(SaveApiDefinitionRequest request) {
try {
//修改reqeust.parameters
//用户交互感受ESB的发送数据以报文模板为主框架同时前端不再有key-value的表格数据填充
//业务逻辑 发送ESB接口数据时使用报文模板中的数据同时报文模板中的${取值}目的是为了拼接数据结构(比如xml的子节点)
//代码实现: 此处打算解析前端传来的EsbDataStruct数据结构将数据结构按照报文模板中的${取值}为最高优先级组装keyValue对象这样Jmeter会自动拼装为合适的xml
if (StringUtils.isNotEmpty(request.getEsbDataStruct())) {
MsTCPSampler tcpSampler = (MsTCPSampler) request.getRequest();
tcpSampler.setProtocol("ESB");
List<KeyValue> keyValueList = this.genKeyValueListByDataStruct(tcpSampler, request.getEsbDataStruct());
tcpSampler.setParameters(keyValueList);
}
//更新EsbApiParams类
EsbApiParamsWithBLOBs esbApiParams = this.createEsbApiParam(request.getId(), request.getEsbDataStruct(), request.getBackEsbDataStruct(), request.getBackScript());
} catch (Exception e) {
@ -172,6 +250,43 @@ public class EsbApiParamService {
return request;
}
// public RunDefinitionRequest handleEsbRequest(RunDefinitionRequest request) {
// try {
// //修改reqeust.parameters
// //用户交互感受ESB的发送数据以报文模板为主框架同时前端不再有key-value的表格数据填充
// //业务逻辑 发送ESB接口数据时使用报文模板中的数据同时报文模板中的${取值}目的是为了拼接数据结构(比如xml的子节点)
// //代码实现: 此处打算解析前端传来的EsbDataStruct数据结构将数据结构按照报文模板中的${取值}为最高优先级组装keyValue对象这样Jmeter会自动拼装为合适的xml
// if (StringUtils.isNotEmpty(request.getEsbDataStruct())) {
// if(request.getTestElement() instanceof MsTestPlan){
// MsTestPlan testPlan = (MsTestPlan)request.getTestElement();
// for (MsTestElement testElement: testPlan.getHashTree()) {
// if(testElement instanceof MsThreadGroup){
// MsThreadGroup group = (MsThreadGroup)testElement;
// for (MsTestElement groupElement: testPlan.getHashTree()) {
// if(groupElement instanceof MsScenario){
// MsScenario scenario = (MsScenario)groupElement;
// for (MsTestElement scenarioElement: scenario.getHashTree()) {
// if(scenarioElement instanceof MsTCPSampler){
// MsTCPSampler tcpSampler = (MsTCPSampler) scenarioElement;
// List<KeyValue> keyValueList = this.genKeyValueListByDataStruct(tcpSampler, request.getEsbDataStruct());
// tcpSampler.setParameters(keyValueList);
// }
// }
// }
// }
// }
// }
// }
// }
//
// //更新EsbApiParams类
// EsbApiParamsWithBLOBs esbApiParams = this.createEsbApiParam(request.getId(), request.getEsbDataStruct(), request.getBackEsbDataStruct(), request.getBackScript());
// } catch (Exception e) {
// e.printStackTrace();
// }
// return request;
// }
//通过esb数据结构生成keyValue集合以及发送参数
private List<KeyValue> genKeyValueListByDataStruct(MsTCPSampler tcpSampler, String esbDataStruct) {
List<KeyValue> keyValueList = new ArrayList<>();

View File

@ -1,18 +1,19 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseTest implements Serializable {
private String id;
private String testCaseId;
private String testId;
private String testType;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -104,76 +104,6 @@ public class TestCaseTestExample {
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 andTestCaseIdIsNull() {
addCriterion("test_case_id is null");
return (Criteria) this;
@ -383,6 +313,126 @@ public class TestCaseTestExample {
addCriterion("test_type not between", value1, value2, "testType");
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 {

View File

@ -2,30 +2,21 @@ package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseTest;
import io.metersphere.base.domain.TestCaseTestExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseTestMapper {
long countByExample(TestCaseTestExample example);
int deleteByExample(TestCaseTestExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseTest record);
int insertSelective(TestCaseTest record);
List<TestCaseTest> selectByExample(TestCaseTestExample example);
TestCaseTest selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseTest record, @Param("example") TestCaseTestExample example);
int updateByExample(@Param("record") TestCaseTest record, @Param("example") TestCaseTestExample example);
int updateByPrimaryKeySelective(TestCaseTest record);
int updateByPrimaryKey(TestCaseTest record);
}

View File

@ -1,201 +1,175 @@
<?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.TestCaseTestMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseTest">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="test_case_id" jdbcType="VARCHAR" property="testCaseId"/>
<result column="test_id" jdbcType="VARCHAR" property="testId"/>
<result column="test_type" jdbcType="VARCHAR" property="testType"/>
</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>
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseTest">
<result column="test_case_id" jdbcType="VARCHAR" property="testCaseId" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="test_type" jdbcType="VARCHAR" property="testType" />
<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>
</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>
</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>
</where>
</sql>
<sql id="Base_Column_List">
id, test_case_id, test_id, test_type
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseTestExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</trim>
</if>
<include refid="Base_Column_List"/>
from test_case_test
<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 test_case_test
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from test_case_test
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseTestExample">
delete from test_case_test
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseTest">
insert into test_case_test (id, test_case_id, test_id,
test_type)
values (#{id,jdbcType=VARCHAR}, #{testCaseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR},
#{testType,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseTest">
insert into test_case_test
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testCaseId != null">
test_case_id,
</if>
<if test="testId != null">
test_id,
</if>
<if test="testType != null">
test_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="testCaseId != null">
#{testCaseId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="testType != null">
#{testType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseTestExample"
resultType="java.lang.Long">
select count(*) from test_case_test
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_test
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.testCaseId != null">
test_case_id = #{record.testCaseId,jdbcType=VARCHAR},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
</if>
<if test="record.testType != null">
test_type = #{record.testType,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_test
set id = #{record.id,jdbcType=VARCHAR},
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
test_case_id, test_id, test_type, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseTestExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseTestExample">
delete from test_case_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseTest">
insert into test_case_test (test_case_id, test_id, test_type,
create_time, update_time)
values (#{testCaseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{testType,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseTest">
insert into test_case_test
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="testCaseId != null">
test_case_id,
</if>
<if test="testId != null">
test_id,
</if>
<if test="testType != null">
test_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="testCaseId != null">
#{testCaseId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="testType != null">
#{testType,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.TestCaseTestExample" resultType="java.lang.Long">
select count(*) from test_case_test
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_test
<set>
<if test="record.testCaseId != null">
test_case_id = #{record.testCaseId,jdbcType=VARCHAR},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
test_type = #{record.testType,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseTest">
update test_case_test
<set>
<if test="testCaseId != null">
test_case_id = #{testCaseId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
</if>
<if test="testType != null">
test_type = #{testType,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseTest">
update test_case_test
set test_case_id = #{testCaseId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
test_type = #{testType,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</if>
<if test="record.testType != null">
test_type = #{record.testType,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 test_case_test
set test_case_id = #{record.testCaseId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
test_type = #{record.testType,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>
</mapper>

View File

@ -3,6 +3,7 @@ package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.FileMetadata;
import io.metersphere.base.domain.LoadTest;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.performance.request.QueryProjectFileRequest;
import io.metersphere.performance.request.QueryTestPlanRequest;
import org.apache.ibatis.annotations.Param;
@ -18,6 +19,7 @@ public interface ExtLoadTestMapper {
LoadTest getNextNum(@Param("projectId") String projectId);
List<FileMetadata> getProjectFiles(@Param("projectId") String projectId, @Param("loadTypes") List<String> loadType);
List<FileMetadata> getProjectFiles(@Param("projectId") String projectId, @Param("loadTypes") List<String> loadType,
@Param("request") QueryProjectFileRequest request);
}

View File

@ -145,5 +145,8 @@
#{id}
</foreach>
AND project_id = #{projectId,jdbcType=VARCHAR}
<if test="request.name!=null">
AND file_metadata.name LIKE CONCAT('%', #{request.name}, '%')
</if>
</select>
</mapper>

View File

@ -65,7 +65,7 @@ public interface ExtTestCaseMapper {
long countRelevanceCreatedThisWeek(@Param("projectId") String projectId,@Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
List<TrackCountResult> countCoverage(@Param("projectId") String projectId);
int countCoverage(@Param("projectId") String projectId);
List<TrackCountResult> countFuncMaintainer(@Param("projectId") String projectId);

View File

@ -307,7 +307,7 @@
or test_case.tags like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.createTime >0">
AND test_case.create_time >= #{request.createTime}
and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >= #{request.createTime})
</if>
<if test="request.nodeIds != null and request.nodeIds.size() > 0">
and test_case.node_id in
@ -320,10 +320,10 @@
</if>
<include refid="filters"/>
<if test="request.caseCoverage == 'uncoverage' ">
and test_case.test_id is null and test_case.type != 'functional'
and test_case.id not in (select distinct test_case_test.test_case_id from test_case_test)
</if>
<if test="request.caseCoverage == 'coverage' ">
and test_case.test_id is not null and test_case.type != 'functional'
and test_case.id in (select distinct test_case_test.test_case_id from test_case_test)
</if>
</where>
</sql>
@ -343,17 +343,19 @@
</select>
<select id="countRelevance" resultType="io.metersphere.track.response.TrackCountResult">
SELECT type AS groupField, count(id) AS countNumber FROM test_case WHERE test_case.project_id = #{projectId} GROUP BY test_case.type
SELECT test_case_test.test_type AS groupField, count(test_case_test.test_case_id) AS countNumber
FROM test_case join test_case_test on test_case.id = test_case_test.test_case_id
WHERE test_case.project_id = #{projectId} GROUP BY test_case_test.test_type
</select>
<select id="countRelevanceCreatedThisWeek" resultType="java.lang.Long">
SELECT count(id) AS countNumber FROM test_case WHERE test_case.project_id = #{projectId}
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
SELECT count(distinct test_case_test.test_case_id) AS countNumber FROM test_case join test_case_test on test_case.id = test_case_test.test_case_id
WHERE test_case.project_id = #{projectId}
AND test_case_test.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
</select>
<select id="countCoverage" resultType="io.metersphere.track.response.TrackCountResult">
SELECT count(test_case.id) AS countNumber,
if(test_case.test_id is null,"uncoverage","coverage") AS groupField
FROM test_case WHERE test_case.project_id=#{projectId} and test_case.type != 'functional' GROUP BY groupField
<select id="countCoverage" resultType="int">
select count(test_case.id) from test_case where test_case.project_id = #{projectId}
and test_case.id in (select distinct test_case_test.test_case_id from test_case_test)
</select>
<select id="countFuncMaintainer" resultType="io.metersphere.track.response.TrackCountResult">
select count(tc.id) as countNumber, user.name as groupField from test_case tc right join user on tc.maintainer = user.id
@ -362,7 +364,7 @@
</select>
<select id="countRelevanceMaintainer" resultType="io.metersphere.track.response.TrackCountResult">
select count(tc.id) as countNumber, user.name as groupField from test_case tc right join user on tc.maintainer = user.id
where tc.project_id = #{projectId} and tc.test_id is not null
where tc.project_id = #{projectId} and tc.id in (select distinct test_case_test.test_case_id from test_case_test)
group by tc.maintainer
</select>
<select id="getTestPlanBug" resultType="int">

View File

@ -1,6 +1,7 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.track.dto.TestCaseReportStatusResultDTO;
import io.metersphere.track.dto.TestCaseTestDTO;
import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
import org.apache.ibatis.annotations.Param;
@ -47,4 +48,6 @@ public interface ExtTestPlanTestCaseMapper {
List<String> getExecResultByPlanId(String planId);
List<TestPlanCaseDTO> listForMinder(@Param("planId") String planId);
List<TestCaseTestDTO> listTestCaseTest(@Param("caseId") String caseId);
}

View File

@ -422,6 +422,9 @@
pc.plan_id = #{planId}
</where>
</select>
<select id="listTestCaseTest" resultType="io.metersphere.track.dto.TestCaseTestDTO">
select * from test_case_test where test_case_id = #{caseId};
</select>
<update id="updateTestCaseStates" parameterType="java.lang.String">
update test_plan_test_case

View File

@ -120,12 +120,13 @@ public class PerformanceTestController {
return performanceTestService.exportJmx(fileIds);
}
@GetMapping("/project/{loadType}/{projectId}/{goPage}/{pageSize}")
@PostMapping("/project/{loadType}/{projectId}/{goPage}/{pageSize}")
public Pager<List<FileMetadata>> getProjectFiles(@PathVariable String projectId, @PathVariable String loadType,
@PathVariable int goPage, @PathVariable int pageSize) {
@PathVariable int goPage, @PathVariable int pageSize,
@RequestBody QueryProjectFileRequest request) {
checkPermissionService.checkProjectOwner(projectId);
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, performanceTestService.getProjectFiles(projectId, loadType));
return PageUtils.setPageInfo(page, performanceTestService.getProjectFiles(projectId, loadType, request));
}
@PostMapping("/delete")

View File

@ -19,8 +19,8 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
public abstract class AbstractEngine implements Engine {
protected String JMETER_IMAGE;
@ -106,17 +106,20 @@ public abstract class AbstractEngine implements Engine {
String loadConfiguration = t.getLoadConfiguration();
JSONArray jsonArray = JSON.parseArray(loadConfiguration);
for (int i = 0; i < jsonArray.size(); i++) {
if (jsonArray.get(i) instanceof Map) {
JSONObject o = jsonArray.getJSONObject(i);
if (StringUtils.equals(o.getString("key"), "TargetLevel")) {
s = o.getInteger("value");
break;
}
}
if (jsonArray.get(i) instanceof List) {
JSONArray o = jsonArray.getJSONArray(i);
for (int j = 0; j < o.size(); j++) {
JSONObject b = o.getJSONObject(j);
List<JSONObject> enabledConfig = o.stream()
.filter(b -> {
JSONObject c = JSON.parseObject(b.toString());
if (StringUtils.equals(c.getString("deleted"), "true")) {
return false;
}
return !StringUtils.equals(c.getString("enabled"), "false");
})
.map(b -> JSON.parseObject(b.toString()))
.collect(Collectors.toList());
for (JSONObject b : enabledConfig) {
if (StringUtils.equals(b.getString("key"), "TargetLevel")) {
s += b.getInteger("value");
break;

View File

@ -4,5 +4,5 @@ import lombok.Data;
@Data
public class QueryProjectFileRequest {
private String filename;
private String name;
}

View File

@ -561,19 +561,23 @@ public class PerformanceTestService {
}
}
public List<FileMetadata> getProjectFiles(String projectId, String loadType) {
public List<FileMetadata> getProjectFiles(String projectId, String loadType, QueryProjectFileRequest request) {
List<String> loadTypes = new ArrayList<>();
loadTypes.add(StringUtils.upperCase(loadType));
if (StringUtils.equalsIgnoreCase(loadType, "resource")) {
loadTypes.add(FileType.CSV.name());
loadTypes.add(FileType.JAR.name());
List<String> fileTypes = Arrays.stream(FileType.values())
.filter(fileType -> !fileType.equals(FileType.JMX))
.map(FileType::name)
.collect(Collectors.toList());
loadTypes.addAll(fileTypes);
}
if (StringUtils.equalsIgnoreCase(loadType, "all")) {
loadTypes.add(FileType.CSV.name());
loadTypes.add(FileType.JAR.name());
loadTypes.add(FileType.JMX.name());
List<String> fileTypes = Arrays.stream(FileType.values())
.map(FileType::name)
.collect(Collectors.toList());
loadTypes.addAll(fileTypes);
}
return extLoadTestMapper.getProjectFiles(projectId, loadTypes);
return extLoadTestMapper.getProjectFiles(projectId, loadTypes, request);
}
public List<LoadTestExportJmx> exportJmx(List<String> fileIds) {

View File

@ -7,6 +7,7 @@ import io.metersphere.commons.utils.SessionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.ExpiredCredentialsException;
import org.apache.shiro.web.filter.authc.AnonymousFilter;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.core.env.Environment;
@ -84,7 +85,7 @@ public class CsrfFilter extends AnonymousFilter {
Environment env = CommonBeanFactory.getBean(Environment.class);
long timeout = env.getProperty("session.timeout", Long.class, 43200L);
if (Math.abs(System.currentTimeMillis() - signatureTime) > timeout * 1000) {
throw new RuntimeException("expired token");
throw new ExpiredCredentialsException("expired token");
}
if (!StringUtils.equals(SessionUtils.getUserId(), signatureArray[0])) {
throw new RuntimeException("Please check csrf token.");

View File

@ -202,8 +202,8 @@ public class FileService {
FileMetadataExample example = new FileMetadataExample();
FileMetadataExample.Criteria criteria = example.createCriteria();
criteria.andProjectIdEqualTo(projectId);
if (!StringUtils.isEmpty(request.getFilename())) {
criteria.andNameEqualTo(request.getFilename());
if (!StringUtils.isEmpty(request.getName())) {
criteria.andNameEqualTo(request.getName());
}
return fileMetadataMapper.selectByExample(example);
}

View File

@ -173,7 +173,7 @@ public class ProjectService {
if (files != null) {
for (MultipartFile file : files) {
QueryProjectFileRequest request = new QueryProjectFileRequest();
request.setFilename(file.getOriginalFilename());
request.setName(file.getOriginalFilename());
if (CollectionUtils.isEmpty(fileService.getProjectFiles(projectId, request))) {
fileService.saveFile(file, projectId);
} else {

View File

@ -1,11 +1,13 @@
package io.metersphere.track.controller;
import io.metersphere.base.domain.TestCase;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.performance.base.ChartsData;
import io.metersphere.track.response.BugStatustics;
import io.metersphere.track.response.TrackCountResult;
import io.metersphere.track.response.TrackStatisticsDTO;
import io.metersphere.track.service.TestCaseService;
import io.metersphere.track.service.TrackService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
@ -25,6 +27,8 @@ public class TrackController {
@Resource
private TrackService trackService;
@Resource
private TestCaseService testCaseService;
@GetMapping("/count/{projectId}")
public TrackStatisticsDTO getTrackCount(@PathVariable String projectId) {
@ -63,10 +67,11 @@ public class TrackController {
long size = trackService.countRelevanceCreatedThisWeek(projectId);
statistics.setThisWeekAddedCount(size);
List<TrackCountResult> coverageResults = trackService.countCoverage(projectId);
statistics.countCoverage(coverageResults);
long total = statistics.getUncoverageCount() + statistics.getCoverageCount();
List<TestCase> list = testCaseService.getTestCaseByProjectId(projectId);
long total = list.size();
int coverage = trackService.countCoverage(projectId);
statistics.setCoverageCount(coverage);
statistics.setUncoverageCount(total - coverage);
if (total != 0) {
float coverageRageNumber = (float) statistics.getCoverageCount() * 100 / total;

View File

@ -0,0 +1,11 @@
package io.metersphere.track.dto;
import io.metersphere.base.domain.TestCaseTest;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestCaseTestDTO extends TestCaseTest {
private String testName;
}

View File

@ -3,6 +3,8 @@ package io.metersphere.track.dto;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
@ -18,4 +20,6 @@ public class TestPlanCaseDTO extends TestCaseWithBLOBs {
private String reportId;
private String model;
private String projectName;
private List<TestCaseTestDTO> list;
}

View File

@ -664,8 +664,9 @@ public class TestCaseService {
selecteds.forEach(id -> {
test.setTestType(id.get(0));
test.setTestId(id.get(1));
test.setId(UUID.randomUUID().toString());
test.setTestCaseId(request.getId());
test.setCreateTime(System.currentTimeMillis());
test.setUpdateTime(System.currentTimeMillis());
testCaseTestMapper.insert(test);
});
}
@ -707,7 +708,8 @@ public class TestCaseService {
selecteds.forEach(id -> {
test.setTestType(id.get(0));
test.setTestId(id.get(1));
test.setId(UUID.randomUUID().toString());
test.setCreateTime(System.currentTimeMillis());
test.setUpdateTime(System.currentTimeMillis());
test.setTestCaseId(request.getId());
testCaseTestMapper.insert(test);
});
@ -779,4 +781,10 @@ public class TestCaseService {
}
});
}
public List<TestCase> getTestCaseByProjectId(String projectId) {
TestCaseExample example = new TestCaseExample();
example.createCriteria().andProjectIdEqualTo(projectId);
return testCaseMapper.selectByExample(example);
}
}

View File

@ -1,11 +1,8 @@
package io.metersphere.track.service;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.TestPlan;
import io.metersphere.base.domain.TestPlanTestCaseExample;
import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs;
import io.metersphere.base.domain.User;
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.user.SessionUser;
@ -14,6 +11,7 @@ import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.service.UserService;
import io.metersphere.track.dto.TestCaseTestDTO;
import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
@ -42,6 +40,14 @@ public class TestPlanTestCaseService {
@Resource
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
@Resource
private TestCaseTestMapper testCaseTestMapper;
@Resource
private LoadTestMapper loadTestMapper;
@Resource
private ApiTestCaseMapper apiTestCaseMapper;
@Resource
private ApiScenarioMapper apiScenarioMapper;
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
@ -134,7 +140,40 @@ public class TestPlanTestCaseService {
}
public TestPlanCaseDTO get(String testplanTestCaseId) {
return extTestPlanTestCaseMapper.get(testplanTestCaseId);
TestPlanCaseDTO testPlanCaseDTO = extTestPlanTestCaseMapper.get(testplanTestCaseId);
List<TestCaseTestDTO> testCaseTestDTOS = extTestPlanTestCaseMapper.listTestCaseTest(testPlanCaseDTO.getCaseId());
testCaseTestDTOS.forEach(dto -> {
setTestName(dto);
});
testPlanCaseDTO.setList(testCaseTestDTOS);
return testPlanCaseDTO;
}
private void setTestName(TestCaseTestDTO dto) {
String type = dto.getTestType();
String id = dto.getTestId();
switch (type) {
case "performance":
LoadTest loadTest = loadTestMapper.selectByPrimaryKey(id);
if (loadTest != null) {
dto.setTestName(loadTest.getName());
}
break;
case "testcase":
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseMapper.selectByPrimaryKey(id);
if (apiTestCaseWithBLOBs != null) {
dto.setTestName(apiTestCaseWithBLOBs.getName());
}
break;
case "automation":
ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id);
if (apiScenarioWithBLOBs != null) {
dto.setTestName(apiScenarioWithBLOBs.getName());
}
break;
default:
break;
}
}
public void deleteTestCaseBath(TestPlanCaseBatchRequest request) {

View File

@ -80,7 +80,7 @@ public class TrackService {
}
}
public List<TrackCountResult> countCoverage(String projectId) {
public int countCoverage(String projectId) {
return extTestCaseMapper.countCoverage(projectId);
}

@ -1 +1 @@
Subproject commit 2fb883803fa9909162ce9f6fab8a15b63af66923
Subproject commit 493663be7c000ceef5913783788def1f43b15b2f

View File

@ -52,27 +52,21 @@ create table test_case_review_load
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;
-- test_resource_pool add column
ALTER TABLE test_resource_pool
ADD heap VARCHAR(200) NULL;
ALTER TABLE test_resource_pool
ADD gc_algo VARCHAR(200) NULL;
ALTER TABLE test_resource_pool ADD heap VARCHAR(200) NULL;
ALTER TABLE test_resource_pool ADD gc_algo VARCHAR(200) NULL;
-- create tale api_document_share
CREATE TABLE IF NOT EXISTS `api_document_share`
(
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Api Document Share Info ID',
`create_time` BIGINT(13) NOT NULL COMMENT 'Create timestamp',
`create_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`update_time` BIGINT(13) NOT NULL COMMENT 'last visit timestamp',
`share_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'single or batch',
`share_api_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'APiDefinition.id (JSONArray format. Order by TreeSet)',
PRIMARY KEY (`id`) USING BTREE,
INDEX `share_type` (`share_type`) USING BTREE,
INDEX `share_api_id` (`share_api_id`(125)) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci
ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `api_document_share` (
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Api Document Share Info ID',
`create_time` BIGINT ( 13 ) NOT NULL COMMENT 'Create timestamp',
`create_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`update_time` BIGINT ( 13 ) NOT NULL COMMENT 'last visit timestamp',
`share_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'single or batch',
`share_api_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'APiDefinition.id (JSONArray format. Order by TreeSet)',
PRIMARY KEY (`id`) USING BTREE,
INDEX `share_type`(`share_type`) USING BTREE,
INDEX `share_api_id`(`share_api_id`(125)) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- swagger_url_project
alter table swagger_url_project
@ -97,70 +91,61 @@ alter table test_plan_api_scenario
change environment_id environment longtext null comment 'Relevance environment';
-- add Original state
alter table api_definition
add original_state varchar(64);
alter table api_scenario
add original_state varchar(64);
update api_definition
set original_state='Underway';
update api_scenario
set original_state='Underway';
alter table api_definition add original_state varchar(64);
alter table api_scenario add original_state varchar(64);
update api_definition set original_state='Underway';
update api_scenario set original_state='Underway';
-- alter test_case_review_scenario
alter table test_case_review_scenario
modify environment longtext null;
alter table test_case_review_scenario modify environment longtext null;
-- schedule table add project_id column
alter table schedule
add project_id varchar(50) NULL;
alter table schedule add project_id varchar(50) NULL;
-- set values for new colums of exitsting data
update schedule sch inner join test_plan testPlan on
testPlan.id = sch.resource_id
set sch.project_id = testPlan.project_id
where sch.resource_id = testPlan.id;
testPlan.id = sch.resource_id
set sch.project_id = testPlan.project_id where
sch.resource_id = testPlan.id;
update schedule sch inner join swagger_url_project sup on
sup.id = sch.resource_id
set sch.project_id = sup.project_id
where sch.resource_id = sup.id;
sup.id = sch.resource_id
set sch.project_id = sup.project_id where
sch.resource_id = sup.id;
update schedule sch inner join api_scenario apiScene on
apiScene.id = sch.resource_id
set sch.project_id = apiScene.project_id
where sch.resource_id = apiScene.id;
apiScene.id = sch.resource_id
set sch.project_id = apiScene.project_id where
sch.resource_id = apiScene.id;
update schedule sch inner join load_test ldt on
ldt.id = sch.resource_id
set sch.project_id = ldt.project_id
where sch.resource_id = ldt.id;
ldt.id = sch.resource_id
set sch.project_id = ldt.project_id where
sch.resource_id = ldt.id;
update schedule sch inner join api_test apiTest on
apiTest.id = sch.resource_id
set sch.project_id = apiTest.project_id
where sch.resource_id = apiTest.id;
apiTest.id = sch.resource_id
set sch.project_id = apiTest.project_id where
sch.resource_id = apiTest.id;
-- schedule table add name column
alter table schedule
add name varchar(100) NULL;
alter table schedule add name varchar(100) NULL;
-- set values for new colums of exitsting data
update schedule sch inner join api_scenario apiScene on
apiScene.id = sch.resource_id
set sch.name = apiScene.name;
apiScene.id = sch.resource_id
set sch.name = apiScene.name;
update schedule sch inner join test_plan testPlan on
testPlan.id = sch.resource_id
set sch.name = testPlan.name;
testPlan.id = sch.resource_id
set sch.name = testPlan.name;
update schedule sch inner join load_test ldt on
ldt.id = sch.resource_id
set sch.name = ldt.name;
ldt.id = sch.resource_id
set sch.name = ldt.name;
update schedule sch inner join api_test apiTest on
apiTest.id = sch.resource_id
set sch.name = apiTest.name;
apiTest.id = sch.resource_id
set sch.name = apiTest.name;
update schedule sch inner join swagger_url_project sup on
sup.id = sch.resource_id
set sch.name = LEFT(SUBSTRING_INDEX(sup.swagger_url, '/', 3), 100);
sup.id = sch.resource_id
set sch.name = LEFT(SUBSTRING_INDEX(sup.swagger_url, '/', 3), 100);
-- delete an unused colum
alter table schedule
drop column custom_data;
alter table schedule drop column custom_data;
-- add sort column
alter table load_test_file
add sort int default 0;
alter table load_test_file add sort int default 0;
alter table file_metadata
add project_id VARCHAR(50) null;
@ -199,6 +184,8 @@ CREATE TABLE IF NOT EXISTS test_case_test
test_case_id varchar(50) null,
test_id varchar(50) null,
test_type varchar(50) null,
create_time bigint(13) null,
update_time bigint(13) null,
UNIQUE KEY test_case_test_unique_key (test_case_id, test_id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='测试用例和关联用例的关系表';

View File

@ -69,7 +69,7 @@
<el-table-column v-if="item.id == 'tags'" prop="tags" min-width="120px"
:label="$t('api_test.automation.tag')" :key="index">
<template v-slot:default="scope">
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" :content="itemName" style="margin-left: 5px"/>
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" :content="itemName" :show-tooltip="true" tooltip style="margin-left: 5px"/>
</template>
</el-table-column>
<el-table-column v-if="item.id == 'userId'" prop="userId" min-width="120px"
@ -758,7 +758,6 @@
z-index: auto !important;
}
/deep/ .el-table__fixed-right {
height: 100% !important;
}

View File

@ -8,7 +8,8 @@
<env-select :project-ids="projectIds" :env-map="envMap" @close="visible = false"
ref="envSelect" @setProjectEnvMap="setProjectEnvMap" :project-list="projectList"/>
<el-button type="primary" slot="reference" size="mini" style="margin-top: 2px;">
环境配置<i class="el-icon-caret-bottom el-icon--right"></i>
{{ $t('api_test.definition.request.run_env') }}
<i class="el-icon-caret-bottom el-icon--right"></i>
</el-button>
</el-popover>
</template>

View File

@ -50,6 +50,7 @@ import MsMainContainer from "../../../../common/components/MsMainContainer";
import ScenarioRelevanceApiList from "./RelevanceApiList";
import RelevanceDialog from "../../../../track/plan/view/comonents/base/RelevanceDialog";
import TestCaseRelevanceBase from "@/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase";
import {getUUID} from "@/common/js/utils";
export default {
name: "ApiRelevance",
@ -97,6 +98,29 @@ export default {
apiCases.forEach((item) => {
item.request = response.data[item.id];
item.projectId = this.projectId;
let requestObj = JSON.parse(item.request);
if(requestObj.esbDataStruct != null ){
//ESB
let param = {};
param.request = requestObj;
param.method = "ESB";
param.esbDataStruct = JSON.stringify(requestObj.esbDataStruct);
if(requestObj.backEsbDataStruct != null){
param.backEsbDataStruct = JSON.stringify(requestObj.backEsbDataStruct);
}else{
param.backEsbDataStruct = "";
}
this.$post("/api/definition/updateEsbRequest", param, response => {
if(response.data!=null){
if(response.data.request!=null){
item.request = JSON.stringify(response.data.request);
param.method = "TCP";
}
}
})
}
});
this.$emit('save', apiCases, 'CASE', reference);
this.$refs.baseRelevance.close();

View File

@ -28,10 +28,10 @@
<div class="header-right" @click.stop>
<slot name="message"></slot>
<el-tooltip :content="$t('test_resource_pool.enable_disable')" placement="top" v-if="showBtn">
<el-switch v-model="data.enable" class="enable-switch" size="mini"/>
<el-switch v-model="data.enable" class="enable-switch" size="mini" :disabled="data.disabled"/>
</el-tooltip>
<slot name="button"></slot>
<step-extend-btns style="display: contents" :data="data" @copy="copyRow" @remove="remove" @openScenario="openScenario" v-if="showBtn"/>
<step-extend-btns style="display: contents" :data="data" @copy="copyRow" @remove="remove" @openScenario="openScenario" v-if="showBtn && !data.disabled"/>
</div>
</div>

View File

@ -99,7 +99,7 @@
protocol: "",
platforms: [
{
name: 'Metersphere',
name: 'MeterSphere',
value: 'Metersphere',
tip: this.$t('api_test.api_import.ms_tip'),
exportTip: this.$t('api_test.api_import.ms_export_tip'),
@ -113,14 +113,14 @@
suffixes: new Set(['json'])
},
{
name: 'Jmeter',
name: 'JMeter',
value: 'Jmeter',
tip: this.$t('api_test.api_import.jmeter_tip'),
exportTip: this.$t('api_test.api_import.jmeter_export_tip'),
suffixes: new Set(['jmx'])
},
{
name: 'Har',
name: 'HAR',
value: 'Har',
tip: this.$t('api_test.api_import.har_tip'),
exportTip: this.$t('api_test.api_import.har_export_tip'),

View File

@ -32,7 +32,9 @@
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
<ms-api-request-form :isShowEnable="true" :referenced="true" :headers="request.headers " :request="request"
v-if="request.protocol==='HTTP' || request.type==='HTTPSamplerProxy'"/>
<ms-tcp-basis-parameters :request="request" v-if="request.protocol==='TCP'|| request.type==='TCPSampler'" :showScript="false"/>
<esb-definition v-xpack :request="request" :showScript="false" v-if="this.showXpackCompnent&&request.esbDataStruct!=null" ref="esbDefinition"/>
<ms-tcp-basis-parameters :request="request" v-if="(request.protocol==='TCP'|| request.type==='TCPSampler')&&request.esbDataStruct==null " :showScript="false"/>
<ms-sql-basis-parameters :request="request" v-if="request.protocol==='SQL'|| request.type==='JDBCSampler'"
:showScript="false"/>
<ms-dubbo-basis-parameters :request="request"
@ -49,7 +51,13 @@
</el-tab-pane>
</el-tabs>
</div>
<api-response-component :currentProtocol="request.protocol" :result="request.requestResult" v-else/>
<div v-else-if="showXpackCompnent&&request.backEsbDataStruct != null">
<esb-definition-response :currentProtocol="request.protocol" :request="request" :is-api-component="false"
:show-options-button="false" :show-header="true" :result="request.requestResult"/>
</div>
<div v-else>
<api-response-component :currentProtocol="request.protocol" :result="request.requestResult"/>
</div>
<!-- 保存操作 -->
<el-button type="primary" size="small" class="ms-btn-flot" @click="saveTestCase(item)"
@ -75,6 +83,9 @@
import ApiBaseComponent from "../common/ApiBaseComponent";
import ApiResponseComponent from "./ApiResponseComponent";
import CustomizeReqInfo from "@/business/components/api/automation/scenario/common/CustomizeReqInfo";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const esbDefinition = (requireComponent!=null&&requireComponent.keys().length) > 0 ? requireComponent("./apiDefinition/EsbDefinition.vue") : {};
const esbDefinitionResponse = (requireComponent!=null&&requireComponent.keys().length) > 0 ? requireComponent("./apiDefinition/EsbDefinitionResponse.vue") : {};
export default {
name: "MsApiComponent",
@ -101,7 +112,9 @@
components: {
CustomizeReqInfo,
ApiBaseComponent, ApiResponseComponent,
MsSqlBasisParameters, MsTcpBasisParameters, MsDubboBasisParameters, MsApiRequestForm, MsRequestResultTail, MsRun
MsSqlBasisParameters, MsTcpBasisParameters, MsDubboBasisParameters, MsApiRequestForm, MsRequestResultTail, MsRun,
"esbDefinition": esbDefinition.default,
"esbDefinitionResponse": esbDefinitionResponse.default
},
data() {
return {
@ -109,6 +122,7 @@
reportId: "",
runData: [],
isShowInput: false,
showXpackCompnent:false,
}
},
created() {
@ -121,6 +135,7 @@
}
//
this.getApiInfo();
console.log(JSON.stringify(this.request));
if (this.request.protocol === 'HTTP') {
this.setUrl(this.request.url);
this.setUrl(this.request.path);
@ -134,6 +149,9 @@
}
}
}
if (requireComponent != null && JSON.stringify(esbDefinition) != '{}'&& JSON.stringify(esbDefinitionResponse) != '{}') {
this.showXpackCompnent = true;
}
},
computed: {
displayColor() {
@ -284,7 +302,7 @@
let debugData = {
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
variables: this.currentScenario.variables, referenced: 'Created', headers: this.currentScenario.headers,
enableCookieShare: this.enableCookieShare, environmentId: this.currentEnvironmentId, hashTree: [this.request]
enableCookieShare: this.enableCookieShare, environmentId: this.currentEnvironmentId, hashTree: [this.request],
};
this.runData.push(debugData);
/*触发执行操作*/

View File

@ -101,7 +101,7 @@
getComponent(type) {
if (type === ELEMENT_TYPE.JSR223PreProcessor) {
this.title = this.$t('api_test.definition.request.pre_script');
this.titleColor = "#B8741A";
this.titleColor = "#b8741a";
this.backgroundColor = "#F9F1EA";
return "MsJsr233Processor";
} else if (type === ELEMENT_TYPE.JSR223PostProcessor) {

View File

@ -219,8 +219,12 @@
return this.selection.includes(row.id)
},
open: function (variables, headers, disabled) {
this.variables = variables;
this.headers = headers;
if(variables){
this.variables = variables;
}
if(headers){
this.headers = headers;
}
this.visible = true;
this.editData = {type: "CONSTANT"};
this.addParameters(this.editData);

View File

@ -131,8 +131,6 @@ export default {
if(this.request.backScript != null){
this.basisData.backScript = JSON.stringify(this.request.backScript);
}
}
this.$emit('saveApi', this.basisData);
}

View File

@ -128,7 +128,7 @@ export default {
protocol: "",
platforms: [
{
name: 'Metersphere',
name: 'MeterSphere',
value: 'Metersphere',
tip: this.$t('api_test.api_import.ms_tip'),
exportTip: this.$t('api_test.api_import.ms_export_tip'),
@ -149,7 +149,7 @@ export default {
suffixes: new Set(['json'])
},
{
name: 'Har',
name: 'HAR',
value: 'Har',
tip: this.$t('api_test.api_import.har_tip'),
exportTip: this.$t('api_test.api_import.har_export_tip'),

View File

@ -44,12 +44,12 @@ export default {
component: () => import('@/business/components/api/report/ApiReportView'),
},
{
path: "definition",
path: "definition/:redirectID?/:dataType?/:dataSelectRange?",
name: "ApiDefinition",
component: () => import('@/business/components/api/definition/ApiDefinition'),
},
{
path: "automation",
path: "automation/:redirectID?/:dataType?/:dataSelectRange?",
name: "ApiAutomation",
component: () => import('@/business/components/api/automation/ApiAutomation'),
},

View File

@ -1,28 +1,36 @@
<template>
<el-tag :type="type" :effect="effect" :color="color" size="mini">{{content}}</el-tag>
<el-tooltip placement="top" v-if="showTooltip">
<div slot="content">{{content}}</div>
<el-tag :type="type" :effect="effect" :color="color" size="mini">{{content}}</el-tag>
</el-tooltip>
<el-tag :type="type" :effect="effect" :color="color" size="mini" v-else>{{content}}</el-tag>
</template>
<script>
export default {
name: "MsTag",
props: {
type: {
type: String,
default: 'primary',
},
color: {
type: String,
default: '',
},
content: {
type: String
},
effect: {
type: String,
default: 'dark',
}
export default {
name: "MsTag",
props: {
type: {
type: String,
default: 'primary',
},
color: {
type: String,
default: '',
},
content: {
type: String
},
effect: {
type: String,
default: 'dark',
},
showTooltip: {
type: Boolean,
default: false,
}
}
}
</script>
<style scoped>

View File

@ -3,42 +3,42 @@
:destroy-on-close="true"
:title="$t('load_test.exist_jmx')" width="70%"
:visible.sync="loadFileVisible">
<el-row>
<el-upload
v-if="loadType === 'jmx'"
style="padding-right: 10px;"
accept=".jmx"
action=""
multiple
:limit="fileNumLimit"
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:disabled="isReadOnly"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_jmx')"/>
</el-upload>
<el-upload
v-else
style="padding-right: 10px;"
accept=".jar,.csv,.json,.pdf,.jpg,.png,.jpeg,.doc,.docx,.xlsx"
action=""
:limit="fileNumLimit"
multiple
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:disabled="isReadOnly"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_file')"/>
</el-upload>
</el-row>
<ms-table-header :is-tester-permission="true" title="" :condition.sync="condition" @search="getProjectFiles" :show-create="false">
<template v-slot:button>
<el-upload
v-if="loadType === 'jmx'"
style="margin-bottom: 10px"
accept=".jmx"
action=""
multiple
:limit="fileNumLimit"
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:disabled="isReadOnly"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_jmx')"/>
</el-upload>
<el-upload
v-else
style="margin-bottom: 10px"
accept=".jar,.csv,.json,.pdf,.jpg,.png,.jpeg,.doc,.docx,.xlsx"
action=""
:limit="fileNumLimit"
multiple
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:disabled="isReadOnly"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_file')"/>
</el-upload>
</template>
</ms-table-header>
<el-table v-loading="projectLoadingResult.loading"
class="basic-config"
:data="existFiles"
@ -78,10 +78,11 @@ import {getCurrentProjectID} from "@/common/js/utils";
import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup";
import MsTableButton from "@/business/components/common/components/MsTableButton";
import axios from "axios";
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
export default {
name: "ExistFiles",
components: {MsTableButton, MsTablePagination, MsDialogFooter},
components: {MsTableHeader, MsTableButton, MsTablePagination, MsDialogFooter},
props: {
fileList: Array,
tableData: Array,
@ -100,6 +101,7 @@ export default {
existFiles: [],
selectIds: new Set,
fileNumLimit: 10,
condition: {}
}
},
methods: {
@ -133,7 +135,7 @@ export default {
}
},
getProjectFiles() {
this.projectLoadingResult = this.$get('/performance/project/' + this.loadType + '/' + getCurrentProjectID() + "/" + this.currentPage + "/" + this.pageSize, res => {
this.projectLoadingResult = this.$post('/performance/project/' + this.loadType + '/' + getCurrentProjectID() + "/" + this.currentPage + "/" + this.pageSize, this.condition, res => {
let data = res.data;
this.total = data.itemCount;
this.existFiles = data.listObject;

View File

@ -329,10 +329,10 @@ export default {
}
return true;
},
beforeUploadJmx(file){
beforeUploadJmx(file) {
this.$refs.existFiles.beforeUploadFile(file);
},
handleUpload(file){
handleUpload(file) {
this.$refs.existFiles.handleUpload(file);
},
},
@ -341,7 +341,7 @@ export default {
<style scoped>
.basic-config {
width: 100%
width: 100%;
}
.last-modified {

View File

@ -3,22 +3,25 @@
:destroy-on-close="true"
:title="$t('load_test.exist_jmx')" width="70%"
:visible.sync="loadFileVisible">
<el-row>
<el-upload
style="padding-right: 10px;"
accept=".jmx,.jar,.csv,.json,.pdf,.jpg,.png,.jpeg,.doc,.docx,.xlsx"
action=""
:limit="fileNumLimit"
multiple
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_file')"/>
</el-upload>
</el-row>
<ms-table-header :is-tester-permission="true" title="" :condition.sync="condition" @search="getProjectFiles" :show-create="false">
<template v-slot:button>
<el-upload
style="margin-bottom: 10px;"
accept=".jmx,.jar,.csv,.json,.pdf,.jpg,.png,.jpeg,.doc,.docx,.xlsx"
action=""
:limit="fileNumLimit"
multiple
:show-file-list="false"
:before-upload="beforeUploadFile"
:http-request="handleUpload"
:on-exceed="handleExceed"
:file-list="fileList">
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
:content="$t('load_test.upload_file')"/>
</el-upload>
</template>
</ms-table-header>
<el-table v-loading="projectLoadingResult.loading"
class="basic-config"
@ -64,10 +67,12 @@ import MsDialogFooter from "@/business/components/common/components/MsDialogFoot
import {getCurrentProjectID} from "@/common/js/utils";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import {Message} from "element-ui";
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsTableSearchBar from "@/business/components/common/components/MsTableSearchBar";
export default {
name: "MsResourceFiles",
components: {MsTableOperatorButton, MsDialogFooter, MsTableButton, MsTablePagination},
components: {MsTableSearchBar, MsTableHeader, MsTableOperatorButton, MsDialogFooter, MsTableButton, MsTablePagination},
data() {
return {
loadFileVisible: false,
@ -79,6 +84,7 @@ export default {
fileList: [],
uploadList: [],
fileNumLimit: 10,
condition: {}
}
},
methods: {
@ -91,7 +97,7 @@ export default {
this.selectIds.clear();
},
getProjectFiles() {
this.projectLoadingResult = this.$get('/performance/project/all/' + getCurrentProjectID() + "/" + this.currentPage + "/" + this.pageSize, res => {
this.projectLoadingResult = this.$post('/performance/project/all/' + getCurrentProjectID() + "/" + this.currentPage + "/" + this.pageSize, this.condition, res => {
let data = res.data;
this.total = data.itemCount;
this.existFiles = data.listObject;

View File

@ -19,8 +19,8 @@
<el-tab-pane name="default" :label="$t('api_test.definition.case_title')">
<ms-tab-button
:active-dom.sync="activeDom"
:left-tip="$t('api_test.definition.case_title')"
:left-content="'CASE'"
:left-tip="$t('test_track.case.list')"
:left-content="$t('test_track.case.list')"
:right-tip="$t('test_track.case.minder')"
:right-content="$t('test_track.case.minder')"
:middle-button-enable="false">

View File

@ -4,6 +4,7 @@
:tree-nodes="treeNodes"
:data-map="dataMap"
:tags="tags"
:distinct-tags="tags"
@save="save"
/>
</template>
@ -60,6 +61,9 @@ name: "TestCaseMinder",
buildSaveCase(root, saveCases, parent) {
let data = root.data;
if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) {
if (root.parent) {
console.log(root.parent);
}
this._buildSaveCase(root, saveCases, parent);
} else {
if (root.children) {
@ -83,7 +87,7 @@ name: "TestCaseMinder",
type: data.type ? data.type : 'functional',
method: data.method ? data.method: 'manual',
maintainer: data.maintainer,
priority: 'P' + (data.priority ? data.priority : 0),
priority: 'P' + (data.priority ? data.priority - 1 : 0),
};
if (data.changed) isChange = true;
let steps = [];
@ -117,6 +121,11 @@ name: "TestCaseMinder",
if (isChange) {
saveCases.push(testCase);
}
if (testCase.nodeId.length < 15) {
let tip = this.$t('test_track.case.create_case') + "'" + testCase.name + "'" + this.$t('test_track.case.minder_create_tip');
this.$error(tip)
throw new Error(tip);
}
},
}

View File

@ -10,7 +10,7 @@ export function getTestCaseDataMap(testCase, isDisable, setParamCallback) {
data: {
id: item.id,
text: item.name,
priority: Number.parseInt(item.priority.substring(item.priority.length - 1 )),
priority: Number.parseInt(item.priority.substring(item.priority.length - 1 )) + 1,
resource: ["用例"],
type: item.type,
method: item.method,

View File

@ -188,7 +188,7 @@ export default {
},
redirectPage(page,dataType,selectType){
//test_plan
this.$router.push('/track/plan/view/'+selectType);
// this.$router.push('/track/plan/view/'+selectType);
switch (page){
case "case":
this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}});

View File

@ -85,6 +85,15 @@
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">关联测试</span>
<span v-for="(item,index) in testCase.list" :key="index">
<el-button @click="openTest(item)" type="text" style="margin-left: 7px;">{{ item.testName }}</el-button>
</span>
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.case.prerequisite') }}</span>
@ -351,7 +360,7 @@ import ApiTestDetail from "../test/ApiTestDetail";
import ApiTestResult from "../test/ApiTestResult";
import PerformanceTestDetail from "../test/PerformanceTestDetail";
import PerformanceTestResult from "../test/PerformanceTestResult";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import CaseComment from "@/business/components/track/case/components/CaseComment";
import MsPreviousNextButton from "../../../../../common/components/MsPreviousNextButton";
@ -559,6 +568,29 @@ export default {
}
});
},
openTest(item) {
const type = item.testType;
const id = item.testId;
switch (type) {
case "performance": {
let performanceData = this.$router.resolve({
path: '/performance/test/edit/' + id,
})
window.open(performanceData.href, '_blank');
break;
}
case "testcase": {
let caseData = this.$router.resolve({name:'ApiDefinition',params:{redirectID:getUUID(),dataType:"apiTestCase",dataSelectRange:'single:'+id}});
window.open(caseData.href, '_blank');
break;
}
case "automation": {
let automationData = this.$router.resolve({name:'ApiAutomation',params:{redirectID:getUUID(),dataType:"scenario",dataSelectRange:'edit:'+id}});
window.open(automationData.href, '_blank');
break;
}
}
},
getRelatedTest() {
if (this.testCase.method === 'auto' && this.testCase.testId && this.testCase.testId !== 'other') {
this.$get('/' + this.testCase.type + '/get/' + this.testCase.testId, response => {

View File

@ -11,8 +11,8 @@
<template v-slot:main>
<ms-tab-button
:active-dom.sync="activeDom"
:left-tip="$t('api_test.definition.case_title')"
:left-content="'CASE'"
:left-tip="$t('test_track.case.list')"
:left-content="$t('test_track.case.list')"
:right-tip="$t('test_track.case.minder')"
:right-content="$t('test_track.case.minder')"
:middle-button-enable="false">

View File

@ -12,8 +12,8 @@
<template v-slot:main>
<ms-tab-button
:active-dom.sync="activeDom"
:left-tip="$t('api_test.definition.case_title')"
:left-content="'CASE'"
:left-tip="$t('test_track.case.list')"
:left-content="$t('test_track.case.list')"
:right-tip="$t('test_track.case.minder')"
:right-content="$t('test_track.case.minder')"
:middle-button-enable="false">

@ -1 +1 @@
Subproject commit 3dbd5a3d7ec96a10e11d817cdec25832986af1d2
Subproject commit f63ebb68ebad78de42fd711f17e2671e34577a86

View File

@ -327,7 +327,7 @@ export default {
use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"',
use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)',
use_tip_zentao: 'The account password is a Zentao account with corresponding permissions, and the account needs to have super model calling interface permissions',
use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the Metersphere project',
use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the MeterSphere project',
link_the_project_now: 'Link the project now',
cancel_edit: 'Cancel edit',
cancel_integration: 'Cancel integration',
@ -437,7 +437,7 @@ export default {
downloadJtl: 'Download JTL',
test_execute_again: 'Test Execute Again',
export: 'Export',
export_to_ms_format: 'Export to Metersphere format',
export_to_ms_format: 'Export to MeterSphere format',
export_to_swagger3_format: 'Export to Swagger3.0 format',
compare: 'Compare',
generation_error: 'Report generation error, unable to view, please check log details!',
@ -809,7 +809,7 @@ export default {
url_description: "etc: https://fit2cloud.com",
path_description: "etc/login",
parameters: "Query parameters",
jmeter_func: "Jmeter Functions",
jmeter_func: "JMeter Functions",
parameters_filter_example: "Example",
parameters_filter_tips: "Only support MockJs function result preview",
parameters_advance: "Advanced parameter settings",
@ -1126,7 +1126,9 @@ export default {
cancel_relevance_success: "Unlinked successfully",
switch_project: "Switch project",
case: {
list: "List",
minder: "Minder",
minder_create_tip: "failed, unable to create its parent module in minder",
check_select: "Please check the case",
export_all_cases: 'Are you sure you want to export all use cases?',
input_test_case: 'Please enter the associated case name',

View File

@ -325,7 +325,7 @@ export default {
use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询',
use_tip_jira: 'Jira software server 认证信息为 账号密码Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)',
use_tip_zentao: '账号密码为具有相应权限的Zentao账号账号需要具有 超级model调用接口权限',
use_tip_two: '保存 Basic Auth 账号信息后,需要在 Metersphere 项目中手动关联 ID/key',
use_tip_two: '保存 Basic Auth 账号信息后,需要在 MeterSphere 项目中手动关联 ID/key',
link_the_project_now: '马上关联项目',
cancel_edit: '取消编辑',
cancel_integration: '取消集成',
@ -435,7 +435,7 @@ export default {
test_execute_again: '再次执行',
downloadJtl: '下载JTL',
export: '导出',
export_to_ms_format: '导出 Metersphere 格式',
export_to_ms_format: '导出 MeterSphere 格式',
export_to_swagger3_format: '导出 Swagger3.0 格式',
compare: '比较',
generation_error: '报告生成错误, 无法查看, 请检查日志详情!',
@ -810,7 +810,7 @@ export default {
path_description: "例如:/login",
url_invalid: "URL无效",
parameters: "Query参数",
jmeter_func: "Jmeter 方法",
jmeter_func: "JMeter 方法",
parameters_filter_example: "示例",
parameters_filter_tips: "只支持 MockJs 函数结果预览",
parameters_advance: "return",
@ -946,16 +946,16 @@ export default {
file_size_limit: "文件大小不超过 20 M",
tip: "说明",
export_tip: "导出方法",
ms_tip: "支持 Metersphere json 格式",
ms_export_tip: "通过 Metersphere 接口测试页面或者浏览器插件导出 json 格式文件",
ms_tip: "支持 MeterSphere json 格式",
ms_export_tip: "通过 MeterSphere 接口测试页面或者浏览器插件导出 json 格式文件",
har_export_tip: "通过 浏览器的开发者工具 导出 Har 格式文件",
postman_tip: "只支持 Postman Collection v2.1 格式的 json 文件",
swagger_tip: "支持 Swagger 2.0 与 3.0 版本的 json 文件",
har_tip: "只支持 Har 文件",
post_export_tip: "通过 Postman 导出测试集合",
swagger_export_tip: "通过 Swagger 页面导出",
jmeter_export_tip: "通过 Jmeter 生成JMX文件",
jmeter_tip: "支持 Jmeter 5.2版本的JMX 文件",
jmeter_export_tip: "通过 JMeter 生成JMX文件",
jmeter_tip: "支持 JMeter 5.2版本的JMX 文件",
suffixFormatErr: "文件格式不符合要求",
swagger_url_import: "使用URL导入",
timing_synchronization: "定时同步",
@ -1130,7 +1130,9 @@ export default {
cancel_relevance_success: "取消关联成功",
switch_project: "切换项目",
case: {
list: "列表",
minder: "脑图",
minder_create_tip: "失败, 无法在脑图创建其父模块",
check_select: "请勾选用例",
export_all_cases: '确定要导出全部用例吗?',
input_test_case: '请输入关联用例名称',

View File

@ -325,7 +325,7 @@ export default {
use_tip_tapd: 'Tapd Basic Auth 賬號信息在"公司管理-安全與集成-開放平臺"中查詢',
use_tip_jira: 'Jira software server 認證信息為 賬號密碼Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)',
use_tip_zentao: '賬號密碼為具有相應權限的Zentao賬號賬號需要具有 超級model調用接口權限',
use_tip_two: '保存 Basic Auth 賬號信息後,需要在 Metersphere 項目中手動關聯 ID/key',
use_tip_two: '保存 Basic Auth 賬號信息後,需要在 MeterSphere 項目中手動關聯 ID/key',
link_the_project_now: '馬上關聯項目',
cancel_edit: '取消編輯',
cancel_integration: '取消集成',
@ -435,7 +435,7 @@ export default {
test_execute_again: '再次執行',
downloadJtl: '下載JTL',
export: '導出',
export_to_ms_format: '導出 Metersphere 格式',
export_to_ms_format: '導出 MeterSphere 格式',
export_to_swagger3_format: '導出 Swagger3.0 格式',
compare: '比較',
generation_error: '報告生成錯誤, 無法查看, 請檢查日誌詳情!',
@ -809,7 +809,7 @@ export default {
path_description: "例如:/login",
url_invalid: "URL無效",
parameters: "Query參數",
jmeter_func: "Jmeter 方法",
jmeter_func: "JMeter 方法",
parameters_filter_example: "示例",
parameters_filter_tips: "只支持 MockJs 函數結果預覽",
parameters_advance: "高級參數設置",
@ -945,16 +945,16 @@ export default {
file_size_limit: "文件大小不超過 20 M",
tip: "說明",
export_tip: "導出方法",
ms_tip: "支持 Metersphere json 格式",
ms_export_tip: "通過 Metersphere 接口測試頁面或者瀏覽器插件導出 json 格式文件",
ms_tip: "支持 MeterSphere json 格式",
ms_export_tip: "通過 MeterSphere 接口測試頁面或者瀏覽器插件導出 json 格式文件",
har_export_tip: "通过 瀏覽器到開發者工具 导出 Har 格式文件",
postman_tip: "只支持 Postman Collection v2.1 格式的 json 文件",
swagger_tip: "支持 Swagger 2.0 與 3.0 版本的 json 文件",
har_tip: "只支持 Har 文件",
post_export_tip: "通過 Postman 導出測試集合",
swagger_export_tip: "通過 Swagger 頁面導出",
jmeter_export_tip: "通過 Jmeter 生成JMX文件",
jmeter_tip: "支持 Jmeter 5.2版本的JMX 文件",
jmeter_export_tip: "通過 JMeter 生成JMX文件",
jmeter_tip: "支持 JMeter 5.2版本的JMX 文件",
suffixFormatErr: "文件格式不符合要求",
swagger_url_import: "使用URL導入",
timing_synchronization: "定時同步",
@ -1128,7 +1128,9 @@ export default {
cancel_relevance_success: "取消關聯成功",
switch_project: "切換項目",
case: {
list: "列表",
minder: "腦圖",
minder_create_tip: "失敗, 無法在腦圖創建其父模塊",
check_select: "請勾選用例",
export_all_cases: '確定要導出全部用例嗎?',
input_test_case: '請輸入關聯用例名稱',