fix(接口自动化): 接口相关问题修复

This commit is contained in:
fit2-zhao 2021-05-25 11:33:05 +08:00 committed by fit2-zhao
parent 7572ccdcbb
commit f3fe0d7450
9 changed files with 41 additions and 13 deletions

View File

@ -45,6 +45,9 @@ public class StatusReference {
statusMap.put("DELETE", "删除");
statusMap.put("false", "");
statusMap.put("true", "");
statusMap.put("functional", "功能用例");
statusMap.put("performance", "性能用例");
statusMap.put("api", "接口用例");
}

View File

@ -17,6 +17,7 @@ public class TestCaseReference {
testCaseColumns.put("method", "请求类型");
testCaseColumns.put("prerequisite", "前置条件");
testCaseColumns.put("remark", "备注");
testCaseColumns.put("customNum", "ID");
testCaseColumns.put("steps", "用例步骤");
testCaseColumns.put("other_test_name", "其他名称");
testCaseColumns.put("review_status", "评审状态");

View File

@ -400,6 +400,7 @@ export default {
},
watch: {
selectNodeIds() {
this.currentPage = 1;
this.condition.selectAll = false;
this.condition.unSelectIds = [];
this.selectDataCounts = 0;

View File

@ -162,7 +162,7 @@
:allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable ref="stepTree">
<span class="custom-tree-node father" slot-scope="{ node, data}" style="width: 96%">
<!-- 步骤组件-->
<ms-component-config :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario"
<ms-component-config :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario" :expandedNode="expandedNode"
:currentEnvironmentId="currentEnvironmentId" :node="node" :project-list="projectList" :env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"/>
</span>

View File

@ -23,7 +23,7 @@
<template v-slot:button>
<el-tooltip :content="$t('api_test.run')" placement="top">
<el-button @click="run" icon="el-icon-video-play" style="padding: 5px" class="ms-btn" size="mini" circle/>
<el-button :disabled="!request.enable" @click="run" icon="el-icon-video-play" style="padding: 5px" class="ms-btn" size="mini" circle/>
</el-tooltip>
</template>
@ -118,6 +118,7 @@
},
currentEnvironmentId: String,
projectList: Array,
expandedNode: Array,
envMap: Map
},
components: {
@ -328,6 +329,13 @@
if (this.node) {
this.node.expanded = this.request.active;
}
if (this.node.expanded && this.expandedNode.indexOf(this.request.resourceId) === -1) {
this.expandedNode.push(this.request.resourceId);
} else {
if (this.expandedNode.indexOf(this.request.resourceId) !== -1) {
this.expandedNode.splice(this.expandedNode.indexOf(this.request.resourceId), 1);
}
}
this.reload();
},
run() {

View File

@ -1,7 +1,7 @@
<template>
<div class="request-form">
<keep-alive>
<component v-bind:is="component" :isMax="isMax" :show-btn="showBtn"
<component v-bind:is="component" :isMax="isMax" :show-btn="showBtn" :expandedNode="expandedNode"
:scenario="scenario" :controller="scenario" :timer="scenario" :assertions="scenario" :extract="scenario" :jsr223-processor="scenario" :request="scenario" :currentScenario="currentScenario" :currentEnvironmentId="currentEnvironmentId" :node="node"
:draggable="draggable" :title="title" :color="titleColor" :background-color="backgroundColor" @suggestClick="suggestClick(node)" :response="response"
@remove="remove" @copyRow="copyRow" @refReload="refReload" @openScenario="openScenario" :project-list="projectList" :env-map="envMap"/>
@ -12,7 +12,7 @@
<script>
import MsConstantTimer from "./ConstantTimer";
import MsIfController from "./IfController";
import MsTransactionController from "./TransactionController";
import MsTransactionController from "./TransactionController";
import {ELEMENT_TYPE} from "../Setting";
import MsJsr233Processor from "./Jsr233Processor";
import MsApiAssertions from "../../../definition/components/assertion/ApiAssertions";
@ -24,7 +24,7 @@
export default {
name: "ComponentConfig",
components: {MsConstantTimer, MsIfController, MsTransactionController,MsJsr233Processor, MsApiAssertions, MsApiExtract, MsApiComponent, MsLoopController, MsApiScenarioComponent, JmeterElementComponent},
components: {MsConstantTimer, MsIfController, MsTransactionController, MsJsr233Processor, MsApiAssertions, MsApiExtract, MsApiComponent, MsLoopController, MsApiScenarioComponent, JmeterElementComponent},
props: {
type: String,
scenario: {},
@ -41,6 +41,7 @@
default: true,
},
currentScenario: {},
expandedNode: Array,
currentEnvironmentId: String,
response: {},
node: {},

View File

@ -17,7 +17,7 @@
</template>
<template v-slot:button>
<el-button @click="runDebug" :tip="$t('api_test.run')" icon="el-icon-video-play" style="background-color: #409EFF;color: white;padding: 5px" size="mini" circle/>
<el-button @click="runDebug" :disabled="!controller.enable" :tip="$t('api_test.run')" icon="el-icon-video-play" style="background-color: #409EFF;color: white;padding: 5px" size="mini" circle/>
</template>
<div v-if="controller.loopType==='LOOP_COUNT'" draggable>
<el-row>
@ -319,7 +319,7 @@
this.activeName = this.requestResult && this.requestResult.scenarios && this.requestResult.scenarios !== null && this.requestResult.scenarios.length > 0 ? this.requestResult.scenarios[0].name : "";
//
this.setResult(this.controller.hashTree);
this.$emit("refReload",this.node);
this.$emit("refReload", this.node);
} catch (e) {
throw e;
}

View File

@ -427,11 +427,13 @@ export default {
watch: {
selectNodeIds() {
initCondition(this.condition, false);
this.currentPage = 1;
this.condition.moduleIds = [];
this.condition.moduleIds.push(this.selectNodeIds);
this.initTable();
},
currentProtocol() {
this.currentPage = 1;
initCondition(this.condition, false);
this.initTable();
},

View File

@ -19,25 +19,36 @@
<el-table-column prop="columnTitle" :label="$t('operating_log.change_field')" width="150px" show-overflow-tooltip/>
<el-table-column prop="originalValue" :label="$t('operating_log.before_change')" width="400px" show-overflow-tooltip>
<template v-slot:default="scope">
<pre>{{scope.row.originalValue}} </pre>
<span v-if="timeDates.indexOf(scope.row.columnName)!==-1">{{ scope.row.originalValue | timestampFormatDate }}</span>
<pre v-else>{{ scope.row.originalValue }}</pre>
</template>
</el-table-column>
<el-table-column prop="newValue" :label="$t('operating_log.after_change')" width="400px" show-overflow-tooltip>
<template v-slot:default="scope">
<pre>{{scope.row.newValue}} </pre>
<span v-if="timeDates.indexOf(scope.row.columnName)!==-1">{{ scope.row.newValue | timestampFormatDate }}</span>
<pre v-else>{{ scope.row.newValue }}</pre>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div v-else-if="detail && (detail.operType ==='DELETE' || detail.details === null || (detail.details && detail.details.columns && detail.details.columns.length === 0))">
<pre>{{detail.operTitle}} </pre>
<pre style="overflow: auto">{{detail.operTitle}} </pre>
<span style="color: #409EFF">{{getType(detail.operType)}} </span>
<span style="color: #409EFF"> {{$t('api_test.home_page.detail_card.success')}}</span>
</div>
<div v-else>
<div v-if="detail && detail.details && detail.details.columns" style="margin-left: 20px">
<pre style="overflow: auto" v-for="n in detail.details.columns" :key="n.id">{{n.columnTitle}}{{n.originalValue}}</pre>
<div v-if="detail && detail.details && detail.details.columns" style="overflow: auto">
<span v-for="n in detail.details.columns" :key="n.id">
<pre v-if="timeDates.indexOf(n.columnName)!==-1">
{{n.columnTitle}}{{ n.originalValue | timestampFormatDate }}
</pre>
<pre style="overflow: auto" v-else>
{{n.columnTitle}}{{n.originalValue}}
</pre>
</span>
</div>
</div>
</div>
@ -101,7 +112,8 @@
['BATCH_RESTORE', "批量恢复"],
['BATCH_GC', "批量回收"],
['UN_ASSOCIATE_CASE', this.$t('test_track.case.unlink')],
])
]),
timeDates: ["plannedStartTime", "plannedEndTime", "startTime", "endTime"],
}
},
methods: {