Merge branch 'v1.1'

This commit is contained in:
chenjianxing 2020-08-05 20:07:04 +08:00
commit b04904d105
7 changed files with 27 additions and 23 deletions

View File

@ -217,7 +217,7 @@
<dependency> <dependency>
<groupId>io.metersphere</groupId> <groupId>io.metersphere</groupId>
<artifactId>jmeter-plugins-dubbo</artifactId> <artifactId>jmeter-plugins-dubbo</artifactId>
<version>2.7.8</version> <version>2.7.9</version>
</dependency> </dependency>
<!-- LDAP Module --> <!-- LDAP Module -->

View File

@ -126,8 +126,15 @@ public class Swagger2Parser extends ApiImportAbstractParser {
Model schema = bodyParameter.getSchema(); Model schema = bodyParameter.getSchema();
if (schema instanceof RefModel) { if (schema instanceof RefModel) {
String simpleRef = "";
RefModel refModel = (RefModel) bodyParameter.getSchema(); RefModel refModel = (RefModel) bodyParameter.getSchema();
Model model = definitions.get(refModel.getSimpleRef()); String originalRef = refModel.getOriginalRef();
if (refModel.getOriginalRef().split("/").length > 3) {
simpleRef = originalRef.replace("#/definitions/", "");
} else {
simpleRef = refModel.getSimpleRef();
}
Model model = definitions.get(simpleRef);
JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions); JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions);
body.setRaw(bodyParameters.toJSONString()); body.setRaw(bodyParameters.toJSONString());
} else if (schema instanceof ArrayModel) { } else if (schema instanceof ArrayModel) {

View File

@ -157,13 +157,9 @@
saveTest() { saveTest() {
this.save(() => { this.save(() => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
if (this.create) { this.$router.push({
this.$router.push({ path: '/api/test/edit?id=' + this.test.id
path: '/api/test/edit?id=' + this.test.id })
})
} else {
this.$router.push({path: '/api/test/list/all'})
}
}) })
}, },
runTest() { runTest() {
@ -183,7 +179,6 @@
}) })
}, },
cancel() { cancel() {
// console.log(this.test.toJMX().xml)
this.$router.push('/api/test/list/all'); this.$router.push('/api/test/list/all');
}, },
getOptions(url) { getOptions(url) {

View File

@ -1,9 +1,9 @@
<template> <template>
<el-aside :width="width" class="ms-aside-container" <el-aside :width="width" class="ms-aside-container"
:style="{'margin-left': asideHidden ? '0' : '-' + width}"> :style="{'margin-left': !asideHidden ? 0 : '-' + width}">
<div v-if="enableAsideHidden" class="hiddenBottom" @click="asideHidden = !asideHidden" :style="{'left': width}"> <div v-if="enableAsideHidden" class="hiddenBottom" @click="asideHidden = !asideHidden" :style="{'left': asideHidden ? 0 : width}">
<i v-if="asideHidden" class="el-icon-arrow-left"/> <i v-if="!asideHidden" class="el-icon-arrow-left"/>
<i v-if="!asideHidden" class="el-icon-arrow-right"/> <i v-if="asideHidden" class="el-icon-arrow-right"/>
</div> </div>
<slot></slot> <slot></slot>
</el-aside> </el-aside>
@ -24,7 +24,7 @@
}, },
data() { data() {
return { return {
asideHidden: true asideHidden: false
} }
} }
} }
@ -39,12 +39,9 @@
box-sizing: border-box; box-sizing: border-box;
background-color: #FFF; background-color: #FFF;
height: calc(100vh - 80px); height: calc(100vh - 80px);
position: relative;
overflow: inherit;
} }
.hiddenBottom { .hiddenBottom {
z-index: 199;
width: 8px; width: 8px;
height: 50px; height: 50px;
top: calc((100vh - 80px)/3); top: calc((100vh - 80px)/3);
@ -56,6 +53,7 @@
cursor: pointer; cursor: pointer;
opacity: 0.2; opacity: 0.2;
font-size: 2px; font-size: 2px;
margin-left: 1px;
} }
.hiddenBottom i { .hiddenBottom i {

View File

@ -356,6 +356,7 @@
this.$nextTick(() => { this.$nextTick(() => {
if (this.testCase.method == 'auto') { if (this.testCase.method == 'auto') {
if (this.$refs.apiTestDetail && this.testCase.type == 'api') { if (this.$refs.apiTestDetail && this.testCase.type == 'api') {
this.$refs.apiTestDetail.init(); this.$refs.apiTestDetail.init();
} else if (this.testCase.type == 'performance') { } else if (this.testCase.type == 'performance') {
this.$refs.performanceTestDetail.init(); this.$refs.performanceTestDetail.init();
@ -422,9 +423,12 @@
this.$post('/test/plan/edit/status/' + planId); this.$post('/test/plan/edit/status/' + planId);
}, },
stepResultChange() { stepResultChange() {
this.isFailure = this.testCase.steptResults.filter(s => { if (this.testCase.method == 'manual') {
return !s.executeResult || s.executeResult === 'Failure' || s.executeResult === 'Blocking'; this.isFailure = this.testCase.steptResults.filter(s => {
}).length > 0; return !s.executeResult || s.executeResult === 'Failure' || s.executeResult === 'Blocking';
}).length > 0;
}
} }
} }
} }

View File

@ -16,7 +16,7 @@
</el-row> </el-row>
</el-header> </el-header>
<ms-api-scenario-config :is-read-only="true" :scenarios="test.scenarioDefinition" ref="config"/> <ms-api-scenario-config :project-id="test.projectId" :is-read-only="true" :scenarios="test.scenarioDefinition" ref="config"/>
</el-container> </el-container>
</el-card> </el-card>

View File

@ -71,7 +71,7 @@
let url = "/api/report/get/" + this.reportId; let url = "/api/report/get/" + this.reportId;
this.$get(url, response => { this.$get(url, response => {
this.report = response.data || {}; this.report = response.data || {};
if (this.report.status == 'Completed') { if (this.report.status == 'Completed' || this.report.status == 'Success' || this.report.status == 'Error') {
this.content = JSON.parse(this.report.content); this.content = JSON.parse(this.report.content);
this.getFails(); this.getFails();
this.loading = false; this.loading = false;