Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
cc4e7290
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc4e7290
编写于
6月 15, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试报告失败列表
上级
ae8c7ee6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
146 addition
and
5 deletion
+146
-5
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
...metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
+3
-0
backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java
...ava/io/metersphere/track/dto/TestCaseReportMetricDTO.java
+1
-0
backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java
.../track/request/testplancase/QueryTestPlanCaseRequest.java
+2
-0
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
...in/java/io/metersphere/track/service/TestPlanService.java
+15
-4
frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue
...nents/report/TemplateComponent/FailureResultComponent.vue
+119
-0
frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue
.../comonents/report/TemplateComponent/TemplateComponent.vue
+6
-1
未找到文件。
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
浏览文件 @
cc4e7290
...
...
@@ -36,6 +36,9 @@
#{nodeId}
</foreach>
</if>
<if
test=
"request.status != null"
>
and test_plan_test_case.status = #{request.status}
</if>
<if
test=
"request.executor != null"
>
and test_plan_test_case.executor = #{request.executor}
</if>
...
...
backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java
浏览文件 @
cc4e7290
...
...
@@ -11,6 +11,7 @@ public class TestCaseReportMetricDTO {
private
List
<
TestCaseReportStatusResultDTO
>
executeResult
;
private
List
<
TestCaseReportModuleResultDTO
>
moduleExecuteResult
;
private
List
<
TestPlanCaseDTO
>
failureTestCases
;
private
List
<
String
>
executors
;
private
String
principal
;
private
Long
startTime
;
...
...
backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java
浏览文件 @
cc4e7290
...
...
@@ -25,4 +25,6 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase {
private
String
workspaceId
;
private
String
name
;
private
String
status
;
}
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
浏览文件 @
cc4e7290
...
...
@@ -3,10 +3,7 @@ package io.metersphere.track.service;
import
com.alibaba.fastjson.JSON
;
import
io.metersphere.base.domain.*
;
import
io.metersphere.base.mapper.TestCaseMapper
;
import
io.metersphere.base.mapper.TestCaseNodeMapper
;
import
io.metersphere.base.mapper.TestPlanMapper
;
import
io.metersphere.base.mapper.TestPlanTestCaseMapper
;
import
io.metersphere.base.mapper.*
;
import
io.metersphere.base.mapper.ext.ExtProjectMapper
;
import
io.metersphere.base.mapper.ext.ExtTestPlanMapper
;
import
io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper
;
...
...
@@ -67,6 +64,9 @@ public class TestPlanService {
@Resource
ExtProjectMapper
extProjectMapper
;
@Resource
TestCaseReportMapper
testCaseReportMapper
;
public
void
addTestPlan
(
TestPlan
testPlan
)
{
if
(
getTestPlanByName
(
testPlan
.
getName
()).
size
()
>
0
)
{
MSException
.
throwException
(
Translator
.
get
(
"plan_name_already_exists"
));
...
...
@@ -256,6 +256,8 @@ public class TestPlanService {
QueryTestPlanRequest
queryTestPlanRequest
=
new
QueryTestPlanRequest
();
queryTestPlanRequest
.
setId
(
planId
);
TestPlanDTO
testPlan
=
extTestPlanMapper
.
list
(
queryTestPlanRequest
).
get
(
0
);
TestCaseReport
testCaseReport
=
testCaseReportMapper
.
selectByPrimaryKey
(
testPlan
.
getReportId
());
// testCaseReport.get
Set
<
String
>
executors
=
new
HashSet
<>();
Map
<
String
,
TestCaseReportStatusResultDTO
>
reportStatusResultMap
=
new
HashMap
<>();
...
...
@@ -274,6 +276,7 @@ public class TestPlanService {
});
List
<
TestPlanCaseDTO
>
testPlanTestCases
=
listTestCaseByPlanId
(
planId
);
List
<
TestPlanCaseDTO
>
failureTestCases
=
new
ArrayList
<>();
Map
<
String
,
TestCaseReportModuleResultDTO
>
moduleResultMap
=
new
HashMap
<>();
...
...
@@ -281,6 +284,7 @@ public class TestPlanService {
executors
.
add
(
testCase
.
getExecutor
());
getStatusResultMap
(
reportStatusResultMap
,
testCase
);
getModuleResultMap
(
childIdMap
,
moduleResultMap
,
testCase
,
nodeTrees
);
getFailureTestCases
(
failureTestCases
,
testCase
);
}
nodeTrees
.
forEach
(
rootNode
->
{
...
...
@@ -303,10 +307,17 @@ public class TestPlanService {
testCaseReportMetricDTO
.
setExecutors
(
new
ArrayList
<>(
executors
));
testCaseReportMetricDTO
.
setExecuteResult
(
new
ArrayList
<>(
reportStatusResultMap
.
values
()));
testCaseReportMetricDTO
.
setModuleExecuteResult
(
new
ArrayList
<>(
moduleResultMap
.
values
()));
testCaseReportMetricDTO
.
setFailureTestCases
(
failureTestCases
);
return
testCaseReportMetricDTO
;
}
private
void
getFailureTestCases
(
List
<
TestPlanCaseDTO
>
failureTestCases
,
TestPlanCaseDTO
testCase
)
{
if
(
StringUtils
.
equals
(
testCase
.
getStatus
(),
TestPlanTestCaseStatus
.
Failure
.
name
()))
{
failureTestCases
.
add
(
testCase
);
}
}
private
void
getStatusResultMap
(
Map
<
String
,
TestCaseReportStatusResultDTO
>
reportStatusResultMap
,
TestPlanCaseDTO
testCase
)
{
TestCaseReportStatusResultDTO
statusResult
=
reportStatusResultMap
.
get
(
testCase
.
getStatus
());
if
(
statusResult
==
null
)
{
...
...
frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue
0 → 100644
浏览文件 @
cc4e7290
<
template
>
<common-component
:title=
"'失败用例'"
>
<template>
<el-table
row-key=
"id"
:data=
"failureTestCases"
>
<el-table-column
prop=
"name"
:label=
"$t('commons.name')"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"priority"
column-key=
"priority"
:label=
"$t('test_track.case.priority')"
>
<template
v-slot:default=
"scope"
>
<priority-table-item
:value=
"scope.row.priority"
ref=
"priority"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
column-key=
"type"
:label=
"$t('test_track.case.type')"
show-overflow-tooltip
>
<
template
v-slot:default=
"scope"
>
<type-table-item
:value=
"scope.row.type"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"method"
column-key=
"method"
:label=
"$t('test_track.case.method')"
show-overflow-tooltip
>
<
template
v-slot:default=
"scope"
>
<method-table-item
:value=
"scope.row.method"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"nodePath"
:label=
"$t('test_track.case.module')"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"executorName"
:label=
"$t('test_track.plan_view.executor')"
>
</el-table-column>
<el-table-column
prop=
"status"
column-key=
"status"
:label=
"$t('test_track.plan_view.execute_result')"
>
<
template
v-slot:default=
"scope"
>
<status-table-item
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
sortable
prop=
"updateTime"
:label=
"$t('commons.update_time')"
show-overflow-tooltip
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
updateTime
|
timestampFormatDate
}}
</span>
</
template
>
</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
:
"
FailureResultComponent
"
,
components
:
{
StatusTableItem
,
MethodTableItem
,
TypeTableItem
,
PriorityTableItem
,
CommonComponent
},
props
:
{
failureTestCases
:
{
type
:
Array
,
default
()
{
return
[
{
moduleName
:
this
.
$t
(
'
test_track.module.module
'
)
+
'
1
'
,
caseCount
:
'
14
'
,
passRate
:
10.8
,
issuesCount
:
3
},
{
moduleName
:
this
.
$t
(
'
test_track.module.module
'
)
+
'
2
'
,
caseCount
:
'
24
'
,
passRate
:
40
,
issuesCount
:
6
},
{
moduleName
:
this
.
$t
(
'
test_track.module.module
'
)
+
'
3
'
,
caseCount
:
'
50
'
,
passRate
:
76.9
,
issuesCount
:
8
}
]
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue
浏览文件 @
cc4e7290
...
...
@@ -7,6 +7,7 @@
<test-result-component
v-if=
"preview.id == 2"
/>
<test-result-chart-component
v-if=
"preview.id == 3"
/>
<rich-text-component
:preview=
"preview"
v-if=
"preview.type != 'system'"
/>
<failure-result-component/>
</div>
<!--报告-->
...
...
@@ -15,6 +16,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"
/>
<rich-text-component
:is-report-view=
"isReportView"
:preview=
"preview"
v-if=
"preview.type != 'system'"
/>
<failure-result-component
:failure-test-cases=
"metric.failureTestCases"
/>
</div>
</div>
...
...
@@ -25,9 +27,12 @@
import
TestResultComponent
from
"
./TestResultComponent
"
;
import
TestResultChartComponent
from
"
./TestResultChartComponent
"
;
import
RichTextComponent
from
"
./RichTextComponent
"
;
import
FailureResultComponent
from
"
./FailureResultComponent
"
;
export
default
{
name
:
"
TemplateComponent
"
,
components
:
{
RichTextComponent
,
TestResultChartComponent
,
TestResultComponent
,
BaseInfoComponent
},
components
:
{
FailureResultComponent
,
RichTextComponent
,
TestResultChartComponent
,
TestResultComponent
,
BaseInfoComponent
},
props
:
{
preview
:
{
type
:
Object
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录