Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
d50df304
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,体验更适合开发者的 AI 搜索 >>
提交
d50df304
编写于
5月 11, 2021
作者:
F
fit2-zhao
提交者:
BugKing
5月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(场景自动化): 修复JSONSchema Number 类型小数点后内容丢失问题;修复循环结果不展示问题。
上级
af276a45
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
5 deletion
+26
-5
backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java
...java/io/metersphere/commons/json/JSONSchemaGenerator.java
+20
-1
frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue
...onents/api/automation/scenario/component/ApiComponent.vue
+2
-2
frontend/src/business/components/api/automation/scenario/component/LoopController.vue
...ents/api/automation/scenario/component/LoopController.vue
+4
-2
未找到文件。
backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java
浏览文件 @
d50df304
...
...
@@ -143,7 +143,7 @@ public class JSONSchemaGenerator {
// TODO 6.3.3 in json-schema-validation
}
}
else
if
(
propertyObjType
.
equals
(
"integer"
)
||
propertyObjType
.
equals
(
"number"
)
)
{
}
else
if
(
propertyObjType
.
equals
(
"integer"
))
{
// 先设置空值
concept
.
put
(
propertyName
,
0
);
if
(
object
.
has
(
"default"
))
{
...
...
@@ -183,6 +183,25 @@ public class JSONSchemaGenerator {
}
// Section 6.2.5 in json-schema-validation. Resolved as OCL
}
else
if
(
propertyObjType
.
equals
(
"number"
))
{
// 先设置空值
concept
.
put
(
propertyName
,
0
);
if
(
object
.
has
(
"default"
))
{
concept
.
put
(
propertyName
,
object
.
get
(
"default"
));
}
if
(
object
.
has
(
"mock"
)
&&
object
.
get
(
"mock"
).
getAsJsonObject
()
!=
null
&&
StringUtils
.
isNotEmpty
(
object
.
get
(
"mock"
).
getAsJsonObject
().
get
(
"mock"
).
getAsString
()))
{
try
{
Number
value
=
object
.
get
(
"mock"
).
getAsJsonObject
().
get
(
"mock"
).
getAsNumber
();
if
(
value
.
toString
().
indexOf
(
"."
)
==
-
1
)
{
concept
.
put
(
propertyName
,
value
.
intValue
());
}
else
{
concept
.
put
(
propertyName
,
value
.
floatValue
());
}
}
catch
(
Exception
e
)
{
String
value
=
ScriptEngineUtils
.
calculate
(
object
.
get
(
"mock"
).
getAsJsonObject
().
get
(
"mock"
).
getAsString
());
concept
.
put
(
propertyName
,
value
);
}
}
}
else
if
(
propertyObjType
.
equals
(
"boolean"
))
{
// 先设置空值
concept
.
put
(
propertyName
,
false
);
...
...
frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue
浏览文件 @
d50df304
...
...
@@ -58,7 +58,7 @@
<el-tabs
v-model=
"request.activeName"
closable
class=
"ms-tabs"
>
<el-tab-pane
:label=
"item.name"
:name=
"item.name"
v-for=
"(item,index) in request.result.scenarios"
:key=
"index"
>
<div
v-for=
"(result,i) in item.requestResults"
:key=
"i"
style=
"margin-bottom: 5px"
>
<api-response-component
v-if=
"result.
name===request.name
"
:result=
"result"
/>
<api-response-component
v-if=
"result.
id===request.id
"
:result=
"result"
/>
</div>
</el-tab-pane>
</el-tabs>
...
...
@@ -168,7 +168,7 @@
watch
:
{
envMap
()
{
this
.
getEnvironments
();
}
}
,
},
computed
:
{
displayColor
()
{
...
...
frontend/src/business/components/api/automation/scenario/component/LoopController.vue
浏览文件 @
d50df304
...
...
@@ -12,7 +12,7 @@
<
template
v-slot:message
>
<span
v-if=
"requestResult && requestResult.scenarios && requestResult.scenarios.length > 0 "
style=
"color: #8c939d;margin-right: 10px"
>
{{
$t
(
'
api_test.automation.loop_name
'
)
}}{{
requestResult
.
scenarios
.
length
}}
次 成功
{{
success
}}
次 失败
{{
error
}}
次
<!--
{{
$t
(
'
api_test.automation.loop_name
'
)
}}{{
requestResult
.
scenarios
.
length
}}
次 成功
{{
success
}}
次 失败
{{
error
}}
次-->
</span>
</
template
>
...
...
@@ -280,6 +280,7 @@
if
(
item
.
type
===
"
HTTPSamplerProxy
"
||
item
.
type
===
"
DubboSampler
"
||
item
.
type
===
"
JDBCSampler
"
||
item
.
type
===
"
TCPSampler
"
)
{
item
.
result
=
this
.
requestResult
;
item
.
activeName
=
this
.
activeName
;
item
.
active
=
true
;
item
.
requestResult
=
undefined
;
}
if
(
item
.
hashTree
&&
item
.
hashTree
.
length
>
0
)
{
...
...
@@ -318,11 +319,12 @@
this
.
activeName
=
this
.
requestResult
&&
this
.
requestResult
.
scenarios
&&
this
.
requestResult
.
scenarios
!==
null
&&
this
.
requestResult
.
scenarios
.
length
>
0
?
this
.
requestResult
.
scenarios
[
0
].
name
:
""
;
// 把请求结果分给各个请求
this
.
setResult
(
this
.
controller
.
hashTree
);
this
.
$emit
(
"
refReload
"
);
this
.
$emit
(
"
refReload
"
,
this
.
node
);
}
catch
(
e
)
{
throw
e
;
}
this
.
loading
=
false
;
this
.
node
.
expanded
=
true
;
this
.
reload
();
}
else
{
setTimeout
(
this
.
getReport
,
2000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录