Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2020-12-22 19:04:29 +08:00
commit cac54095aa
9 changed files with 121 additions and 104 deletions

View File

@ -84,7 +84,7 @@
<if test="request.moduleId != null"> <if test="request.moduleId != null">
AND api_scenario_module_id = #{request.moduleId} AND api_scenario_module_id = #{request.moduleId}
</if> </if>
and scenario_definition like CONCAT('%', #{request.id},'%') and scenario_definition like CONCAT('%', #{request.id},'%') and id != #{request.id}
</where> </where>
</select> </select>

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :title="$t('api_test.automation.case_ref')" :visible.sync="visible" <el-dialog :close-on-click-modal="false" :title="$t('api_test.automation.scenario_ref')" :visible.sync="visible"
width="45%" :destroy-on-close="true"> width="45%" :destroy-on-close="true">
<span>{{ $t('api_test.automation.scenario_ref') }}</span> <span>{{ $t('api_test.automation.scenario_ref') }}</span>
<div class="refs" v-loading="scenarioLoading"> <div class="refs" v-loading="scenarioLoading">

View File

@ -88,6 +88,9 @@
} else { } else {
this.request = JSON.parse(this.currentApi.request); this.request = JSON.parse(this.currentApi.request);
} }
if (!this.request.headers) {
this.request.headers = [];
}
this.currentApi.request = this.request; this.currentApi.request = this.request;
return true; return true;
} }
@ -135,6 +138,9 @@
if (!this.request.hashTree) { if (!this.request.hashTree) {
this.request.hashTree = []; this.request.hashTree = [];
} }
if (!this.request.body.binary) {
this.request.body.binary = [];
}
// //
if (this.response.body) { if (this.response.body) {
let body = new Body(); let body = new Body();
@ -145,6 +151,9 @@
if (!body.kvs) { if (!body.kvs) {
body.kvs = []; body.kvs = [];
} }
if (!body.binary) {
body.binary = [];
}
this.response.body = body; this.response.body = body;
} }
if (this.currentApi.moduleId && this.currentApi.moduleId === "root") { if (this.currentApi.moduleId && this.currentApi.moduleId === "root") {

View File

@ -1,5 +1,5 @@
<template> <template>
<div style="min-width: 1000px;margin-bottom: 20px"> <div style="min-width: 1200px;margin-bottom: 20px">
<el-radio-group v-model="body.type" size="mini"> <el-radio-group v-model="body.type" size="mini">
<el-radio :disabled="isReadOnly" :label="type.FORM_DATA" @change="modeChange"> <el-radio :disabled="isReadOnly" :label="type.FORM_DATA" @change="modeChange">
{{ $t('api_test.definition.request.body_form_data') }} {{ $t('api_test.definition.request.body_form_data') }}

View File

@ -16,7 +16,7 @@
@click="active(apiCase)"/> @click="active(apiCase)"/>
<el-input v-if="!apiCase.id || isShowInput" size="small" v-model="apiCase.name" :name="index" :key="index" <el-input v-if="!apiCase.id || isShowInput" size="small" v-model="apiCase.name" :name="index" :key="index"
class="ms-api-header-select" style="width: 180px" class="ms-api-header-select" style="width: 180px"
@blur="saveTestCase(apiCase)"/> @blur="saveTestCase(apiCase)" placeholder="请输入用例名称"/>
<span v-else> <span v-else>
{{apiCase.id ? apiCase.name:''}} {{apiCase.id ? apiCase.name:''}}
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)"/> <i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)"/>
@ -149,7 +149,7 @@
this.$emit('singleRun', data); this.$emit('singleRun', data);
}, },
copyCase(data) { copyCase(data) {
let obj = {name: "copy_" + data.name, priority: data.priority, active: false, request: data.request}; let obj = {name: "copy_" + data.name, priority: data.priority, active: true, request: data.request};
this.$emit('copyCase', obj); this.$emit('copyCase', obj);
}, },
@ -182,6 +182,7 @@
} }
let bodyFiles = this.getBodyUploadFiles(row); let bodyFiles = this.getBodyUploadFiles(row);
row.projectId = getCurrentProjectID(); row.projectId = getCurrentProjectID();
row.active = true;
row.apiDefinitionId = row.apiDefinitionId || this.api.id; row.apiDefinitionId = row.apiDefinitionId || this.api.id;
let url = "/api/testcase/create"; let url = "/api/testcase/create";
if (row.id) { if (row.id) {

View File

@ -187,7 +187,7 @@
} else { } else {
request = JSON.parse(this.api.request); request = JSON.parse(this.api.request);
} }
let obj = {apiDefinitionId: this.api.id, name: '', priority: 'P0', active: false}; let obj = {apiDefinitionId: this.api.id, name: '', priority: 'P0', active: true};
obj.request = request; obj.request = request;
this.apiCaseList.unshift(obj); this.apiCaseList.unshift(obj);
} }

View File

@ -1,18 +1,18 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-tabs type="border-card" :stretch="true"> <el-tabs type="border-card" :stretch="true" @tab-click="selectTab">
<el-tab-pane v-for="item in resource" :key="item.resourceId" :label="item.resourceName" class="logging-content"> <el-tab-pane v-for="item in resource" :key="item.resourceId" :label="item.resourceName" class="logging-content">
<ul class="infinite-list" v-infinite-scroll="load(item.resourceId)" infinite-scroll-disabled="disabled"> <ul class="infinite-list" v-infinite-scroll="load(item.resourceId)" infinite-scroll-disabled="disabled">
<li class="infinite-list-item" v-for="(log, index) in logContent" :key="index">{{ log.content }}</li> <li class="infinite-list-item" v-for="(log, index) in logContent" :key="index">{{ log.content }}</li>
</ul> </ul>
<el-link type="primary" @click="downloadLogFile(item)">{{$t('load_test.download_log_file')}}</el-link> <el-link type="primary" @click="downloadLogFile(item)">{{ $t('load_test.download_log_file') }}</el-link>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "LogDetails", name: "LogDetails",
data() { data() {
return { return {
@ -53,6 +53,13 @@
this.loading = false; this.loading = false;
}) })
}, },
selectTab(tab) {
let resourceId = tab.$vnode.key;
this.loading = false;
this.page = 1;
this.logContent = [];
this.load(resourceId);
},
downloadLogFile(item) { downloadLogFile(item) {
let config = { let config = {
url: '/performance/report/log/download/' + this.id + '/' + item.resourceId, url: '/performance/report/log/download/' + this.id + '/' + item.resourceId,
@ -95,25 +102,25 @@
} }
}, },
props: ['report'] props: ['report']
} }
</script> </script>
<style scoped> <style scoped>
.logging-content { .logging-content {
white-space: pre-line; white-space: pre-line;
overflow: auto; overflow: auto;
} }
.infinite-list { .infinite-list {
height: 500px; height: 500px;
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
overflow: auto overflow: auto
} }
.infinite-list-item { .infinite-list-item {
overflow: hidden; overflow: hidden;
} }
</style> </style>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico">
<title>MeterSphere</title> <title>MeterSphere</title>
</head> </head>
<body> <body>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico">
<title>MeterSphere</title> <title>MeterSphere</title>
</head> </head>
<body> <body>