Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
b095e363
提交
b095e363
authored
3月 18, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(web): 修复了报告中的bug
上级
b21248f8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
123 行增加
和
178 行删除
+123
-178
overview.ftl
kt-base/src/main/resources/templates/overview.ftl
+8
-33
Controller.java
.../main/java/org/matrix/autotest/controller/Controller.java
+0
-36
index.html
kt-web/src/main/resources/reports/index.html
+115
-109
没有找到文件。
kt-base/src/main/resources/templates/overview.ftl
浏览文件 @
b095e363
...
...
@@ -20,47 +20,27 @@
<div
class=
"topTitle"
>
报告汇总
</div>
<form
class=
"form"
>
<
#
if
overView
??
>
<div
class=
"form-group flex"
>
<label
for=
"total"
>
用例总数:
</label>
<input
class=
"form-control"
id=
"total"
readonly=
"readonly"
value=
"${overView.total!}"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"allTime"
>
执行时间(s):
</label>
<input
class=
"form-control"
id=
"allTime"
readonly=
"readonly"
value=
"${overView.allTime!}"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"passNum"
>
通过:
</label>
<input
class=
"form-control"
id=
"passNum"
readonly=
"readonly"
value=
"${overView.passNum!}"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"failNum"
>
失败:
</label>
<input
class=
"form-control"
id=
"failNum"
readonly=
"readonly"
value=
"${overView.failNum!}"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"probability"
>
测试通过率:
</label>
<input
class=
"form-control"
id=
"probability"
readonly=
"readonly"
value=
"${overView.probability!}"
/>
</div>
<
#
else
>
<div
class=
"form-group flex"
>
<label
for=
"total"
>
用例总数:
</label>
<input
class=
"form-control"
id=
"total"
readonly=
"readonly"
value=
"
0
"
/>
<input
class=
"form-control"
id=
"total"
readonly=
"readonly"
value=
"
${overView.total!}
"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"allTime"
>
执行时间(s):
</label>
<input
class=
"form-control"
id=
"allTime"
readonly=
"readonly"
value=
"
0
"
/>
<input
class=
"form-control"
id=
"allTime"
readonly=
"readonly"
value=
"
${overView.allTime!}
"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"passNum"
>
通过:
</label>
<input
class=
"form-control"
id=
"passNum"
readonly=
"readonly"
value=
"
0
"
/>
<input
class=
"form-control"
id=
"passNum"
readonly=
"readonly"
value=
"
${overView.passNum!}
"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"failNum"
>
失败:
</label>
<input
class=
"form-control"
id=
"failNum"
readonly=
"readonly"
value=
"
0
"
/>
<input
class=
"form-control"
id=
"failNum"
readonly=
"readonly"
value=
"
${overView.failNum!}
"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"probability"
>
测试通过率:
</label>
<input
class=
"form-control"
id=
"probability"
readonly=
"readonly"
value=
"
0
"
/>
<input
class=
"form-control"
id=
"probability"
readonly=
"readonly"
value=
"
${overView.probability!}
"
/>
</div>
<
#
else
>
</
#
if>
</form>
</div>
...
...
@@ -133,7 +113,6 @@
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
Save changes
</button>
</div>
</div>
</div>
...
...
@@ -155,15 +134,15 @@
$
(
".clickClass"
).
each
((
i
,
v
)
=>
{
v
.
onclick
=
function
()
{
if
(
!
v
.
getAttribute
(
'data-message'
))
{
if
(
!
v
.
getAttribute
(
'data-message'
))
{
alert
(
'该条测试数据执行失败'
)
return
}
let
data
=
handleData
(
v
.
getAttribute
(
'data-message'
))
$
(
'#myModal'
).
modal
()
if
(
data
)
{
console
.
log
(
data
)
let
oDiv
=
document
.
getElementById
(
'grp'
)
$
(
"#grp"
).
empty
();
data
.
map
(
v
=>
{
let
div1
=
document
.
createElement
(
'div'
)
let
lab1
=
document
.
createElement
(
'label'
)
...
...
@@ -177,12 +156,9 @@
div1
.
appendChild
(
lab2
)
oDiv
.
appendChild
(
div1
)
})
}
}
})
</script>
</body>
</html>
\ No newline at end of file
kt-web/src/main/java/org/matrix/autotest/controller/Controller.java
deleted
100644 → 0
浏览文件 @
b21248f8
package
org
.
matrix
.
autotest
.
controller
;
import
org.matrix.testNg.web.vo.DataBeansJobVo
;
import
org.matrix.testNg.web.vo.DataBeansVo
;
import
org.matrix.testNg.web.entity.ReportMessage
;
import
org.matrix.testNg.web.report.TestNgImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author MRY
*/
@RestController
@RequestMapping
(
"/tests"
)
public
class
Controller
{
@Autowired
private
TestNgImpl
testNg
;
@PostMapping
(
"/test"
)
public
ReportMessage
test
(
@RequestBody
DataBeansVo
dataBeansVo
)
{
System
.
out
.
println
(
testNg
.
getReportUrl
(
dataBeansVo
));
return
testNg
.
getReportUrl
(
dataBeansVo
);
}
@PostMapping
(
"/test1"
)
public
ReportMessage
test1
(
@RequestBody
DataBeansJobVo
dataBeansJobVo
)
{
System
.
out
.
println
(
testNg
.
getReporterUrls
(
dataBeansJobVo
));
return
testNg
.
getReporterUrls
(
dataBeansJobVo
);
}
}
kt-web/src/main/resources/reports/index.html
浏览文件 @
b095e363
...
...
@@ -12,123 +12,128 @@
</head>
<body>
<div
class=
"top"
>
测试报告
<div
class=
"top"
>
测试报告
</div>
<div
class=
"content"
>
<div
class=
"topForm"
>
<div
class=
"topTitle"
>
报告汇总
</div>
<form
class=
"form"
>
<div
class=
"form-group flex"
>
<label
for=
"total"
>
用例总数:
</label>
<input
type=
"text"
class=
"form-control"
id=
"total"
readonly=
"readonly"
value=
"total"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"allTime"
>
执行时间(s):
</label>
<input
type=
"text"
class=
"form-control"
id=
"allTime"
readonly=
"readonly"
value=
"allTime"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"passNum"
>
通过:
</label>
<input
type=
"text"
class=
"form-control"
id=
"passNum"
readonly=
"readonly"
value=
"passNum"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"failNum"
>
失败:
</label>
<input
type=
"text"
class=
"form-control"
id=
"failNum"
readonly=
"readonly"
value=
"failNum"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"probability"
>
测试通过率:
</label>
<input
type=
"text"
class=
"form-control"
id=
"probability"
readonly=
"readonly"
value=
"probability"
/>
</div>
</form>
</div>
<div
class=
"content"
>
<div
class=
"topForm"
>
<div
class=
"topTitle"
>
报告汇总
</div>
<form
class=
"form"
>
<div
class=
"form-group flex"
>
<label
for=
"total"
>
用例总数:
</label>
<input
type=
"text"
class=
"form-control"
id=
"total"
readonly=
"readonly"
value=
"total"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"allTime"
>
执行时间(s):
</label>
<input
type=
"text"
class=
"form-control"
id=
"allTime"
readonly=
"readonly"
value=
"allTime"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"passNum"
>
通过:
</label>
<input
type=
"text"
class=
"form-control"
id=
"passNum"
readonly=
"readonly"
value=
"passNum"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"failNum"
>
失败:
</label>
<input
type=
"text"
class=
"form-control"
id=
"failNum"
readonly=
"readonly"
value=
"failNum"
/>
</div>
<div
class=
"form-group flex"
>
<label
for=
"probability"
>
测试通过率:
</label>
<input
type=
"text"
class=
"form-control"
id=
"probability"
readonly=
"readonly"
value=
"probability"
/>
</div>
</form>
</div>
<div
class=
"table"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
编号
</th>
<th>
用例名称
</th>
<th>
用例类型
</th>
<th>
详细参数
</th>
<th>
用例描述
</th>
<th>
执行结果
</th>
<th>
执行时间
</th>
<th>
结果信息
</th>
</tr>
</thead>
<tbody>
<tr>
<th
scope=
"row"
>
1
</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td
class=
"clickClass"
data-message=
"CheckPointResult(checkPointResultDetails=[CheckPointResultDetail(isSuccess=true, type=EXCEPTION_CHECK, matchExpression=string, parseExpression=string, message=string)])"
>
点击
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"table"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
编号
</th>
<th>
用例名称
</th>
<th>
用例类型
</th>
<th>
详细参数
</th>
<th>
用例描述
</th>
<th>
执行结果
</th>
<th>
执行时间
</th>
<th>
结果信息
</th>
</tr>
</thead>
<tbody>
<tr>
<th
scope=
"row"
>
1
</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td
class=
"clickClass"
data-message=
"CheckPointResult(checkPointResultDetails=[CheckPointResultDetail(isSuccess=true, type=EXCEPTION_CHECK, matchExpression=string, parseExpression=string, message=string)])"
>
点击
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
Modal title
</h4>
</div>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal"
id=
"grp"
>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
Save changes
</button>
</div>
</div>
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
Modal title
</h4>
</div>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal"
id=
"grp"
>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
Save changes
</button>
</div>
</div>
</div>
<script
src=
"./js/jquery.min.js"
></script>
<script
src=
"./js/bootstrap.js"
></script>
<script>
function
handleData
(
data
)
{
let
a
=
data
let
b
=
a
.
split
(
'='
).
splice
(
1
,
a
.
split
(
'='
).
length
-
2
)
let
c
=
b
.
join
(
'='
).
split
(
'('
)[
1
].
split
(
')'
)[
0
]
let
d
=
c
.
split
(
','
)
let
e
=
[]
d
.
map
(
v
=>
{
e
.
push
({
key
:
v
.
split
(
'='
)[
0
],
value
:
v
.
split
(
'='
)[
1
]
})
})
return
e
}
$
(
".clickClass"
).
each
((
i
,
v
)
=>
{
v
.
onclick
=
function
()
{
let
data
=
handleData
(
v
.
getAttribute
(
'data-message'
))
$
(
'#myModal'
).
modal
()
if
(
data
){
console
.
log
(
data
)
let
oDiv
=
document
.
getElementById
(
'grp'
)
data
.
map
(
v
=>
{
let
div1
=
document
.
createElement
(
'div'
)
let
lab1
=
document
.
createElement
(
'label'
)
let
lab2
=
document
.
createElement
(
'label'
)
div1
.
className
=
'form-group'
lab1
.
className
=
'col-sm-4 control-label w20'
lab2
.
className
=
'col-sm-6 control-label txtl'
lab1
.
innerText
=
v
.
key
lab2
.
innerText
=
v
.
value
div1
.
appendChild
(
lab1
)
div1
.
appendChild
(
lab2
)
oDiv
.
appendChild
(
div1
)
})
</div>
<script
src=
"./js/jquery.min.js"
></script>
<script
src=
"./js/bootstrap.js"
></script>
<script>
function
handleData
(
data
)
{
let
a
=
data
let
b
=
a
.
split
(
'='
).
splice
(
1
,
a
.
split
(
'='
).
length
-
2
)
let
c
=
b
.
join
(
'='
).
split
(
'('
)[
1
].
split
(
')'
)[
0
]
let
d
=
c
.
split
(
','
)
let
e
=
[]
d
.
map
(
v
=>
{
e
.
push
({
key
:
v
.
split
(
'='
)[
0
],
value
:
v
.
split
(
'='
)[
1
]})
})
return
e
}
}
$
(
".clickClass"
).
each
((
i
,
v
)
=>
{
v
.
onclick
=
function
()
{
let
data
=
handleData
(
v
.
getAttribute
(
'data-message'
))
$
(
'#myModal'
).
modal
()
if
(
data
)
{
let
oDiv
=
document
.
getElementById
(
'grp'
)
$
(
"#grp"
).
empty
();
data
.
map
(
v
=>
{
let
div1
=
document
.
createElement
(
'div'
)
let
lab1
=
document
.
createElement
(
'label'
)
let
lab2
=
document
.
createElement
(
'label'
)
div1
.
className
=
'form-group'
lab1
.
className
=
'col-sm-4 control-label w20'
lab2
.
className
=
'col-sm-6 control-label txtl'
lab1
.
innerText
=
v
.
key
lab2
.
innerText
=
v
.
value
div1
.
appendChild
(
lab1
)
div1
.
appendChild
(
lab2
)
oDiv
.
appendChild
(
div1
)
})
}
})
}
})
</script>
</script>
</body>
</html>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论