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 @Resource
private SystemParameterService systemParameterService; 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(); BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
Map<String, String> context = new HashMap<>(); Map<String, String> context = new HashMap<>();
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", id);
context.put("type", "performance"); context.put("type", "performance");
context.put("url", baseSystemConfigDTO.getUrl()); context.put("url", baseSystemConfigDTO.getUrl());
String performanceTemplate = ""; String performanceTemplate = "";

View File

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

View File

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

View File

@ -82,7 +82,8 @@ public class XmindCaseParser {
for (int i = 0; i < nodes.length; i++) { for (int i = 0; i < nodes.length; i++) {
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) { if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
process.append(Translator.get("module_not_null") + "; "); 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(), "")) { if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
stringBuilder.append(Translator.get("module_not_null") + "; "); stringBuilder.append(Translator.get("module_not_null") + "; ");
break; 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 { } else {
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());
recursion(processBuffer, item, 1, item.getChildren().getAttached()); recursion(processBuffer, item, 1, item.getChildren().getAttached());
} }
} }
@ -285,7 +288,7 @@ public class XmindCaseParser {
} 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());
return ex.getMessage(); return "xmind "+Translator.get("incorrect_format");
} }
return process.toString(); 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 license_valid_license_error=Authorization authentication failed
timing_task_result_notification=Timing task result notification timing_task_result_notification=Timing task result notification
test_review_task_notice=Test review task notice 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=未找到测试用例 import_xmind_not_found=未找到测试用例
timing_task_result_notification=定时任务结果通知 timing_task_result_notification=定时任务结果通知
test_review_task_notice=测试评审任务通知 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_count_error=思維導圖導入用例數量不能超過 500 條
import_xmind_not_found=未找到测试用例 import_xmind_not_found=未找到测试用例
timing_task_result_notification=定時任務結果通知 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() { handleClose() {
removeGoBackListener(this.handleClose); removeGoBackListener(this.handleClose);
this.showDialog = false; this.showDialog = false;
this.searchParam.status = null;
this.$emit('update:search-param', this.searchParam);
}, },
cancel() { cancel() {
this.handleClose(); this.handleClose();

View File

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

View File

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

View File

@ -6,7 +6,7 @@
:show-create="false" :tip="$t('commons.search_by_name_or_id')"> :show-create="false" :tip="$t('commons.search_by_name_or_id')">
<template v-slot:title> <template v-slot:title>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh" <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>
<template v-slot:button> <template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-video-play" <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_view: {
review: "Review", review: "Review",
all_review: "All Review", all_case: "All case",
start_review: "Start Review", start_review: "Start Review",
relevance_case: "Relevance Case", relevance_case: "Relevance Case",
execute_result: "Result", execute_result: "Result",

View File

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

View File

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