Merge branch 'v1.1'
This commit is contained in:
commit
2a5eea722e
|
@ -34,7 +34,7 @@ public class ApiTestEnvironmentService {
|
|||
}
|
||||
|
||||
public void update(ApiTestEnvironmentWithBLOBs apiTestEnvironment) {
|
||||
apiTestEnvironmentMapper.updateByPrimaryKey(apiTestEnvironment);
|
||||
apiTestEnvironmentMapper.updateByPrimaryKeyWithBLOBs(apiTestEnvironment);
|
||||
}
|
||||
|
||||
public String add(ApiTestEnvironmentWithBLOBs apiTestEnvironmentWithBLOBs) {
|
||||
|
|
|
@ -27,7 +27,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
|
||||
httpRequestFactory.setConnectionRequestTimeout(4000);
|
||||
httpRequestFactory.setConnectTimeout(4000);
|
||||
httpRequestFactory.setReadTimeout(5000);
|
||||
httpRequestFactory.setReadTimeout(10 * 1000);
|
||||
restTemplate.setRequestFactory(httpRequestFactory);
|
||||
return restTemplate;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class ReportWebSocket {
|
|||
while (stopMe) {
|
||||
try {
|
||||
LoadTestReport report = reportService.getReport(reportId);
|
||||
if (StringUtils.equalsAny(report.getStatus(), PerformanceTestStatus.Completed.name(), PerformanceTestStatus.Error.name())) {
|
||||
if (report == null || StringUtils.equalsAny(report.getStatus(), PerformanceTestStatus.Completed.name(), PerformanceTestStatus.Error.name())) {
|
||||
this.stopMe();
|
||||
session.close();
|
||||
break;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 107 KiB |
Binary file not shown.
Before Width: | Height: | Size: 104 KiB |
|
@ -58,14 +58,32 @@
|
|||
}
|
||||
},
|
||||
copyEnvironment(environment) {
|
||||
if (!environment.id) {
|
||||
this.$warning(this.$t('commons.please_save'))
|
||||
return;
|
||||
}
|
||||
let newEnvironment = {};
|
||||
Object.assign(newEnvironment, environment);
|
||||
newEnvironment.id = null;
|
||||
newEnvironment.name = this.getNoRepeatName(newEnvironment.name);
|
||||
if (!this.validateEnvironment(newEnvironment)) {
|
||||
return;
|
||||
}
|
||||
this.$refs.environmentEdit._save(newEnvironment);
|
||||
this.environments.push(newEnvironment);
|
||||
this.$refs.environmentItems.itemSelected(this.environments.length -1 , newEnvironment);
|
||||
},
|
||||
validateEnvironment(environment) {
|
||||
if (!environment.name || !!environment.name && environment.name.length > 64) {
|
||||
this.$error(this.$t('commons.input_limit', [1, 64]));
|
||||
return false;
|
||||
}
|
||||
if (!this.$refs.environmentEdit.validateSocket(environment.socket)) {
|
||||
this.$error(this.$t('commons.formatErr'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
getNoRepeatName(name) {
|
||||
for (let i in this.environments) {
|
||||
if (this.environments[i].name === name) {
|
||||
|
@ -97,14 +115,13 @@
|
|||
}
|
||||
},
|
||||
getEnvironment(environment) {
|
||||
let item = environment;
|
||||
if (!(environment.variables instanceof Array)) {
|
||||
item.variables = JSON.parse(environment.variables);
|
||||
environment.variables = JSON.parse(environment.variables);
|
||||
}
|
||||
if (!(environment.headers instanceof Array)) {
|
||||
item.headers = JSON.parse(environment.headers);
|
||||
environment.headers = JSON.parse(environment.headers);
|
||||
}
|
||||
this.currentEnvironment = item;
|
||||
this.currentEnvironment = environment;
|
||||
},
|
||||
getDefaultEnvironment() {
|
||||
return {variables: [{}], headers: [{}], protocol: 'https', projectId: this.projectId};
|
||||
|
|
|
@ -100,8 +100,12 @@
|
|||
buildParam(environment) {
|
||||
let param = {};
|
||||
Object.assign(param, environment);
|
||||
param.variables = JSON.stringify(environment.variables);
|
||||
param.headers = JSON.stringify(environment.headers);
|
||||
if (!(environment.variables instanceof String)) {
|
||||
param.variables = JSON.stringify(environment.variables);
|
||||
}
|
||||
if (!(environment.headers instanceof String)) {
|
||||
param.headers = JSON.stringify(environment.headers);
|
||||
}
|
||||
return param;
|
||||
},
|
||||
validateSocket(socket) {
|
||||
|
|
|
@ -47,20 +47,21 @@
|
|||
<el-divider direction="vertical"/>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="file" class="api-upload">
|
||||
<el-upload
|
||||
class="api-upload"
|
||||
drag
|
||||
action=""
|
||||
:http-request="upload"
|
||||
:limit="1"
|
||||
:beforeUpload="uploadValidate"
|
||||
:on-remove="handleRemove"
|
||||
:file-list="fileList"
|
||||
:on-exceed="handleExceed"
|
||||
multiple>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text" v-html="$t('load_test.upload_tips')"></div>
|
||||
<div class="el-upload__tip" slot="tip">{{$t('api_test.api_import.file_size_limit')}}</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -133,15 +134,12 @@
|
|||
],
|
||||
projectId: [
|
||||
{required: true, message: this.$t('api_test.select_project'), trigger: 'blur'},
|
||||
],
|
||||
file: [
|
||||
{required: true, message: this.$t('commons.please_upload'), trigger: 'blur'},
|
||||
],
|
||||
]
|
||||
},
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
activated() {
|
||||
this.selectedPlatform = this.platforms[0];
|
||||
this.getProjects();
|
||||
},
|
||||
|
@ -164,7 +162,12 @@
|
|||
},
|
||||
upload(file) {
|
||||
this.formData.file = file.file;
|
||||
this.fileList.push(file.file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$warning(this.$t('test_track.case.import.upload_limit_count'));
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.formData.file = undefined;
|
||||
},
|
||||
uploadValidate(file, fileList) {
|
||||
let suffix = file.name.substring(file.name.lastIndexOf('.') + 1);
|
||||
|
@ -208,6 +211,10 @@
|
|||
Object.assign(param, this.formData);
|
||||
param.platform = this.selectedPlatformValue;
|
||||
param.useEnvironment = this.useEnvironment;
|
||||
if (!this.formData.file) {
|
||||
this.$warning(this.$t('commons.please_upload'));
|
||||
return ;
|
||||
}
|
||||
this.result = this.$fileUpload('/api/import', param.file, param,response => {
|
||||
let res = response.data;
|
||||
this.$success(this.$t('test_track.case.import.success'));
|
||||
|
@ -240,7 +247,15 @@
|
|||
|
||||
.api-upload {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.api-upload >>> .el-upload {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.api-upload >>> .el-upload-dragger {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-radio-group {
|
||||
|
@ -288,7 +303,7 @@
|
|||
}
|
||||
|
||||
.name-input {
|
||||
width: 195px;
|
||||
max-width: 195px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<crontab-result v-show="false" :ex="schedule.value" ref="crontabResult" @resultListChange="resultListChange"/>
|
||||
</div>
|
||||
<div>
|
||||
<span :class="{'disable-character': !schedule.enable}"> {{$t('schedule.next_execution_time')}}:{{this.recentList.length > 0 ? this.recentList[0] : $t('schedule.not_set')}} </span>
|
||||
<span :class="{'disable-character': !schedule.enable}"> {{$t('schedule.next_execution_time')}}:{{this.recentList.length > 0 && schedule.enable ? this.recentList[0] : $t('schedule.not_set')}} </span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog width="30%" class="schedule-edit" :title="$t('schedule.edit_timer_task')" :visible.sync="dialogVisible" @close="close">
|
||||
<el-dialog width="35%" class="schedule-edit" :title="$t('schedule.edit_timer_task')" :visible.sync="dialogVisible" @close="close">
|
||||
<div id="app">
|
||||
<el-form :model="form" :rules="rules" ref="from">
|
||||
<el-form-item
|
||||
|
@ -47,7 +47,9 @@
|
|||
data() {
|
||||
const validateCron = (rule, cronValue, callback) => {
|
||||
let customValidate = this.customValidate(this.getIntervalTime());
|
||||
if (!cronValidate(cronValue)) {
|
||||
if (!cronValue) {
|
||||
callback(new Error(this.$t('commons.input_content')));
|
||||
} else if (!cronValidate(cronValue)) {
|
||||
callback(new Error(this.$t('schedule.cron_expression_format_error')));
|
||||
} else if(!this.intervalShortValidate()) {
|
||||
callback(new Error(this.$t('schedule.cron_expression_interval_short_error')));
|
||||
|
|
|
@ -126,8 +126,8 @@
|
|||
importAPITest() {
|
||||
let apiTest = this.$store.state.api.test;
|
||||
if (apiTest && apiTest.name) {
|
||||
this.testPlan.projectId = apiTest.projectId;
|
||||
this.testPlan.name = apiTest.name;
|
||||
this.$set(this.testPlan, "projectId", apiTest.projectId);
|
||||
this.$set(this.testPlan, "name", apiTest.name);
|
||||
let blob = new Blob([apiTest.jmx.xml], {type: "application/octet-stream"});
|
||||
let file = new File([blob], apiTest.jmx.name);
|
||||
this.$refs.basicConfig.beforeUpload(file);
|
||||
|
@ -274,7 +274,7 @@
|
|||
},
|
||||
checkScheduleEdit() {
|
||||
if (!this.testPlan.id) {
|
||||
this.$message('请先保存测试');
|
||||
this.$message(this.$t('api_test.environment.please_save_test'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -284,7 +284,7 @@
|
|||
if (intervalTime < duration) {
|
||||
return {
|
||||
pass: false,
|
||||
info: '间隔时间不能小于压测时长'
|
||||
info: this.$t('load_test.schedule_tip')
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
components: {MsTableOperatorButton},
|
||||
data() {
|
||||
return {
|
||||
timeout: 100,
|
||||
timeout: 2000,
|
||||
statusCode: [],
|
||||
domains: [],
|
||||
params: [],
|
||||
|
|
|
@ -1,46 +1,54 @@
|
|||
<template>
|
||||
<el-row type="flex" justify="start" :gutter="20" class="status-button">
|
||||
<el-col>
|
||||
<el-button :disabled="isReadOnly" type="success" round size="mini"
|
||||
<el-button :disabled="isReadOnly || isFailure" type="success" round size="mini"
|
||||
:icon="status == 'Pass' ? 'el-icon-check' : ''"
|
||||
@click="setStatus('Pass')"> {{$t('test_track.plan_view.pass')}}</el-button>
|
||||
@click="setStatus('Pass')"> {{$t('test_track.plan_view.pass')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-button :disabled="isReadOnly" type="danger" round size="mini"
|
||||
:icon="status == 'Failure' ? 'el-icon-check' : ''"
|
||||
@click="setStatus('Failure')"> {{$t('test_track.plan_view.failure')}}</el-button>
|
||||
@click="setStatus('Failure')"> {{$t('test_track.plan_view.failure')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-button :disabled="isReadOnly" type="warning" round size="mini"
|
||||
:icon="status == 'Blocking' ? 'el-icon-check' : ''"
|
||||
@click="setStatus('Blocking')"> {{$t('test_track.plan_view.blocking')}}</el-button>
|
||||
@click="setStatus('Blocking')"> {{$t('test_track.plan_view.blocking')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-button :disabled="isReadOnly" type="info" round size="mini"
|
||||
:icon="status == 'Skip' ? 'el-icon-check' : ''"
|
||||
@click="setStatus('Skip')"> {{$t('test_track.plan_view.skip')}}</el-button>
|
||||
@click="setStatus('Skip')"> {{$t('test_track.plan_view.skip')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TestPlanTestCaseStatusButton",
|
||||
props: {
|
||||
status: {
|
||||
type: String
|
||||
},
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
export default {
|
||||
name: "TestPlanTestCaseStatusButton",
|
||||
props: {
|
||||
status: {
|
||||
type: String
|
||||
},
|
||||
methods: {
|
||||
setStatus(status) {
|
||||
this.$emit('statusChange', status);
|
||||
}
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isFailure: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setStatus(status) {
|
||||
this.$emit('statusChange', status);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -9,191 +9,204 @@
|
|||
ref="drawer"
|
||||
v-loading="result.loading">
|
||||
|
||||
<template v-slot:default="scope">
|
||||
<div class="container">
|
||||
<template v-slot:default="scope">
|
||||
<div class="container">
|
||||
|
||||
<el-scrollbar>
|
||||
<el-scrollbar>
|
||||
|
||||
<el-header>
|
||||
<el-header>
|
||||
|
||||
<el-row type="flex" class="head-bar">
|
||||
<el-row type="flex" class="head-bar">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-button plain size="mini"
|
||||
icon="el-icon-back"
|
||||
@click="cancel">{{$t('test_track.return')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button plain size="mini"
|
||||
icon="el-icon-back"
|
||||
@click="cancel">{{$t('test_track.return')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="head-right">
|
||||
<el-col :span="12" class="head-right">
|
||||
<span class="head-right-tip" v-if="index + 1 == testCases.length">
|
||||
{{$t('test_track.plan_view.pre_case')}} : {{testCases[index - 1] ? testCases[index - 1].name : ''}}
|
||||
</span>
|
||||
<span class="head-right-tip" v-if="index + 1 != testCases.length">
|
||||
<span class="head-right-tip" v-if="index + 1 != testCases.length">
|
||||
{{$t('test_track.plan_view.next_case')}} : {{testCases[index + 1] ? testCases[index + 1].name : ''}}
|
||||
</span>
|
||||
|
||||
<el-button plain size="mini" icon="el-icon-arrow-up"
|
||||
:disabled="index + 1 <= 1"
|
||||
@click="handlePre()"/>
|
||||
<span> {{index + 1}}/{{testCases.length}} </span>
|
||||
<el-button plain size="mini" icon="el-icon-arrow-down"
|
||||
:disabled="index + 1 >= testCases.length"
|
||||
@click="handleNext()"/>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button plain size="mini" icon="el-icon-arrow-up"
|
||||
:disabled="index + 1 <= 1"
|
||||
@click="handlePre()"/>
|
||||
<span> {{index + 1}}/{{testCases.length}} </span>
|
||||
<el-button plain size="mini" icon="el-icon-arrow-down"
|
||||
:disabled="index + 1 >= testCases.length"
|
||||
@click="handleNext()"/>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
|
||||
<el-button type="primary" size="mini" :disabled="isReadOnly" @click="saveCase()">{{$t('test_track.save')}}</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" size="mini" :disabled="isReadOnly" @click="saveCase()">
|
||||
{{$t('test_track.save')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-row>
|
||||
|
||||
<el-row style="margin-top: 0px;">
|
||||
<el-col>
|
||||
<el-divider content-position="left">{{testCase.name}}</el-divider>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 0px;">
|
||||
<el-col>
|
||||
<el-divider content-position="left">{{testCase.name}}</el-divider>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-header>
|
||||
</el-header>
|
||||
|
||||
<div class="case_container">
|
||||
<el-row >
|
||||
<el-col :span="4" :offset="1">
|
||||
<span class="cast_label">{{$t('test_track.case.priority')}}:</span>
|
||||
<span class="cast_item">{{testCase.priority}}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{$t('test_track.case.case_type')}}:</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'functional'">{{$t('commons.functional')}}</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'performance'">{{$t('commons.performance')}}</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'api'">{{$t('commons.api')}}</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<test-plan-test-case-status-button class="status-button"
|
||||
@statusChange="statusChange"
|
||||
:is-read-only="isReadOnly"
|
||||
:status="testCase.status"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="case_container">
|
||||
<el-row>
|
||||
<el-col :span="4" :offset="1">
|
||||
<span class="cast_label">{{$t('test_track.case.priority')}}:</span>
|
||||
<span class="cast_item">{{testCase.priority}}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{$t('test_track.case.case_type')}}:</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'functional'">{{$t('commons.functional')}}</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'performance'">{{$t('commons.performance')}}</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'api'">{{$t('commons.api')}}</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<test-plan-test-case-status-button class="status-button"
|
||||
@statusChange="statusChange"
|
||||
:is-read-only="isReadOnly"
|
||||
:is-failure="isFailure"
|
||||
:status="testCase.status"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="4" :offset="1">
|
||||
<span class="cast_label">{{$t('test_track.case.method')}}:</span>
|
||||
<span v-if="testCase.method == 'manual'">{{$t('test_track.case.manual')}}</span>
|
||||
<span v-if="testCase.method == 'auto'">{{$t('test_track.case.auto')}}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{$t('test_track.case.module')}}:</span>
|
||||
<span class="cast_item">{{testCase.nodePath}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" :offset="1">
|
||||
<span class="cast_label">{{$t('test_track.case.method')}}:</span>
|
||||
<span v-if="testCase.method == 'manual'">{{$t('test_track.case.manual')}}</span>
|
||||
<span v-if="testCase.method == 'auto'">{{$t('test_track.case.auto')}}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{$t('test_track.case.module')}}:</span>
|
||||
<span class="cast_item">{{testCase.nodePath}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method == 'auto' && testCase.testId">
|
||||
<el-col class="test-detail" :span="20" :offset="1">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
|
||||
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
|
||||
<api-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'api'" @runTest="testRun" :id="testCase.testId" ref="apiTestDetail"/>
|
||||
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'performance'" @runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">
|
||||
<api-test-result :report-id="testCase.reportId" v-if=" testCase.type == 'api'" ref="apiTestResult"/>
|
||||
<performance-test-result :is-read-only="isReadOnly" :report-id="testCase.reportId" v-if="testCase.type == 'performance'" ref="performanceTestResult"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.method == 'auto' && testCase.testId">
|
||||
<el-col class="test-detail" :span="20" :offset="1">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
|
||||
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
|
||||
<api-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'api'" @runTest="testRun"
|
||||
:id="testCase.testId" ref="apiTestDetail"/>
|
||||
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'performance'"
|
||||
@runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">
|
||||
<api-test-result :report-id="testCase.reportId" v-if=" testCase.type == 'api'" ref="apiTestResult"/>
|
||||
<performance-test-result :is-read-only="isReadOnly" :report-id="testCase.reportId"
|
||||
v-if="testCase.type == 'performance'" ref="performanceTestResult"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'">
|
||||
<el-col :span="20" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{$t('test_track.case.steps')}}:</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="testCase.steptResults"
|
||||
class="tb-edit"
|
||||
size="mini"
|
||||
:border="true"
|
||||
:default-sort = "{prop: 'num', order: 'ascending'}"
|
||||
highlight-current-row>
|
||||
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="5%"></el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="29%">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{scope.row.desc}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="28%">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{scope.row.result}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.plan_view.actual_result')" min-width="29%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
size="mini"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:rows="2"
|
||||
:disabled="isReadOnly"
|
||||
v-model="scope.row.actualResult"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable></el-input>
|
||||
<span>{{scope.row.actualResult}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.plan_view.step_result')" min-width="9%">
|
||||
<template v-slot:default="scope">
|
||||
<el-select
|
||||
:disabled="isReadOnly"
|
||||
v-model="scope.row.executeResult"
|
||||
size="mini">
|
||||
<el-option :label="$t('test_track.plan_view.pass')" value="Pass" style="color: #7ebf50;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.failure')" value="Failure" style="color: #e57471;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.blocking')" value="Blocking" style="color: #dda451;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.skip')" value="Skip" style="color: #919399;"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'">
|
||||
<el-col :span="20" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{$t('test_track.case.steps')}}:</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="testCase.steptResults"
|
||||
class="tb-edit"
|
||||
size="mini"
|
||||
:border="true"
|
||||
:default-sort="{prop: 'num', order: 'ascending'}"
|
||||
highlight-current-row>
|
||||
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="5%"></el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="29%">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{scope.row.desc}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="28%">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{scope.row.result}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.plan_view.actual_result')" min-width="29%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
size="mini"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:rows="2"
|
||||
:disabled="isReadOnly"
|
||||
v-model="scope.row.actualResult"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable></el-input>
|
||||
<span>{{scope.row.actualResult}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.plan_view.step_result')" min-width="9%">
|
||||
<template v-slot:default="scope">
|
||||
<el-select
|
||||
:disabled="isReadOnly"
|
||||
v-model="scope.row.executeResult"
|
||||
@change="stepResultChange()"
|
||||
size="mini">
|
||||
<el-option :label="$t('test_track.plan_view.pass')" value="Pass"
|
||||
style="color: #7ebf50;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.failure')" value="Failure"
|
||||
style="color: #e57471;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.blocking')" value="Blocking"
|
||||
style="color: #dda451;"></el-option>
|
||||
<el-option :label="$t('test_track.plan_view.skip')" value="Skip"
|
||||
style="color: #919399;"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.issues">
|
||||
<el-col :span="5" :offset="1">
|
||||
<el-switch
|
||||
:disabled="isReadOnly"
|
||||
v-model="testCase.issues.hasIssues"
|
||||
@change="issuesChange"
|
||||
:active-text="$t('test_track.plan_view.submit_issues')">
|
||||
</el-switch>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.issues">
|
||||
<el-col :span="5" :offset="1">
|
||||
<el-switch
|
||||
:disabled="isReadOnly"
|
||||
v-model="testCase.issues.hasIssues"
|
||||
@change="issuesChange"
|
||||
:active-text="$t('test_track.plan_view.submit_issues')">
|
||||
</el-switch>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.issues && testCase.issues.hasIssues">
|
||||
<el-col :span="20" :offset="1" class="issues-edit">
|
||||
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig" v-model="testCase.issues.content"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.issues && testCase.issues.hasIssues">
|
||||
<el-col :span="20" :offset="1" class="issues-edit">
|
||||
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig"
|
||||
v-model="testCase.issues.content"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="15" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{$t('commons.remark')}}:</span>
|
||||
<span v-if="testCase.remark == null || testCase.remark == ''" style="color: darkgrey">{{$t('commons.not_filled')}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-input :rows="3"
|
||||
type="textarea"
|
||||
v-if="testCase.remark"
|
||||
disabled
|
||||
v-model="testCase.remark"></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="15" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{$t('commons.remark')}}:</span>
|
||||
<span v-if="testCase.remark == null || testCase.remark == ''" style="color: darkgrey">{{$t('commons.not_filled')}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-input :rows="3"
|
||||
type="textarea"
|
||||
v-if="testCase.remark"
|
||||
disabled
|
||||
v-model="testCase.remark"></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
</el-scrollbar>
|
||||
</el-scrollbar>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
|
@ -215,7 +228,8 @@
|
|||
PerformanceTestDetail,
|
||||
ApiTestResult,
|
||||
ApiTestDetail,
|
||||
TestPlanTestCaseStatusButton},
|
||||
TestPlanTestCaseStatusButton
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
|
@ -226,10 +240,11 @@
|
|||
editor: ClassicEditor,
|
||||
editorConfig: {
|
||||
// 'increaseIndent','decreaseIndent'
|
||||
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ,'insertTable', '|','undo', 'redo'],
|
||||
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
|
||||
},
|
||||
test: {},
|
||||
activeTab: 'detail'
|
||||
activeTab: 'detail',
|
||||
isFailure: false,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -273,7 +288,7 @@
|
|||
param.status = this.testCase.status;
|
||||
param.results = [];
|
||||
|
||||
for (let i = 0; i < this.testCase.steptResults.length; i++){
|
||||
for (let i = 0; i < this.testCase.steptResults.length; i++) {
|
||||
let result = {};
|
||||
result.actualResult = this.testCase.steptResults[i].actualResult;
|
||||
result.executeResult = this.testCase.steptResults[i].executeResult;
|
||||
|
@ -283,11 +298,6 @@
|
|||
return;
|
||||
}
|
||||
if (this.testCase.method != 'auto') {
|
||||
if (!result.actualResult) {
|
||||
this.$warning(this.testCase.steptResults[i].desc + this.$t('test_track.actual_result')
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!result.executeResult) {
|
||||
this.$warning(this.testCase.steptResults[i].desc + this.$t('test_track.execution_result')
|
||||
);
|
||||
|
@ -339,8 +349,8 @@
|
|||
item.issues.hasIssues = false;
|
||||
}
|
||||
item.steptResults = [];
|
||||
for (let i = 0; i < item.steps.length; i++){
|
||||
if(item.results[i]){
|
||||
for (let i = 0; i < item.steps.length; i++) {
|
||||
if (item.results[i]) {
|
||||
item.steps[i].actualResult = item.results[i].actualResult;
|
||||
item.steps[i].executeResult = item.results[i].executeResult;
|
||||
}
|
||||
|
@ -348,6 +358,8 @@
|
|||
}
|
||||
this.testCase = item;
|
||||
this.initTest();
|
||||
//
|
||||
this.stepResultChange();
|
||||
},
|
||||
openTestCaseEdit(testCase) {
|
||||
this.showDialog = true;
|
||||
|
@ -360,7 +372,7 @@
|
|||
if (this.testCase.method == 'auto') {
|
||||
if (this.$refs.apiTestDetail && this.testCase.type == 'api') {
|
||||
this.$refs.apiTestDetail.init();
|
||||
} else if(this.testCase.type == 'performance') {
|
||||
} else if (this.testCase.type == 'performance') {
|
||||
this.$refs.performanceTestDetail.init();
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +417,7 @@
|
|||
}
|
||||
},
|
||||
issuesChange() {
|
||||
if (this.testCase.issues.hasIssues) {
|
||||
if (this.testCase.issues.hasIssues) {
|
||||
let desc = this.addPLabel('[' + this.$t('test_track.plan_view.operate_step') + ']');
|
||||
let result = this.addPLabel('[' + this.$t('test_track.case.expected_results') + ']');
|
||||
let executeResult = this.addPLabel('[' + this.$t('test_track.plan_view.actual_result') + ']');
|
||||
|
@ -423,6 +435,11 @@
|
|||
},
|
||||
setPlanStatus(planId) {
|
||||
this.$post('/test/plan/edit/status/' + planId);
|
||||
},
|
||||
stepResultChange() {
|
||||
this.isFailure = this.testCase.steptResults.filter(s => {
|
||||
return !s.executeResult || s.executeResult === 'Failure' || s.executeResult === 'Blocking';
|
||||
}).length > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -434,10 +451,12 @@
|
|||
.tb-edit .el-textarea {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tb-edit .current-row .el-textarea {
|
||||
display: block;
|
||||
}
|
||||
.tb-edit .current-row .el-textarea+span {
|
||||
|
||||
.tb-edit .current-row .el-textarea + span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -453,7 +472,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
.el-col:not(.test-detail){
|
||||
.el-col:not(.test-detail) {
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
|
@ -477,7 +496,7 @@
|
|||
height: 100vh;
|
||||
}
|
||||
|
||||
.case_container > .el-row{
|
||||
.case_container > .el-row {
|
||||
margin-top: 1%;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
}
|
||||
},
|
||||
runTest() {
|
||||
this.result = this.$post(this.runPath, {id: this.test.id}, (response) => {
|
||||
this.result = this.$post(this.runPath, {id: this.test.id, triggerMode: 'MANUAL'}, (response) => {
|
||||
this.$success(this.$t('load_test.is_running'));
|
||||
this.$emit('runTest', response.data);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.png">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>MeterSphere</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -102,6 +102,7 @@ export default {
|
|||
login_username: 'ID or email',
|
||||
input_login_username: 'Please input the user ID or email',
|
||||
input_name: 'Please enter name',
|
||||
please_save: 'Please save first',
|
||||
formatErr: 'Format Error',
|
||||
id: 'ID',
|
||||
please_upload: 'Please upload file',
|
||||
|
@ -319,7 +320,8 @@ export default {
|
|||
download_log_file: 'Download',
|
||||
user_name: 'Creator',
|
||||
special_characters_are_not_supported: 'Test name does not support special characters',
|
||||
pressure_config_params_is_empty: 'Pressure configuration parameters cannot be empty!'
|
||||
pressure_config_params_is_empty: 'Pressure configuration parameters cannot be empty!',
|
||||
schedule_tip: 'The interval must not be less than the pressure measuring time'
|
||||
},
|
||||
api_test: {
|
||||
creator: "Creator",
|
||||
|
|
|
@ -104,6 +104,7 @@ export default {
|
|||
input_name: '请输入名称',
|
||||
please_upload: '请上传文件',
|
||||
formatErr: '格式错误',
|
||||
please_save: '请先保存',
|
||||
id: 'ID',
|
||||
date: {
|
||||
select_date: '选择日期',
|
||||
|
@ -318,7 +319,8 @@ export default {
|
|||
pressure_prediction_chart: '压力预估图',
|
||||
user_name: '创建人',
|
||||
special_characters_are_not_supported: '测试名称不支持特殊字符',
|
||||
pressure_config_params_is_empty: '压力配置参数不能为空!'
|
||||
pressure_config_params_is_empty: '压力配置参数不能为空!',
|
||||
schedule_tip: '间隔时间不能小于压测时长'
|
||||
},
|
||||
api_test: {
|
||||
creator: "创建人",
|
||||
|
|
|
@ -101,6 +101,7 @@ export default {
|
|||
delete_confirm: '請輸入以下內容,確認刪除:',
|
||||
input_name: '請輸入名稱',
|
||||
formatErr: '格式錯誤',
|
||||
please_save: '請先保存',
|
||||
id: 'ID',
|
||||
please_upload: '請上傳文件',
|
||||
date: {
|
||||
|
@ -317,7 +318,8 @@ export default {
|
|||
pressure_prediction_chart: '壓力預估圖',
|
||||
user_name: '創建人',
|
||||
special_characters_are_not_supported: '測試名稱不支持特殊字符',
|
||||
pressure_config_params_is_empty: '壓力配置參數不能為空!'
|
||||
pressure_config_params_is_empty: '壓力配置參數不能為空!',
|
||||
schedule_tip: '間隔時間不能小於壓測時長'
|
||||
},
|
||||
api_test: {
|
||||
creator: "創建人",
|
||||
|
|
Loading…
Reference in New Issue