Merge branch 'v1.3' of https://github.com/metersphere/server into v1.3
This commit is contained in:
commit
7e97818cf2
|
@ -4,8 +4,10 @@ import io.metersphere.base.domain.ApiTestReport;
|
||||||
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
||||||
import io.metersphere.base.domain.SystemParameter;
|
import io.metersphere.base.domain.SystemParameter;
|
||||||
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
||||||
|
import io.metersphere.commons.constants.APITestStatus;
|
||||||
import io.metersphere.commons.constants.NoticeConstants;
|
import io.metersphere.commons.constants.NoticeConstants;
|
||||||
import io.metersphere.commons.constants.ParamConstants;
|
import io.metersphere.commons.constants.ParamConstants;
|
||||||
|
import io.metersphere.commons.constants.PerformanceTestStatus;
|
||||||
import io.metersphere.commons.utils.EncryptUtils;
|
import io.metersphere.commons.utils.EncryptUtils;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import io.metersphere.dto.BaseSystemConfigDTO;
|
import io.metersphere.dto.BaseSystemConfigDTO;
|
||||||
|
@ -46,12 +48,13 @@ public class MailService {
|
||||||
context.put("title", "Performance" + Translator.get("timing_task_result_notification"));
|
context.put("title", "Performance" + Translator.get("timing_task_result_notification"));
|
||||||
context.put("testName", loadTest.getName());
|
context.put("testName", loadTest.getName());
|
||||||
context.put("id", loadTest.getId());
|
context.put("id", loadTest.getId());
|
||||||
|
context.put("type", "performance");
|
||||||
context.put("url", baseSystemConfigDTO.getUrl());
|
context.put("url", baseSystemConfigDTO.getUrl());
|
||||||
String performanceTemplate = "";
|
String performanceTemplate = "";
|
||||||
try {
|
try {
|
||||||
if (status.equals("Completed")) {
|
if (StringUtils.equals(status, PerformanceTestStatus.Completed.name())) {
|
||||||
performanceTemplate = IOUtils.toString(this.getClass().getResource("/mail/successPerformance.html"), StandardCharsets.UTF_8);
|
performanceTemplate = IOUtils.toString(this.getClass().getResource("/mail/successPerformance.html"), StandardCharsets.UTF_8);
|
||||||
} else if (status.equals("Error")) {
|
} else if (StringUtils.equals(status, PerformanceTestStatus.Error.name())) {
|
||||||
performanceTemplate = IOUtils.toString(this.getClass().getResource("/mail/failPerformance.html"), StandardCharsets.UTF_8);
|
performanceTemplate = IOUtils.toString(this.getClass().getResource("/mail/failPerformance.html"), StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
sendHtmlTimeTasks(noticeList, status, context, performanceTemplate);
|
sendHtmlTimeTasks(noticeList, status, context, performanceTemplate);
|
||||||
|
@ -65,14 +68,14 @@ public class MailService {
|
||||||
Map<String, String> context = new HashMap<>();
|
Map<String, String> context = new HashMap<>();
|
||||||
context.put("title", "api" + Translator.get("timing_task_result_notification"));
|
context.put("title", "api" + Translator.get("timing_task_result_notification"));
|
||||||
context.put("testName", apiTestReport.getName());
|
context.put("testName", apiTestReport.getName());
|
||||||
context.put("type", "Api");
|
context.put("type", "api");
|
||||||
context.put("url", baseSystemConfigDTO.getUrl());
|
context.put("url", baseSystemConfigDTO.getUrl());
|
||||||
context.put("id", apiTestReport.getId());
|
context.put("id", apiTestReport.getId());
|
||||||
String apiTemplate = "";
|
String apiTemplate = "";
|
||||||
try {
|
try {
|
||||||
if (apiTestReport.getStatus().equals("Success")) {
|
if (StringUtils.equals(APITestStatus.Success.name(), apiTestReport.getStatus())) {
|
||||||
apiTemplate = IOUtils.toString(this.getClass().getResource("/mail/success.html"), StandardCharsets.UTF_8);
|
apiTemplate = IOUtils.toString(this.getClass().getResource("/mail/success.html"), StandardCharsets.UTF_8);
|
||||||
} else if (apiTestReport.getStatus().equals("Error")) {
|
} else if (StringUtils.equals(APITestStatus.Error.name(), apiTestReport.getStatus())) {
|
||||||
apiTemplate = IOUtils.toString(this.getClass().getResource("/mail/fail.html"), StandardCharsets.UTF_8);
|
apiTemplate = IOUtils.toString(this.getClass().getResource("/mail/fail.html"), StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
sendHtmlTimeTasks(noticeList, apiTestReport.getStatus(), context, apiTemplate);
|
sendHtmlTimeTasks(noticeList, apiTestReport.getStatus(), context, apiTemplate);
|
||||||
|
@ -183,17 +186,21 @@ public class MailService {
|
||||||
javaMailSender.setDefaultEncoding("UTF-8");
|
javaMailSender.setDefaultEncoding("UTF-8");
|
||||||
javaMailSender.setProtocol("smtps");
|
javaMailSender.setProtocol("smtps");
|
||||||
for (SystemParameter p : paramList) {
|
for (SystemParameter p : paramList) {
|
||||||
if (p.getParamKey().equals("smtp.host")) {
|
switch (p.getParamKey()) {
|
||||||
javaMailSender.setHost(p.getParamValue());
|
case "smtp.host":
|
||||||
}
|
javaMailSender.setHost(p.getParamValue());
|
||||||
if (p.getParamKey().equals("smtp.port")) {
|
break;
|
||||||
javaMailSender.setPort(Integer.parseInt(p.getParamValue()));
|
case "smtp.port":
|
||||||
}
|
javaMailSender.setPort(Integer.parseInt(p.getParamValue()));
|
||||||
if (p.getParamKey().equals("smtp.account")) {
|
break;
|
||||||
javaMailSender.setUsername(p.getParamValue());
|
case "smtp.account":
|
||||||
}
|
javaMailSender.setUsername(p.getParamValue());
|
||||||
if (p.getParamKey().equals("smtp.password")) {
|
break;
|
||||||
javaMailSender.setPassword(EncryptUtils.aesDecrypt(p.getParamValue()).toString());
|
case "smtp.password":
|
||||||
|
javaMailSender.setPassword(EncryptUtils.aesDecrypt(p.getParamValue()).toString());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
|
@ -223,10 +230,10 @@ public class MailService {
|
||||||
List<String> failEmailList = new ArrayList<>();
|
List<String> failEmailList = new ArrayList<>();
|
||||||
if (noticeList.size() > 0) {
|
if (noticeList.size() > 0) {
|
||||||
for (NoticeDetail n : noticeList) {
|
for (NoticeDetail n : noticeList) {
|
||||||
if (n.getEnable().equals("true") && n.getEvent().equals(NoticeConstants.EXECUTE_SUCCESSFUL)) {
|
if (StringUtils.equals(n.getEnable(), "true") && StringUtils.equals(n.getEvent(), NoticeConstants.EXECUTE_SUCCESSFUL)) {
|
||||||
successEmailList = userService.queryEmail(n.getNames());
|
successEmailList = userService.queryEmail(n.getNames());
|
||||||
}
|
}
|
||||||
if (n.getEnable().equals("true") && n.getEvent().equals(NoticeConstants.EXECUTE_FAILED)) {
|
if (StringUtils.equals(n.getEnable(), "true") && StringUtils.equals(n.getEvent(), NoticeConstants.EXECUTE_FAILED)) {
|
||||||
failEmailList = userService.queryEmail(n.getNames());
|
failEmailList = userService.queryEmail(n.getNames());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +241,7 @@ public class MailService {
|
||||||
LogUtil.error("Recipient information is empty");
|
LogUtil.error("Recipient information is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.equals("Success") || status.equals("Completed")) {
|
if (StringUtils.equalsAny(status, PerformanceTestStatus.Completed.name(), APITestStatus.Success.name())) {
|
||||||
recipientEmails = successEmailList.toArray(new String[0]);
|
recipientEmails = successEmailList.toArray(new String[0]);
|
||||||
} else {
|
} else {
|
||||||
recipientEmails = failEmailList.toArray(new String[0]);
|
recipientEmails = failEmailList.toArray(new String[0]);
|
||||||
|
|
|
@ -230,7 +230,7 @@ public class TestCaseNodeService {
|
||||||
return list;
|
return list;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TestCaseNodeDTO> getNodeDTO(String projectId, String planId) {
|
private List<TestCaseNodeDTO> getNodeDTO(String projectId, String planId) {
|
||||||
TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample();
|
TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample();
|
||||||
testPlanTestCaseExample.createCriteria().andPlanIdEqualTo(planId);
|
testPlanTestCaseExample.createCriteria().andPlanIdEqualTo(planId);
|
||||||
|
@ -355,50 +355,45 @@ public class TestCaseNodeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> createNodeByTestCases(List<TestCaseWithBLOBs> testCases, String projectId) {
|
public Map<String, String> createNodeByTestCases(List<TestCaseWithBLOBs> testCases, String projectId) {
|
||||||
|
|
||||||
List<TestCaseNodeDTO> nodeTrees = getNodeTreeByProjectId(projectId);
|
|
||||||
|
|
||||||
Map<String, String> pathMap = new HashMap<>();
|
|
||||||
|
|
||||||
List<String> nodePaths = testCases.stream()
|
List<String> nodePaths = testCases.stream()
|
||||||
.map(TestCase::getNodePath)
|
.map(TestCase::getNodePath)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
nodePaths.forEach(path -> {
|
return this.createNodes(nodePaths, projectId);
|
||||||
|
}
|
||||||
|
|
||||||
if (path == null) {
|
public Map<String, String> createNodes(List<String> nodePaths, String projectId) {
|
||||||
|
List<TestCaseNodeDTO> nodeTrees = getNodeTreeByProjectId(projectId);
|
||||||
|
Map<String, String> pathMap = new HashMap<>();
|
||||||
|
for(String item : nodePaths){
|
||||||
|
if (item == null) {
|
||||||
throw new ExcelException(Translator.get("test_case_module_not_null"));
|
throw new ExcelException(Translator.get("test_case_module_not_null"));
|
||||||
}
|
}
|
||||||
List<String> nodeNameList = new ArrayList<>(Arrays.asList(path.split("/")));
|
List<String> nodeNameList = new ArrayList<>(Arrays.asList(item.split("/")));
|
||||||
Iterator<String> pathIterator = nodeNameList.iterator();
|
Iterator<String> itemIterator = nodeNameList.iterator();
|
||||||
|
|
||||||
Boolean hasNode = false;
|
Boolean hasNode = false;
|
||||||
String rootNodeName = null;
|
String rootNodeName = null;
|
||||||
|
|
||||||
if (nodeNameList.size() <= 1) {
|
if (nodeNameList.size() <= 1) {
|
||||||
throw new ExcelException(Translator.get("test_case_create_module_fail") + ":" + path);
|
throw new ExcelException(Translator.get("test_case_create_module_fail") + ":" + item);
|
||||||
} else {
|
} else {
|
||||||
pathIterator.next();
|
itemIterator.next();
|
||||||
pathIterator.remove();
|
itemIterator.remove();
|
||||||
|
rootNodeName = itemIterator.next().trim();
|
||||||
rootNodeName = pathIterator.next().trim();
|
|
||||||
//原来没有,新建的树nodeTrees也不包含
|
//原来没有,新建的树nodeTrees也不包含
|
||||||
for (TestCaseNodeDTO nodeTree : nodeTrees) {
|
for (TestCaseNodeDTO nodeTree : nodeTrees) {
|
||||||
if (StringUtils.equals(rootNodeName, nodeTree.getName())) {
|
if (StringUtils.equals(rootNodeName, nodeTree.getName())) {
|
||||||
hasNode = true;
|
hasNode = true;
|
||||||
createNodeByPathIterator(pathIterator, "/" + rootNodeName, nodeTree,
|
createNodeByPathIterator(itemIterator, "/" + rootNodeName, nodeTree,
|
||||||
pathMap, projectId, 2);
|
pathMap, projectId, 2);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!hasNode) {
|
if (!hasNode) {
|
||||||
createNodeByPath(pathIterator, rootNodeName, null, projectId, 1, "", pathMap);
|
createNodeByPath(itemIterator, rootNodeName, null, projectId, 1, "", pathMap);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
return pathMap;
|
return pathMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,6 +285,9 @@ public class TestCaseService {
|
||||||
errList.add(excelErrData);
|
errList.add(excelErrData);
|
||||||
excelResponse.setErrList(errList);
|
excelResponse.setErrList(errList);
|
||||||
} else {
|
} else {
|
||||||
|
if (!xmindParser.getNodePaths().isEmpty()) {
|
||||||
|
testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId);
|
||||||
|
}
|
||||||
if (!xmindParser.getTestCase().isEmpty()) {
|
if (!xmindParser.getTestCase().isEmpty()) {
|
||||||
this.saveImportData(xmindParser.getTestCase(), projectId);
|
this.saveImportData(xmindParser.getTestCase(), projectId);
|
||||||
xmindParser.clear();
|
xmindParser.clear();
|
||||||
|
|
|
@ -40,6 +40,9 @@ public class XmindCaseParser {
|
||||||
// 案例详情重写了hashCode方法去重用
|
// 案例详情重写了hashCode方法去重用
|
||||||
private List<TestCaseExcelData> compartDatas;
|
private List<TestCaseExcelData> compartDatas;
|
||||||
|
|
||||||
|
// 记录没有用例的目录
|
||||||
|
private List<String> nodePaths;
|
||||||
|
|
||||||
public XmindCaseParser(TestCaseService testCaseService, String userId, String projectId, Set<String> testCaseNames) {
|
public XmindCaseParser(TestCaseService testCaseService, String userId, String projectId, Set<String> testCaseNames) {
|
||||||
this.testCaseService = testCaseService;
|
this.testCaseService = testCaseService;
|
||||||
this.maintainer = userId;
|
this.maintainer = userId;
|
||||||
|
@ -48,6 +51,7 @@ public class XmindCaseParser {
|
||||||
testCases = new LinkedList<>();
|
testCases = new LinkedList<>();
|
||||||
compartDatas = new ArrayList<>();
|
compartDatas = new ArrayList<>();
|
||||||
process = new StringBuffer();
|
process = new StringBuffer();
|
||||||
|
nodePaths = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这里清理是为了 加快jvm 回收
|
// 这里清理是为了 加快jvm 回收
|
||||||
|
@ -55,26 +59,55 @@ public class XmindCaseParser {
|
||||||
compartDatas.clear();
|
compartDatas.clear();
|
||||||
testCases.clear();
|
testCases.clear();
|
||||||
testCaseNames.clear();
|
testCaseNames.clear();
|
||||||
|
nodePaths.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestCaseWithBLOBs> getTestCase() {
|
public List<TestCaseWithBLOBs> getTestCase() {
|
||||||
return this.testCases;
|
return this.testCases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getNodePaths() {
|
||||||
|
return this.nodePaths;
|
||||||
|
}
|
||||||
|
|
||||||
private final Map<String, String> caseTypeMap = ImmutableMap.of("功能测试", "functional", "性能测试", "performance", "接口测试", "api");
|
private final Map<String, String> caseTypeMap = ImmutableMap.of("功能测试", "functional", "性能测试", "performance", "接口测试", "api");
|
||||||
|
|
||||||
|
public void validate() {
|
||||||
|
nodePaths.forEach(nodePath -> {
|
||||||
|
String[] nodes = nodePath.split("/");
|
||||||
|
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
|
||||||
|
process.append(Translator.get("test_case_node_level_tip") +
|
||||||
|
TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level") + "; ");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < nodes.length; i++) {
|
||||||
|
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
|
||||||
|
process.append(Translator.get("module_not_null") + "; ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 递归处理案例数据
|
// 递归处理案例数据
|
||||||
private void recursion(StringBuffer processBuffer, Attached parent, int level, String nodePath, List<Attached> attacheds) {
|
private void recursion(StringBuffer processBuffer, Attached parent, int level, List<Attached> attacheds) {
|
||||||
for (Attached item : attacheds) {
|
for (Attached item : attacheds) {
|
||||||
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
this.newTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
|
this.newTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
|
||||||
} else {
|
} else {
|
||||||
nodePath = parent.getPath() + "/" + item.getTitle();
|
String nodePath = parent.getPath() + "/" + item.getTitle();
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
|
item.setParent(parent);
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
item.setParent(parent);
|
recursion(processBuffer, item, level + 1, item.getChildren().getAttached());
|
||||||
recursion(processBuffer, item, level + 1, nodePath, item.getChildren().getAttached());
|
} else {
|
||||||
|
if (!nodePath.startsWith("/")) {
|
||||||
|
nodePath = "/" + nodePath;
|
||||||
|
}
|
||||||
|
if (nodePath.endsWith("/")) {
|
||||||
|
nodePath = nodePath.substring(0, nodePath.length() - 1);
|
||||||
|
}
|
||||||
|
nodePaths.add(nodePath); // 没有用例的路径
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,11 +276,12 @@ public class XmindCaseParser {
|
||||||
item.setPath(item.getTitle());
|
item.setPath(item.getTitle());
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
item.setPath(item.getTitle());
|
item.setPath(item.getTitle());
|
||||||
recursion(processBuffer, item, 1, item.getPath(), item.getChildren().getAttached());
|
recursion(processBuffer, item, 1, item.getChildren().getAttached());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.validate();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
processBuffer.append(Translator.get("incorrect_format"));
|
processBuffer.append(Translator.get("incorrect_format"));
|
||||||
LogUtil.error(ex.getMessage());
|
LogUtil.error(ex.getMessage());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cf6b06526324326a563d933e07118fac014a63b4
|
Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8
|
|
@ -12,7 +12,10 @@
|
||||||
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
|
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
|
||||||
:placeholder="$t('schedule.please_input_cron_expression')"/>
|
:placeholder="$t('schedule.please_input_cron_expression')"/>
|
||||||
<!-- <el-button type="primary" @click="showCronDialog">{{$t('schedule.generate_expression')}}</el-button>-->
|
<!-- <el-button type="primary" @click="showCronDialog">{{$t('schedule.generate_expression')}}</el-button>-->
|
||||||
<el-button :disabled="isReadOnly" type="primary" @click="saveCron">{{ $t('commons.save') }}</el-button>
|
<el-button :disabled="isReadOnly" type="primary" @click="saveCron">{{
|
||||||
|
$t('commons.save')
|
||||||
|
}}
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-link :disabled="isReadOnly" type="primary" @click="showCronDialog">
|
<el-link :disabled="isReadOnly" type="primary" @click="showCronDialog">
|
||||||
|
@ -21,8 +24,10 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<crontab-result :ex="form.cronValue" ref="crontabResult"/>
|
<crontab-result :ex="form.cronValue" ref="crontabResult"/>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-dialog width="60%" :title="$t('schedule.generate_expression')" :visible.sync="showCron" :modal="false">
|
<el-dialog width="60%" :title="$t('schedule.generate_expression')" :visible.sync="showCron"
|
||||||
<crontab @hide="showCron=false" @fill="crontabFill" :expression="schedule.value" ref="crontab"/>
|
:modal="false">
|
||||||
|
<crontab @hide="showCron=false" @fill="crontabFill" :expression="schedule.value"
|
||||||
|
ref="crontab"/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('schedule.task_notification')" name="second">
|
<el-tab-pane :label="$t('schedule.task_notification')" name="second">
|
||||||
|
@ -42,11 +47,12 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="name"
|
prop="name"
|
||||||
:label="$t('schedule.receiver')"
|
:label="$t('schedule.receiver')"
|
||||||
width="200"
|
width="240"
|
||||||
>
|
>
|
||||||
<template v-slot:default="{row}">
|
<template v-slot:default="{row}">
|
||||||
<el-select v-model="row.names" filterable multiple :placeholder="$t('commons.please_select')"
|
<el-select v-model="row.names" filterable multiple
|
||||||
@click.native="userList()">
|
:placeholder="$t('commons.please_select')"
|
||||||
|
@click.native="userList()" style="width: 100%;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
@ -269,4 +275,10 @@ export default {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/deep/ .el-select__tags {
|
||||||
|
flex-wrap: unset;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
this.$refs[form].validate(valid => {
|
this.$refs[form].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
let formatUrl = this.form.url;
|
let formatUrl = this.form.url.trim();
|
||||||
if (!formatUrl.endsWith('/')) {
|
if (!formatUrl.endsWith('/')) {
|
||||||
formatUrl = formatUrl + '/';
|
formatUrl = formatUrl + '/';
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
:content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>
|
:content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>
|
||||||
<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document"
|
<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document"
|
||||||
:content="$t('test_track.plan_view.view_report')" @click="openReport"/>
|
:content="$t('test_track.plan_view.view_report')" @click="openReport"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"
|
||||||
|
:content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>
|
||||||
</template>
|
</template>
|
||||||
</ms-table-header>
|
</ms-table-header>
|
||||||
</template>
|
</template>
|
||||||
|
@ -413,26 +415,47 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDeleteBatch() {
|
handleDeleteBatch() {
|
||||||
|
if (this.tableData.length < 1) {
|
||||||
|
this.$warning(this.$t('test_track.plan_view.no_case_relevance'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + " ?", '', {
|
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + " ?", '', {
|
||||||
confirmButtonText: this.$t('commons.confirm'),
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
callback: (action) => {
|
callback: (action) => {
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
if (this.selectRows.size > 0) {
|
||||||
this.$post('/test/plan/case/batch/delete', {ids: ids}, () => {
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
// this.selectIds.clear();
|
this._handleBatchDelete(ids);
|
||||||
this.selectRows.clear();
|
} else {
|
||||||
this.$emit("refresh");
|
if (this.planId) {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.condition.planId = this.planId;
|
||||||
});
|
}
|
||||||
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
|
this.condition.nodeIds = this.selectNodeIds;
|
||||||
|
}
|
||||||
|
// 根据条件查询计划下所有的关联用例
|
||||||
|
this.$post('/test/plan/case/list/all', this.condition, res => {
|
||||||
|
let data = res.data;
|
||||||
|
let ids = data.map(d => d.id);
|
||||||
|
this._handleBatchDelete(ids);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
_handleBatchDelete(ids) {
|
||||||
|
this.result = this.$post('/test/plan/case/batch/delete', {ids:ids}, () => {
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.$emit("refresh");
|
||||||
|
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||||
|
});
|
||||||
|
},
|
||||||
_handleDelete(testCase) {
|
_handleDelete(testCase) {
|
||||||
let testCaseId = testCase.id;
|
let testCaseId = testCase.id;
|
||||||
this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
|
this.result = this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
|
||||||
this.$emit("refresh");
|
this.$emit("refresh");
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectAll(selection) {
|
handleSelectAll(selection) {
|
||||||
|
|
|
@ -2,16 +2,18 @@
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="comment-left">
|
<div class="comment-left">
|
||||||
<div class="icon-title">
|
<div class="icon-title">
|
||||||
{{comment.author.substring(0,1)}}
|
{{ comment.author.substring(0, 1) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="comment-right">
|
<div class="comment-right">
|
||||||
<span style="font-size: 14px;color: #909399;font-weight: bold">{{comment.author}}</span>
|
<span style="font-size: 14px;color: #909399;font-weight: bold">{{ comment.author }}</span>
|
||||||
<span style="color: #8a8b8d; margin-left: 8px; font-size: 12px">
|
<span style="color: #8a8b8d; margin-left: 8px; font-size: 12px">
|
||||||
{{comment.createTime | timestampFormatDate}}
|
{{ comment.createTime | timestampFormatDate }}
|
||||||
</span>
|
</span>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="comment-desc" style="font-size: 10px;color: #303133">{{comment.description}}</div>
|
<div class="comment-desc" style="font-size: 10px;color: #303133">
|
||||||
|
<pre>{{ comment.description }}</pre>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -29,41 +31,45 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.main {
|
.main {
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-left {
|
.comment-left {
|
||||||
float: left;
|
float: left;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-right {
|
.comment-right {
|
||||||
float: left;
|
float: left;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-title {
|
.icon-title {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
background-color: #72dc91;
|
background-color: #72dc91;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.comment-desc {
|
.comment-desc {
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
border-bottom: 1px solid #ced3de;
|
border-bottom: 1px solid #ced3de;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
margin: 0 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
:placeholder="$t('test_track.review.input_review_project')"
|
:placeholder="$t('test_track.review.input_review_project')"
|
||||||
multiple
|
multiple
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
collapse-tags
|
|
||||||
filterable>
|
filterable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in projects"
|
v-for="item in projects"
|
||||||
|
@ -49,7 +48,6 @@
|
||||||
v-model="form.userIds"
|
v-model="form.userIds"
|
||||||
:placeholder="$t('test_track.review.input_reviewer')"
|
:placeholder="$t('test_track.review.input_reviewer')"
|
||||||
filterable multiple
|
filterable multiple
|
||||||
collapse-tags
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in reviewerOptions"
|
v-for="item in reviewerOptions"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1
|
Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9
|
|
@ -798,6 +798,7 @@ export default {
|
||||||
plan_view: {
|
plan_view: {
|
||||||
plan: "Plan",
|
plan: "Plan",
|
||||||
relevance_test_case: "Relevance case",
|
relevance_test_case: "Relevance case",
|
||||||
|
cancel_all_relevance: "Unlink all",
|
||||||
executor: "Executor",
|
executor: "Executor",
|
||||||
execute_result: "Result",
|
execute_result: "Result",
|
||||||
pass: "Pass",
|
pass: "Pass",
|
||||||
|
@ -842,7 +843,8 @@ export default {
|
||||||
report_template: "Report template",
|
report_template: "Report template",
|
||||||
test_detail: "Test detail",
|
test_detail: "Test detail",
|
||||||
failure_case: "Failure case",
|
failure_case: "Failure case",
|
||||||
export_report: "Export Report"
|
export_report: "Export Report",
|
||||||
|
no_case_relevance: "No related use cases",
|
||||||
},
|
},
|
||||||
issue: {
|
issue: {
|
||||||
issue: "Issue",
|
issue: "Issue",
|
||||||
|
|
|
@ -804,6 +804,7 @@ export default {
|
||||||
plan_view: {
|
plan_view: {
|
||||||
plan: "计划",
|
plan: "计划",
|
||||||
relevance_test_case: "关联测试用例",
|
relevance_test_case: "关联测试用例",
|
||||||
|
cancel_all_relevance: "取消全部关联",
|
||||||
executor: "执行人",
|
executor: "执行人",
|
||||||
execute_result: "执行结果",
|
execute_result: "执行结果",
|
||||||
pass: "通过",
|
pass: "通过",
|
||||||
|
@ -848,7 +849,8 @@ export default {
|
||||||
report_template: "测试报告模版",
|
report_template: "测试报告模版",
|
||||||
test_detail: "测试详情",
|
test_detail: "测试详情",
|
||||||
failure_case: "失败用例",
|
failure_case: "失败用例",
|
||||||
export_report: "导出报告"
|
export_report: "导出报告",
|
||||||
|
no_case_relevance: "没有关联用例",
|
||||||
},
|
},
|
||||||
issue: {
|
issue: {
|
||||||
issue: "缺陷",
|
issue: "缺陷",
|
||||||
|
|
|
@ -800,6 +800,7 @@ export default {
|
||||||
plan_view: {
|
plan_view: {
|
||||||
plan: "計劃",
|
plan: "計劃",
|
||||||
relevance_test_case: "關聯測試用例",
|
relevance_test_case: "關聯測試用例",
|
||||||
|
cancel_all_relevance: "取消全部關聯",
|
||||||
executor: "執行人",
|
executor: "執行人",
|
||||||
execute_result: "執行結果",
|
execute_result: "執行結果",
|
||||||
pass: "通過",
|
pass: "通過",
|
||||||
|
@ -844,7 +845,8 @@ export default {
|
||||||
report_template: "測試報告模版",
|
report_template: "測試報告模版",
|
||||||
test_detail: "測試詳情",
|
test_detail: "測試詳情",
|
||||||
failure_case: "失敗用例",
|
failure_case: "失敗用例",
|
||||||
export_report: "導出報告"
|
export_report: "導出報告",
|
||||||
|
no_case_relevance: "沒有關聯用例",
|
||||||
},
|
},
|
||||||
issue: {
|
issue: {
|
||||||
issue: "缺陷",
|
issue: "缺陷",
|
||||||
|
|
Loading…
Reference in New Issue