Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
dc0ab3b2
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,发现更多精彩内容 >>
提交
dc0ab3b2
编写于
5月 29, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试用例关联性能测试页面
上级
093ac790
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
357 addition
and
21 deletion
+357
-21
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
...onents/track/plan/view/comonents/TestPlanTestCaseEdit.vue
+10
-21
frontend/src/business/components/track/plan/view/comonents/test/PerformanceTestDetail.vue
.../track/plan/view/comonents/test/PerformanceTestDetail.vue
+123
-0
frontend/src/business/components/track/plan/view/comonents/test/PerformanceTestResult.vue
.../track/plan/view/comonents/test/PerformanceTestResult.vue
+224
-0
未找到文件。
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
浏览文件 @
dc0ab3b2
...
...
@@ -89,12 +89,12 @@
<el-col
class=
"test-detail"
:span=
"20"
:offset=
"1"
>
<el-tabs
type=
"border-card"
>
<el-tab-pane
:label=
"$t('test_track.plan_view.test_detail')"
>
<api-test-detail
v-if=
"testCase.type == 'api'"
@
runTest=
"apiTestRun"
:id=
"testCase.testId"
v-show=
"testCase.type == 'api'"
ref=
"apiTestDetail"
/>
<
edit-performance-test-plan
v-if=
"testCase.type == 'performance'
"
/>
<api-test-detail
v-if=
"testCase.type == 'api'"
@
runTest=
"apiTestRun"
:id=
"testCase.testId"
ref=
"apiTestDetail"
/>
<
performance-test-detail
v-if=
"testCase.type == 'performance'"
:id=
"testCase.testId"
ref=
"performanceTestDetail
"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('test_track.plan_view.test_result')"
>
<api-test-result
:report-id=
"testCase.reportId"
v-if=
" testCase.type == 'api'"
ref=
"apiTestResult"
/>
<performance-
report-view
v-if=
"testCase.type == 'performance'"
/>
<performance-
test-result
:report-id=
"testCase.reportId"
v-if=
"testCase.type == 'performance'"
/>
</el-tab-pane>
</el-tabs>
</el-col>
...
...
@@ -199,20 +199,19 @@
<
script
>
import
TestPlanTestCaseStatusButton
from
'
../../common/TestPlanTestCaseStatusButton
'
;
import
ClassicEditor
from
'
@ckeditor/ckeditor5-build-classic
'
;
import
MsApiTestConfig
from
"
../../../../api/test/ApiTestConfig
"
;
import
MsApiReportView
from
"
../../../../api/report/ApiReportView
"
;
import
EditPerformanceTestPlan
from
"
../../../../performance/test/EditPerformanceTestPlan
"
;
import
PerformanceReportView
from
"
../../../../performance/report/PerformanceReportView
"
;
import
ApiTestDetail
from
"
./test/ApiTestDetail
"
;
import
ApiTestResult
from
"
./test/ApiTestResult
"
;
import
PerformanceTestDetail
from
"
./test/PerformanceTestDetail
"
;
import
PerformanceTestResult
from
"
./test/PerformanceTestResult
"
;
export
default
{
name
:
"
TestPlanTestCaseEdit
"
,
components
:
{
PerformanceTestResult
,
PerformanceTestDetail
,
ApiTestResult
,
ApiTestDetail
,
PerformanceReportView
,
EditPerformanceTestPlan
,
MsApiReportView
,
MsApiTestConfig
,
TestPlanTestCaseStatusButton
},
TestPlanTestCaseStatusButton
},
data
()
{
return
{
result
:
{},
...
...
@@ -304,17 +303,14 @@
},
initTest
()
{
this
.
$nextTick
(()
=>
{
if
(
this
.
testCase
.
method
==
'
auto
'
)
{
if
(
this
.
$refs
.
apiTestDetail
&&
this
.
testCase
.
type
==
'
api
'
)
{
this
.
$refs
.
apiTestDetail
.
init
();
}
else
if
(
this
.
testCase
.
type
==
'
performance
'
)
{
this
.
$refs
.
performanceTestDetail
.
init
();
}
// else if(testCase.type == 'api') {
// this.$refs.apiTestDetail.init();
// }
}
});
},
apiTestRun
(
reportId
)
{
this
.
testCase
.
reportId
=
reportId
;
...
...
@@ -323,13 +319,6 @@
saveReport
(
reportId
)
{
this
.
$post
(
'
/test/plan/case/edit
'
,
{
id
:
this
.
testCase
.
id
,
reportId
:
reportId
});
},
updateTestCases
(
testCase
)
{
this
.
testCases
.
forEach
(
item
=>
{
if
(
testCase
.
id
===
item
.
id
)
{
Object
.
assign
(
item
,
testCase
);
}
});
},
initData
(
testCase
)
{
this
.
result
=
this
.
$post
(
'
/test/plan/case/list/all
'
,
this
.
searchParam
,
response
=>
{
this
.
testCases
=
response
.
data
;
...
...
frontend/src/business/components/track/plan/view/comonents/test/PerformanceTestDetail.vue
0 → 100644
浏览文件 @
dc0ab3b2
<
template
>
<ms-container>
<ms-main-container>
<el-card>
<!--
<el-card
v-loading=
"result.loading"
>
-->
<el-row>
<el-col
:span=
"10"
>
<el-input
:disabled=
"true"
:placeholder=
"$t('load_test.input_name')"
v-model=
"test.name"
class=
"input-with-select"
>
<template
v-slot:prepend
>
<el-select
:disabled=
"true"
v-model=
"project.name"
:placeholder=
"$t('load_test.select_project')"
slot=
"prepend"
>
</el-select>
</
template
>
</el-input>
</el-col>
<el-col
:span=
"12"
:offset=
"2"
>
<el-button
type=
"primary"
plain
@
click=
"runTest"
>
执行
</el-button>
</el-col>
</el-row>
<el-tabs
class=
"test-config"
v-model=
"active"
type=
"border-card"
:stretch=
"true"
>
<el-tab-pane
:label=
"$t('load_test.basic_config')"
>
<performance-basic-config
:test-plan=
"test"
ref=
"basicConfig"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('load_test.pressure_config')"
>
<performance-pressure-config
:test-plan=
"test"
ref=
"pressureConfig"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('load_test.advanced_config')"
class=
"advanced-config"
>
<performance-advanced-config
ref=
"advancedConfig"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</ms-main-container>
</ms-container>
</template>
<
script
>
import
MsContainer
from
"
../../../../../common/components/MsContainer
"
;
import
MsMainContainer
from
"
../../../../../common/components/MsMainContainer
"
;
import
PerformanceBasicConfig
from
"
../../../../../performance/test/components/PerformanceBasicConfig
"
;
import
PerformancePressureConfig
from
"
../../../../../performance/test/components/PerformancePressureConfig
"
;
import
PerformanceAdvancedConfig
from
"
../../../../../performance/test/components/PerformanceAdvancedConfig
"
;
export
default
{
name
:
"
PerformanceTestDetail
"
,
components
:
{
PerformanceAdvancedConfig
,
PerformancePressureConfig
,
PerformanceBasicConfig
,
MsMainContainer
,
MsContainer
},
data
()
{
return
{
result
:
{},
test
:
{},
savePath
:
"
/performance/save
"
,
editPath
:
"
/performance/edit
"
,
runPath
:
"
/performance/run
"
,
project
:
{},
projectId
:
''
,
active
:
'
0
'
,
tabs
:
[{
title
:
this
.
$t
(
'
load_test.basic_config
'
),
id
:
'
0
'
,
component
:
'
PerformanceBasicConfig
'
},
{
title
:
this
.
$t
(
'
load_test.pressure_config
'
),
id
:
'
1
'
,
component
:
'
PerformancePressureConfig
'
},
{
title
:
this
.
$t
(
'
load_test.advanced_config
'
),
id
:
'
2
'
,
component
:
'
PerformanceAdvancedConfig
'
}]
}
},
props
:
[
'
id
'
],
methods
:
{
init
()
{
this
.
getTest
();
},
getProject
(
projectId
)
{
this
.
$get
(
"
/project/get/
"
+
projectId
,
response
=>
{
this
.
project
=
response
.
data
;
});
},
getTest
()
{
if
(
this
.
id
)
{
this
.
result
=
this
.
$get
(
'
/performance/get/
'
+
this
.
id
,
response
=>
{
this
.
test
=
response
.
data
;
this
.
getProject
(
this
.
test
.
projectId
);
});
}
},
runTest
()
{
this
.
result
=
this
.
$post
(
this
.
runPath
,
{
id
:
this
.
test
.
id
},
()
=>
{
this
.
$success
(
this
.
$t
(
'
load_test.is_running
'
));
});
}
}
}
</
script
>
<
style
scoped
>
.test-config
{
margin-top
:
15px
;
text-align
:
center
;
}
.el-select
{
min-width
:
130px
;
}
.edit-test-container
.input-with-select
.el-input-group__prepend
{
background-color
:
#fff
;
}
.advanced-config
{
height
:
calc
(
100vh
-
280px
);
overflow
:
auto
;
}
</
style
>
frontend/src/business/components/track/plan/view/comonents/test/PerformanceTestResult.vue
0 → 100644
浏览文件 @
dc0ab3b2
<
template
>
<ms-container>
<ms-main-container>
<el-card
v-loading=
"result.loading"
>
<el-row>
<el-col
:span=
"16"
>
<el-row>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/performance/test/' + this.projectId }">
{{
projectName
}}
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: '/performance/test/edit/' + this.testId }">
{{
testName
}}
</el-breadcrumb-item>
<el-breadcrumb-item>
{{
reportName
}}
</el-breadcrumb-item>
</el-breadcrumb>
</el-row>
<el-row
class=
"ms-report-view-btns"
>
<el-button
type=
"primary"
plain
size=
"mini"
>
{{
$t
(
'
report.test_stop_now
'
)
}}
</el-button>
<el-button
type=
"success"
plain
size=
"mini"
>
{{
$t
(
'
report.test_execute_again
'
)
}}
</el-button>
<el-button
type=
"info"
plain
size=
"mini"
>
{{
$t
(
'
report.export
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
size=
"mini"
>
{{
$t
(
'
report.compare
'
)
}}
</el-button>
</el-row>
</el-col>
<el-col
:span=
"8"
>
<span
class=
"ms-report-time-desc"
>
{{
$t
(
'
report.test_duration
'
,
[
this
.
minutes
,
this
.
seconds
])
}}
</span>
<span
class=
"ms-report-time-desc"
>
{{
$t
(
'
report.test_start_time
'
)
}}
:
{{
startTime
}}
</span>
<span
class=
"ms-report-time-desc"
>
{{
$t
(
'
report.test_end_time
'
)
}}
:
{{
endTime
}}
</span>
</el-col>
</el-row>
<el-divider></el-divider>
<el-tabs
v-model=
"active"
type=
"border-card"
:stretch=
"true"
>
<el-tab-pane
:label=
"$t('report.test_overview')"
>
<test-overview
:report=
"report"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('report.test_request_statistics')"
>
<request-statistics
:report=
"report"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('report.test_error_log')"
>
<error-log
:report=
"report"
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('report.test_log_details')"
>
<log-details
:report=
"report"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</ms-main-container>
</ms-container>
</
template
>
<
script
>
import
MsMainContainer
from
"
../../../../../common/components/MsMainContainer
"
;
import
MsContainer
from
"
../../../../../common/components/MsContainer
"
;
import
LogDetails
from
"
../../../../../performance/report/components/LogDetails
"
;
import
ErrorLog
from
"
../../../../../performance/report/components/ErrorLog
"
;
import
RequestStatistics
from
"
../../../../../performance/report/components/RequestStatistics
"
;
import
TestOverview
from
"
../../../../../performance/report/components/TestOverview
"
;
export
default
{
name
:
"
PerformanceTestResult
"
,
components
:
{
TestOverview
,
RequestStatistics
,
ErrorLog
,
LogDetails
,
MsContainer
,
MsMainContainer
},
data
()
{
return
{
result
:
{},
active
:
'
0
'
,
reportId
:
''
,
status
:
''
,
reportName
:
''
,
testId
:
''
,
testName
:
''
,
projectId
:
''
,
projectName
:
''
,
startTime
:
'
0
'
,
endTime
:
'
0
'
,
minutes
:
'
0
'
,
seconds
:
'
0
'
,
title
:
'
Logging
'
,
report
:
{}
}
},
props
:
[
'
reportId
'
],
methods
:
{
initBreadcrumb
()
{
if
(
this
.
reportId
)
{
this
.
result
=
this
.
$get
(
"
/performance/report/test/pro/info/
"
+
this
.
reportId
,
res
=>
{
let
data
=
res
.
data
;
if
(
data
)
{
this
.
reportName
=
data
.
name
;
this
.
testId
=
data
.
testId
;
this
.
testName
=
data
.
testName
;
this
.
projectId
=
data
.
projectId
;
this
.
projectName
=
data
.
projectName
;
}
})
}
},
initReportTimeInfo
()
{
if
(
this
.
reportId
)
{
this
.
result
=
this
.
$get
(
"
/performance/report/content/report_time/
"
+
this
.
reportId
)
.
then
(
res
=>
{
let
data
=
res
.
data
.
data
;
if
(
data
)
{
this
.
startTime
=
data
.
startTime
;
this
.
endTime
=
data
.
endTime
;
let
duration
=
data
.
duration
;
this
.
minutes
=
Math
.
floor
(
duration
/
60
);
this
.
seconds
=
duration
%
60
;
}
}).
catch
(()
=>
{
this
.
clearData
();
})
}
},
checkReportStatus
(
status
)
{
switch
(
status
)
{
case
'
Error
'
:
this
.
$warning
(
this
.
$t
(
'
report.generation_error
'
));
break
;
case
'
Starting
'
:
this
.
$warning
(
"
测试处于开始状态,请稍后查看报告!
"
);
break
;
case
'
Reporting
'
:
this
.
$info
(
this
.
$t
(
'
report.being_generated
'
));
break
;
case
'
Running
'
:
this
.
$warning
(
"
测试处于运行状态,请稍后查看报告!
"
);
break
;
case
'
Completed
'
:
default
:
break
;
}
},
clearData
()
{
this
.
startTime
=
'
0
'
;
this
.
endTime
=
'
0
'
;
this
.
minutes
=
'
0
'
;
this
.
seconds
=
'
0
'
;
}
},
created
()
{
this
.
result
=
this
.
$get
(
"
/performance/report/
"
+
this
.
reportId
,
res
=>
{
let
data
=
res
.
data
;
this
.
status
=
data
.
status
;
this
.
$set
(
this
.
report
,
"
id
"
,
this
.
reportId
);
this
.
$set
(
this
.
report
,
"
status
"
,
data
.
status
);
this
.
checkReportStatus
(
data
.
status
);
if
(
this
.
status
===
"
Completed
"
)
{
this
.
initReportTimeInfo
();
}
});
this
.
initBreadcrumb
();
},
watch
:
{
'
$route
'
(
to
)
{
if
(
to
.
name
===
"
perReportView
"
)
{
let
reportId
=
to
.
path
.
split
(
'
/
'
)[
4
];
this
.
reportId
=
reportId
;
if
(
reportId
)
{
this
.
$get
(
"
/performance/report/test/pro/info/
"
+
reportId
,
response
=>
{
let
data
=
response
.
data
;
if
(
data
)
{
this
.
status
=
data
.
status
;
this
.
reportName
=
data
.
name
;
this
.
testName
=
data
.
testName
;
this
.
projectName
=
data
.
projectName
;
this
.
$set
(
this
.
report
,
"
id
"
,
reportId
);
this
.
$set
(
this
.
report
,
"
status
"
,
data
.
status
);
this
.
checkReportStatus
(
data
.
status
);
if
(
this
.
status
===
"
Completed
"
)
{
this
.
result
=
this
.
$get
(
"
/performance/report/content/report_time/
"
+
this
.
reportId
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
;
if
(
data
)
{
this
.
startTime
=
data
.
startTime
;
this
.
endTime
=
data
.
endTime
;
let
duration
=
data
.
duration
;
this
.
minutes
=
Math
.
floor
(
duration
/
60
);
this
.
seconds
=
duration
%
60
;
}
}).
catch
(()
=>
{
this
.
clearData
();
})
}
else
{
this
.
clearData
();
}
}
});
}
}
}
}
}
</
script
>
<
style
scoped
>
.ms-report-view-btns
{
margin-top
:
15px
;
}
.ms-report-time-desc
{
text-align
:
left
;
display
:
block
;
color
:
#5C7878
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录