style: 测试报告优化

This commit is contained in:
wenyann 2020-08-13 19:09:02 +08:00
parent c3280f955d
commit bf71b37cf4
10 changed files with 181 additions and 15 deletions

View File

@ -86,12 +86,32 @@ public class ReportResultComponent extends ReportComponent {
moduleResult.setCaseCount(0);
moduleResult.setPassCount(0);
moduleResult.setIssuesCount(0);
moduleResult.setFailureCount(0);
moduleResult.setBlockingCount(0);
moduleResult.setPrepareCount(0);
moduleResult.setSkipCount(0);
moduleResult.setUnderwayCount(0);
moduleResult.setModuleId(rootNodeId);
}
moduleResult.setCaseCount(moduleResult.getCaseCount() + 1);
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Pass.name())) {
moduleResult.setPassCount(moduleResult.getPassCount() + 1);
}
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Prepare.name())) {
moduleResult.setPrepareCount(moduleResult.getPrepareCount() + 1);
}
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Underway.name())) {
moduleResult.setUnderwayCount(moduleResult.getUnderwayCount() + 1);
}
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Failure.name())) {
moduleResult.setFailureCount(moduleResult.getFailureCount() + 1);
}
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Skip.name())) {
moduleResult.setSkipCount(moduleResult.getSkipCount() + 1);
}
if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Blocking.name())) {
moduleResult.setBlockingCount(moduleResult.getBlockingCount() + 1);
}
if (StringUtils.isNotBlank(testCase.getIssues())) {
if (JSON.parseObject(testCase.getIssues()).getBoolean("hasIssues")) {
moduleResult.setIssuesCount(moduleResult.getIssuesCount() + 1);

View File

@ -12,4 +12,9 @@ public class TestCaseReportModuleResultDTO {
private Integer passCount;
private Double passRate;
private Integer issuesCount;
private Integer prepareCount;
private Integer skipCount;
private Integer failureCount;
private Integer blockingCount;
private Integer underwayCount;
}

View File

@ -0,0 +1,80 @@
<template>
<common-component :title="$t('test_track.plan_view.defect_list')">
<template>
<el-table
row-key="id"
>
<el-table-column
prop="id"
:label="$t('commons.id')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="module"
:label="$t('test_track.module.module')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('test_track.module.title')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('描述')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('状态')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('处理人')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('创建时间')">
</el-table-column>
</el-table>
</template>
</common-component>
</template>
<script>
import CommonComponent from "./CommonComponent";
import PriorityTableItem from "../../../../../common/tableItems/planview/PriorityTableItem";
import TypeTableItem from "../../../../../common/tableItems/planview/TypeTableItem";
import MethodTableItem from "../../../../../common/tableItems/planview/MethodTableItem";
import StatusTableItem from "../../../../../common/tableItems/planview/StatusTableItem";
export default {
name: "DefectListComponent",
components: {StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem, CommonComponent},
props: {
failureTestCases: {
type: Array,
default() {
return [
{
title: 'testCase1',
},
{
title: 'testCase1',
}
]
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -7,6 +7,7 @@
<test-result-component v-if="preview.id == 2"/>
<test-result-chart-component v-if="preview.id == 3"/>
<failure-result-component v-if="preview.id == 4"/>
<defect-list-component v-if="preview.id == 5"/>
<rich-text-component :preview="preview" v-if="preview.type != 'system'"/>
</div>
@ -16,6 +17,7 @@
<test-result-component :test-results="metric.moduleExecuteResult" v-if="preview.id == 2"/>
<test-result-chart-component :execute-result="metric.executeResult" v-if="preview.id == 3"/>
<failure-result-component :failure-test-cases="metric.failureTestCases" v-if="preview.id == 4"/>
<defect-list-component :failure-test-cases="metric.failureTestCases" v-if="preview.id == 5"/>
<rich-text-component :is-report-view="isReportView" :preview="preview" v-if="preview.type != 'system'"/>
</div>
@ -28,10 +30,11 @@
import TestResultChartComponent from "./TestResultChartComponent";
import RichTextComponent from "./RichTextComponent";
import FailureResultComponent from "./FailureResultComponent";
import DefectListComponent from "./DefectListComponent";
export default {
name: "TemplateComponent",
components: {
FailureResultComponent,
FailureResultComponent,DefectListComponent,
RichTextComponent, TestResultChartComponent, TestResultComponent, BaseInfoComponent},
props: {
preview: {

View File

@ -18,6 +18,36 @@
:label="$t('test_track.plan_view.case_count')"
width="180">
</el-table-column>
<el-table-column
prop="passCount"
:label="$t('test_track.plan_view.pass')"
width="180">
</el-table-column>
<el-table-column
prop="failureCount"
:label="$t('test_track.plan_view.failure')"
width="180">
</el-table-column>
<el-table-column
prop="blockingCount"
:label="$t('test_track.plan_view.blocking')"
width="180">
</el-table-column>
<el-table-column
prop="skipCount"
:label="$t('test_track.plan_view.skip')"
width="180">
</el-table-column>
<el-table-column
prop="underwayCount"
:label="$t('test_track.plan.plan_status_running')"
width="180">
</el-table-column>
<el-table-column
prop="prepareCount"
:label="$t('test_track.plan.plan_status_prepare')"
width="180">
</el-table-column>
<el-table-column
prop="passRate"
:label="$t('test_track.pass_rate')">
@ -50,19 +80,37 @@
moduleName: this.$t('test_track.module.module') + '1',
caseCount: '14',
passRate: 10.8,
issuesCount: 3
issuesCount: 3,
passCount:0,
failureCount:0,
blockingCount:0,
skipCount:0,
underwayCount:0,
prepareCount:0
},
{
moduleName: this.$t('test_track.module.module') + '2',
caseCount: '24',
passRate: 40,
issuesCount: 6
moduleName: this.$t('test_track.module.module') + '1',
caseCount: '14',
passRate: 10.8,
issuesCount: 3,
passCount:0,
failureCount:0,
blockingCount:0,
skipCount:0,
underwayCount:0,
prepareCount:0
},
{
moduleName: this.$t('test_track.module.module') + '3',
caseCount: '50',
passRate: 76.9,
issuesCount: 8
moduleName: this.$t('test_track.module.module') + '1',
caseCount: '14',
passRate: 10.8,
issuesCount: 3,
passCount:0,
failureCount:0,
blockingCount:0,
skipCount:0,
underwayCount:0,
prepareCount:0
}
]
}

View File

@ -77,10 +77,11 @@
[2, { name: this.$t('test_track.plan_view.test_result'), id: 2 , type: 'system'}],
[3, { name: this.$t('test_track.plan_view.result_distribution'), id: 3 ,type: 'system'}],
[4, { name: this.$t('test_track.plan_view.failure_case'), id: 4 ,type: 'system'}],
[5, { name: this.$t('test_track.plan_view.custom_component'), id: 5 ,type: 'custom'}]
[5, { name: this.$t('test_track.plan_view.defect_list'), id: 5 ,type: 'system'}],
[6, { name: this.$t('test_track.plan_view.custom_component'), id:6,type: 'custom'}]
]
),
components: [5],
components: [6],
previews: [],
template: {},
isReport: false
@ -109,12 +110,12 @@
this.template = {
name: '',
content: {
components: [1,2,3,4,5],
components: [1,2,3,4,5,6],
customComponent: new Map()
}
};
this.previews = [];
this.components = [5];
this.components = [6];
if (id) {
this.type = 'edit';
this.getTemplateById(id);
@ -144,6 +145,7 @@
}
}
});
},
handleClose() {
window.removeEventListener('popstate', this.goBack, false);

View File

@ -69,7 +69,8 @@
[2, { name: this.$t('test_track.plan_view.test_result'), id: 2 , type: 'system'}],
[3, { name: this.$t('test_track.plan_view.result_distribution'), id: 3 ,type: 'system'}],
[4, { name: this.$t('test_track.plan_view.failure_case'), id: 4 ,type: 'system'}],
[5, { name: this.$t('test_track.plan_view.custom_component'), id: 5 ,type: 'custom'}]
[5, { name: this.$t('test_track.plan_view.defect_list'), id: 5 ,type: 'system'}],
[6, { name: this.$t('test_track.plan_view.custom_component'), id: 6 ,type: 'custom'}]
]
),
isTestManagerOrTestUser: false
@ -166,6 +167,7 @@
getMetric() {
this.result = this.$get('/test/plan/get/metric/' + this.planId, response => {
this.metric = response.data;
console.log(this.metric)
if (!this.metric.failureTestCases) {
this.metric.failureTestCases = [];
}

View File

@ -601,6 +601,7 @@ export default {
delete_confirm: "Confirm delete module:",
delete_all_resource: "and all submodules and test cases under the module",
module: "Module",
title:"Title"
},
home: {
recent_test: "Recent test",
@ -640,6 +641,7 @@ export default {
result_distribution: "Result distribution",
custom_component: "Custom",
create_report: "Create report",
defect_list:"Defect list",
view_report: "View report",
component_library: "Component library",
component_library_tip: "Drag and drop the component from the component library, add to the right, preview the report effect, only one can be added per system component.",

View File

@ -606,6 +606,7 @@ export default {
delete_confirm: "确认删除模块: ",
delete_all_resource: "以及模块下所有子模块和测试用例",
module: "模块",
title:"标题",
},
home: {
recent_test: "最近测试",
@ -644,6 +645,7 @@ export default {
test_result: "测试结果",
result_distribution: "测试结果分布",
custom_component: "自定义模块",
defect_list:"缺陷列表",
create_report: "创建测试报告",
view_report: "查看测试报告",
component_library: "组件库",

View File

@ -601,6 +601,7 @@ export default {
delete_confirm: "確認刪除模塊: ",
delete_all_resource: "以及模塊下所有子模塊和測試用例",
module: "模塊",
title:"標題",
},
home: {
recent_test: "最近測試",
@ -640,6 +641,7 @@ export default {
result_distribution: "測試結果分布",
custom_component: "自定義模塊",
create_report: "創建測試報告",
defect_list:"缺陷清單",
view_report: "查看測試報告",
component_library: "組件庫",
component_library_tip: "拖拽組件庫中組件,添加至右側,預覽報告效果,每個系統組件只能添加壹個。",