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">
AND api_scenario_module_id = #{request.moduleId}
</if>
and scenario_definition like CONCAT('%', #{request.id},'%')
and scenario_definition like CONCAT('%', #{request.id},'%') and id != #{request.id}
</where>
</select>

View File

@ -1,5 +1,5 @@
<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">
<span>{{ $t('api_test.automation.scenario_ref') }}</span>
<div class="refs" v-loading="scenarioLoading">

View File

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

View File

@ -1,5 +1,5 @@
<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 :disabled="isReadOnly" :label="type.FORM_DATA" @change="modeChange">
{{ $t('api_test.definition.request.body_form_data') }}

View File

@ -16,7 +16,7 @@
@click="active(apiCase)"/>
<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"
@blur="saveTestCase(apiCase)"/>
@blur="saveTestCase(apiCase)" placeholder="请输入用例名称"/>
<span v-else>
{{apiCase.id ? apiCase.name:''}}
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)"/>
@ -149,7 +149,7 @@
this.$emit('singleRun', 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);
},
@ -182,6 +182,7 @@
}
let bodyFiles = this.getBodyUploadFiles(row);
row.projectId = getCurrentProjectID();
row.active = true;
row.apiDefinitionId = row.apiDefinitionId || this.api.id;
let url = "/api/testcase/create";
if (row.id) {

View File

@ -187,7 +187,7 @@
} else {
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;
this.apiCaseList.unshift(obj);
}

View File

@ -1,6 +1,6 @@
<template>
<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">
<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>
@ -53,6 +53,13 @@
this.loading = false;
})
},
selectTab(tab) {
let resourceId = tab.$vnode.key;
this.loading = false;
this.page = 1;
this.logContent = [];
this.load(resourceId);
},
downloadLogFile(item) {
let config = {
url: '/performance/report/log/download/' + this.id + '/' + item.resourceId,

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.ico">
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico">
<title>MeterSphere</title>
</head>
<body>

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.ico">
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico">
<title>MeterSphere</title>
</head>
<body>