Merge branch 'v1.3' into master

This commit is contained in:
Captain.B 2020-09-29 18:03:10 +08:00
commit a2483b48d4
17 changed files with 43 additions and 21 deletions

View File

@ -42,12 +42,12 @@ public class MailService {
@Resource
private SystemParameterService systemParameterService;
public void sendPerformanceNotification(List<NoticeDetail> noticeList, String status, LoadTestWithBLOBs loadTest) {
public void sendPerformanceNotification(List<NoticeDetail> noticeList, String status, LoadTestWithBLOBs loadTest, String id) {
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
Map<String, String> context = new HashMap<>();
context.put("title", "Performance" + Translator.get("timing_task_result_notification"));
context.put("testName", loadTest.getName());
context.put("id", loadTest.getId());
context.put("id", id);
context.put("type", "performance");
context.put("url", baseSystemConfigDTO.getUrl());
String performanceTemplate = "";

View File

@ -242,7 +242,7 @@ public class PerformanceTestService {
if (request.getTriggerMode().equals("SCHEDULE")) {
try {
noticeList = noticeService.queryNotice(loadTest.getId());
mailService.sendPerformanceNotification(noticeList, PerformanceTestStatus.Completed.name(), loadTest);
mailService.sendPerformanceNotification(noticeList, PerformanceTestStatus.Completed.name(), loadTest, engine.getReportId());
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
}
@ -321,7 +321,7 @@ public class PerformanceTestService {
loadTestMapper.updateByPrimaryKeySelective(loadTest);
if (triggerMode.equals("SCHEDULE")) {
noticeList = noticeService.queryNotice(loadTest.getId());
mailService.sendPerformanceNotification(noticeList, loadTest.getStatus(), loadTest);
mailService.sendPerformanceNotification(noticeList, loadTest.getStatus(), loadTest, loadTest.getId());
}
throw e;
}
@ -449,7 +449,7 @@ public class PerformanceTestService {
if (loadTestReport.getTriggerMode().equals("SCHEDULE")) {
try {
noticeList = noticeService.queryNotice(loadTest.getId());
mailService.sendPerformanceNotification(noticeList, loadTestReport.getStatus(), loadTest);
mailService.sendPerformanceNotification(noticeList, loadTestReport.getStatus(), loadTest, loadTestReport.getId());
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
}

View File

@ -25,6 +25,7 @@ import java.util.List;
@RequestMapping("/test/case/review")
@RestController
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public class TestCaseReviewController {
@Resource
@ -33,7 +34,6 @@ public class TestCaseReviewController {
TestReviewProjectService testReviewProjectService;
@PostMapping("/list/{goPage}/{pageSize}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public Pager<List<TestCaseReviewDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryCaseReviewRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseReviewService.listCaseReview(request));
@ -46,19 +46,16 @@ public class TestCaseReviewController {
}
@PostMapping("/project")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public List<Project> getProjectByReviewId(@RequestBody TestCaseReview request) {
return testCaseReviewService.getProjectByReviewId(request);
}
@PostMapping("/reviewer")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public List<User> getUserByReviewId(@RequestBody TestCaseReview request) {
return testCaseReviewService.getUserByReviewId(request);
}
@GetMapping("/recent/{count}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public List<TestCaseReviewDTO> recentTestPlans(@PathVariable int count) {
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
PageHelper.startPage(1, count, true);

View File

@ -82,7 +82,8 @@ public class XmindCaseParser {
for (int i = 0; i < nodes.length; i++) {
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
process.append(Translator.get("module_not_null") + "; ");
break;
} else if (nodes[i].trim().length() > 30) {
process.append(nodes[i].trim() + "" + Translator.get("test_track.length_less_than") + "30 ;");
}
}
});
@ -236,6 +237,9 @@ public class XmindCaseParser {
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
stringBuilder.append(Translator.get("module_not_null") + "; ");
break;
} else if (nodes[i].trim().length() > 30) {
stringBuilder.append(nodes[i].trim() + "" + Translator.get("test_track.length_less_than") + "30 ;");
break;
}
}
}
@ -275,7 +279,6 @@ public class XmindCaseParser {
} else {
item.setPath(item.getTitle());
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
item.setPath(item.getTitle());
recursion(processBuffer, item, 1, item.getChildren().getAttached());
}
}
@ -285,7 +288,7 @@ public class XmindCaseParser {
} catch (Exception ex) {
processBuffer.append(Translator.get("incorrect_format"));
LogUtil.error(ex.getMessage());
return ex.getMessage();
return "xmind "+Translator.get("incorrect_format");
}
return process.toString();
}

@ -1 +1 @@
Subproject commit cf6b06526324326a563d933e07118fac014a63b4
Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8

View File

@ -157,3 +157,4 @@ import_xmind_not_found=Test case not found
license_valid_license_error=Authorization authentication failed
timing_task_result_notification=Timing task result notification
test_review_task_notice=Test review task notice
test_track.length_less_than=The title is too long, the length must be less than

View File

@ -157,5 +157,5 @@ license_valid_license_error=授权认证失败
import_xmind_not_found=未找到测试用例
timing_task_result_notification=定时任务结果通知
test_review_task_notice=测试评审任务通知
test_track.length_less_than=标题过长,字数必须小于

View File

@ -157,4 +157,5 @@ email_subject=MeterSphere定時任務結果通知
import_xmind_count_error=思維導圖導入用例數量不能超過 500 條
import_xmind_not_found=未找到测试用例
timing_task_result_notification=定時任務結果通知
test_review_task_notice=測試評審任務通知
test_review_task_notice=測試評審任務通知
test_track.length_less_than=標題過長,字數必須小於

View File

@ -0,0 +1,2 @@
import Vue from 'vue';
export const hub = new Vue();

View File

@ -359,6 +359,8 @@ export default {
handleClose() {
removeGoBackListener(this.handleClose);
this.showDialog = false;
this.searchParam.status = null;
this.$emit('update:search-param', this.searchParam);
},
cancel() {
this.handleClose();

View File

@ -196,7 +196,7 @@
<test-plan-test-case-edit
ref="testPlanTestCaseEdit"
:search-param="condition"
:search-param.sync="condition"
@refresh="initTableData"
:is-read-only="isReadOnly"
@refreshTable="search"/>
@ -233,6 +233,7 @@
import ShowMoreBtn from "../../../case/components/ShowMoreBtn";
import BatchEdit from "../../../case/components/BatchEdit";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import {hub} from "@/business/components/track/plan/event-bus";
export default {
name: "TestPlanTestCaseList",
@ -336,9 +337,17 @@
}
},
mounted() {
hub.$on("openFailureTestCase", row => {
this.isReadOnly = true;
this.condition.status = 'Failure';
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row);
});
this.refreshTableAndPlan();
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
},
beforeDestroy() {
hub.$off("openFailureTestCase");
},
methods: {
initTableData() {
if (this.planId) {

View File

@ -4,6 +4,7 @@
<template>
<el-table
row-key="id"
@row-click="goFailureTestCase"
:data="failureTestCases">
<el-table-column
prop="num"
@ -91,6 +92,7 @@
import TypeTableItem from "../../../../../common/tableItems/planview/TypeTableItem";
import MethodTableItem from "../../../../../common/tableItems/planview/MethodTableItem";
import StatusTableItem from "../../../../../common/tableItems/planview/StatusTableItem";
import {hub} from "@/business/components/track/plan/event-bus";
export default {
name: "FailureResultComponent",
components: {StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem, CommonComponent},
@ -122,6 +124,11 @@
]
}
}
},
methods: {
goFailureTestCase(row) {
hub.$emit("openFailureTestCase", row);
}
}
}
</script>

View File

@ -6,7 +6,7 @@
:show-create="false" :tip="$t('commons.search_by_name_or_id')">
<template v-slot:title>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh"
:title="$t('test_track.review_view.all_review')"/>
:title="$t('test_track.review_view.all_case')"/>
</template>
<template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-video-play"

@ -1 +1 @@
Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1
Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9

View File

@ -776,7 +776,7 @@ export default {
},
review_view: {
review: "Review",
all_review: "All Review",
all_case: "All case",
start_review: "Start Review",
relevance_case: "Relevance Case",
execute_result: "Result",

View File

@ -782,7 +782,7 @@ export default {
},
review_view: {
review: "评审",
all_review: "全部评审",
all_case: "全部用例",
start_review: "开始评审",
relevance_case: "关联用例",
execute_result: "执行结果",

View File

@ -778,7 +778,7 @@ export default {
},
review_view: {
review: "評審",
all_review: "全部評審",
all_case: "全部用例",
start_review: "開始評審",
relevance_case: "關聯用例",
execute_result: "執行結果",