This commit is contained in:
chenjianxing 2020-07-20 18:38:02 +08:00
commit 6ed20d81d6
8 changed files with 226 additions and 199 deletions

View File

@ -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;
}

View File

@ -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;

BIN
frontend/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

View File

@ -112,7 +112,7 @@
components: {MsTableOperatorButton},
data() {
return {
timeout: 100,
timeout: 2000,
statusCode: [],
domains: [],
params: [],

View File

@ -1,24 +1,28 @@
<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>
@ -33,6 +37,10 @@
isReadOnly: {
type: Boolean,
default: false
},
isFailure: {
type: Boolean,
default: false
}
},
methods: {

View File

@ -21,7 +21,8 @@
<el-col :span="12">
<el-button plain size="mini"
icon="el-icon-back"
@click="cancel">{{$t('test_track.return')}}</el-button>
@click="cancel">{{$t('test_track.return')}}
</el-button>
</el-col>
<el-col :span="12" class="head-right">
@ -41,7 +42,9 @@
@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-button type="primary" size="mini" :disabled="isReadOnly" @click="saveCase()">
{{$t('test_track.save')}}
</el-button>
</el-col>
</el-row>
@ -55,7 +58,7 @@
</el-header>
<div class="case_container">
<el-row >
<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>
@ -70,6 +73,7 @@
<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>
@ -90,12 +94,15 @@
<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"/>
<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"/>
<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>
@ -111,7 +118,7 @@
class="tb-edit"
size="mini"
:border="true"
:default-sort = "{prop: 'num', order: 'ascending'}"
: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%">
@ -143,11 +150,16 @@
<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-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>
@ -168,7 +180,8 @@
<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"/>
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig"
v-model="testCase.issues.content"/>
</el-col>
</el-row>
@ -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();
}
}
@ -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%;
}

View File

@ -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>