Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
1294739d
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,发现更多精彩内容 >>
提交
1294739d
编写于
4月 23, 2020
作者:
Q
q4speed
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
run button
上级
39fc9394
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
15 deletion
+43
-15
backend/src/main/java/io/metersphere/api/controller/APITestController.java
...java/io/metersphere/api/controller/APITestController.java
+5
-5
backend/src/main/java/io/metersphere/api/service/ApiTestService.java
.../main/java/io/metersphere/api/service/ApiTestService.java
+4
-0
frontend/src/business/components/api/test/ApiTestConfig.vue
frontend/src/business/components/api/test/ApiTestConfig.vue
+32
-9
frontend/src/business/components/api/test/ApiTestList.vue
frontend/src/business/components/api/test/ApiTestList.vue
+1
-1
frontend/src/i18n/zh-CN.js
frontend/src/i18n/zh-CN.js
+1
-0
未找到文件。
backend/src/main/java/io/metersphere/api/controller/APITestController.java
浏览文件 @
1294739d
...
...
@@ -60,9 +60,9 @@ public class APITestController {
public
void
delete
(
@RequestBody
DeleteAPITestRequest
request
)
{
apiTestService
.
delete
(
request
);
}
//
//
@PostMapping("/run")
// public void run(@RequestBody RunTestPlan
Request request) {
//
apiTestService.run(request);
//
}
@PostMapping
(
"/run"
)
public
void
run
(
@RequestBody
SaveAPITest
Request
request
)
{
apiTestService
.
run
(
request
);
}
}
backend/src/main/java/io/metersphere/api/service/ApiTestService.java
浏览文件 @
1294739d
...
...
@@ -66,6 +66,10 @@ public class ApiTestService {
apiTestMapper
.
deleteByPrimaryKey
(
request
.
getId
());
}
public
void
run
(
SaveAPITestRequest
request
)
{
save
(
request
);
}
private
ApiTestWithBLOBs
updateTest
(
SaveAPITestRequest
request
)
{
final
ApiTestWithBLOBs
test
=
new
ApiTestWithBLOBs
();
test
.
setId
(
request
.
getId
());
...
...
frontend/src/business/components/api/test/ApiTestConfig.vue
浏览文件 @
1294739d
...
...
@@ -11,7 +11,15 @@
<el-option
v-for=
"project in projects"
:key=
"project.id"
:label=
"project.name"
:value=
"project.id"
/>
</el-select>
</el-input>
<el-button
type=
"primary"
plain
:disabled=
"isDisabled"
@
click=
"saveTest"
>
{{
$t
(
'
commons.save
'
)
}}
</el-button>
<el-button
type=
"primary"
plain
:disabled=
"isDisabled"
@
click=
"saveTest"
>
{{
$t
(
'
commons.save
'
)
}}
</el-button>
<el-button
type=
"primary"
plain
:disabled=
"isDisabled"
@
click=
"runTest"
>
{{
$t
(
'
load_test.save_and_run
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
@
click=
"clear"
>
{{
$t
(
'
commons.cancel
'
)
}}
</el-button>
</el-row>
</el-header>
<ms-api-scenario-config
:scenarios=
"test.scenarioDefinition"
ref=
"config"
/>
...
...
@@ -43,7 +51,7 @@
watch
:
{
'
$route
'
(
to
)
{
if
(
to
.
params
.
type
===
"
edit
"
)
{
if
(
to
.
query
.
id
)
{
this
.
getTest
(
to
.
query
.
id
);
}
else
{
this
.
test
=
new
Test
();
...
...
@@ -75,20 +83,35 @@
saveTest
:
function
()
{
this
.
change
=
false
;
let
param
=
{
id
:
this
.
test
.
id
,
projectId
:
this
.
test
.
projectId
,
name
:
this
.
test
.
name
,
scenarioDefinition
:
JSON
.
stringify
(
this
.
test
.
scenarioDefinition
)
}
this
.
result
=
this
.
$post
(
"
/api/save
"
,
this
.
getParam
(),
response
=>
{
this
.
test
.
id
=
response
.
data
;
this
.
$message
({
message
:
this
.
$t
(
'
commons.save_success
'
),
type
:
'
success
'
});
});
},
runTest
:
function
()
{
this
.
change
=
false
;
this
.
result
=
this
.
$post
(
"
/api/
save
"
,
param
,
response
=>
{
this
.
result
=
this
.
$post
(
"
/api/
run
"
,
this
.
getParam
()
,
response
=>
{
this
.
test
.
id
=
response
.
data
;
this
.
$message
({
message
:
this
.
$t
(
'
commons.save_success
'
),
type
:
'
success
'
});
});
},
clear
:
function
()
{
this
.
test
=
new
Test
();
},
getParam
:
function
()
{
return
{
id
:
this
.
test
.
id
,
projectId
:
this
.
test
.
projectId
,
name
:
this
.
test
.
name
,
scenarioDefinition
:
JSON
.
stringify
(
this
.
test
.
scenarioDefinition
)
}
}
},
...
...
frontend/src/business/components/api/test/ApiTestList.vue
浏览文件 @
1294739d
...
...
@@ -4,7 +4,7 @@
<el-card>
<template
v-slot:header
>
<ms-table-header
:condition.sync=
"condition"
@
search=
"search"
:title=
"$t('commons.test')"
@
create=
"create"
/>
@
create=
"create"
:createTip=
"$t('load_test.create')"
/>
</
template
>
<el-table
:data=
"tableData"
class=
"test-content"
>
<el-table-column
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
1294739d
...
...
@@ -171,6 +171,7 @@ export default {
'
resource_pool_is_null
'
:
'
资源池为空
'
,
},
api_test
:
{
save_and_run
:
"
保存并执行
"
,
input_name
:
"
请输入测试名称
"
,
select_project
:
"
请选择项目
"
,
scenario
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录