Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4994ca3780
|
@ -114,6 +114,7 @@ public class ApiDefinitionController {
|
|||
|
||||
@PostMapping(value = "/run", consumes = {"multipart/form-data"})
|
||||
public String run(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
request.setReportId(null);
|
||||
return apiDefinitionService.run(request, bodyFiles);
|
||||
}
|
||||
|
||||
|
|
|
@ -170,10 +170,8 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
|||
apiReportService.complete(testResult, report);
|
||||
} else if (StringUtils.equals(this.runMode, ApiRunMode.DELIMIT.name())) {
|
||||
// 调试操作,不需要存储结果
|
||||
if (!StringUtils.isBlank(debugReportId)) {
|
||||
apiDefinitionService.addResult(testResult);
|
||||
} else {
|
||||
apiDefinitionService.addResult(testResult);
|
||||
if (StringUtils.isBlank(debugReportId)) {
|
||||
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.DELIMIT.name());
|
||||
}
|
||||
} else if (StringUtils.equalsAny(this.runMode, ApiRunMode.API_PLAN.name(), ApiRunMode.SCHEDULE_API_PLAN.name())) {
|
||||
|
|
|
@ -337,9 +337,6 @@ public class ApiDefinitionService {
|
|||
if (StringUtils.isNotBlank(request.getType()) && StringUtils.equals(request.getType(), ApiRunMode.API_PLAN.name())) {
|
||||
runMode = ApiRunMode.API_PLAN.name();
|
||||
}
|
||||
|
||||
MsTestPlan testPlan = new MsTestPlan();
|
||||
System.out.println(testPlan.getJmx(hashTree));
|
||||
// 调用执行方法
|
||||
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), runMode);
|
||||
return request.getId();
|
||||
|
|
|
@ -38,7 +38,14 @@
|
|||
|
||||
<el-tab-pane name="add">
|
||||
<template v-slot:label>
|
||||
<el-dropdown @command="handleCommand" v-tester>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-tester/>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="ADD">{{ $t('api_test.definition.request.title') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="CLOSE_ALL">{{ $t('api_test.definition.request.close_all_label') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
@ -148,6 +155,24 @@ export default {
|
|||
this.tabs.push({label: label, name: name, currentScenario: tab.currentScenario});
|
||||
}
|
||||
},
|
||||
handleTabClose() {
|
||||
this.tabs = [];
|
||||
this.activeName = "default";
|
||||
this.refresh();
|
||||
},
|
||||
handleCommand(e) {
|
||||
switch (e) {
|
||||
case "ADD":
|
||||
this.addTab({name: 'add'});
|
||||
break;
|
||||
case "CLOSE_ALL":
|
||||
this.handleTabClose();
|
||||
break;
|
||||
default:
|
||||
this.addTab({name: 'add'});
|
||||
break;
|
||||
}
|
||||
},
|
||||
removeTab(targetName) {
|
||||
this.tabs = this.tabs.filter(tab => tab.name !== targetName);
|
||||
if (this.tabs.length > 0) {
|
||||
|
|
|
@ -146,29 +146,10 @@
|
|||
@node-collapse="nodeCollapse"
|
||||
:allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable>
|
||||
<span class="custom-tree-node father" slot-scope="{ node, data}" style="width: 96%">
|
||||
<template>
|
||||
<!-- 场景 -->
|
||||
<ms-api-scenario-component v-if="data.type==='scenario'" :scenario="data" :node="node" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--条件控制器-->
|
||||
<ms-if-controller :controller="data" :node="node" v-if="data.type==='IfController'" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--循环控制器-->
|
||||
<ms-loop-controller :controller="data" :node="node" v-if="data.type==='LoopController'" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--等待控制器-->
|
||||
<ms-constant-timer :timer="data" :node="node" v-if="data.type==='ConstantTimer'" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--自定义脚本-->
|
||||
<ms-jsr233-processor :draggable="true" v-if="data.type==='JSR223Processor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.automation.customize_script')" :jsr223-processor="data" :node="node"/>
|
||||
<!--前置脚本-->
|
||||
<ms-jsr233-processor :draggable="true" v-if="data.type==='JSR223PreProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.pre_script')" :jsr223-processor="data" :node="node"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor :draggable="true" v-if="data.type==='JSR223PostProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.post_script')" :jsr223-processor="data" :node="node"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions :draggable="true" @suggestClick="suggestClick(node)" :response="response" v-if="data.type==='Assertions'" @remove="remove" @copyRow="copyRow" :assertions="data" :node="node"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract :draggable="true" @suggestClick="suggestClick(node)" :response="response" @remove="remove" @copyRow="copyRow" v-if="data.type==='Extract'" :extract="data" :node="node"/>
|
||||
<!--API 导入 -->
|
||||
<ms-api-component :request="data" :currentScenario="currentScenario" :currentEnvironmentId="currentEnvironmentId" @remove="remove" @copyRow="copyRow"
|
||||
v-if="data.type==='HTTPSamplerProxy'||data.type==='DubboSampler'||data.type==='JDBCSampler'||data.type==='TCPSampler'" :node="node"/>
|
||||
</template>
|
||||
<!-- 步骤组件-->
|
||||
<ms-component-config :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario"
|
||||
:currentEnvironmentId="currentEnvironmentId" :node="node"
|
||||
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick"/>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
|
@ -227,21 +208,13 @@
|
|||
import {API_STATUS, PRIORITY} from "../../definition/model/JsonData";
|
||||
import {WORKSPACE_ID} from '@/common/js/constants';
|
||||
import {Assertions, Extract, IfController, JSR223Processor, ConstantTimer, LoopController} from "../../definition/model/ApiTestModel";
|
||||
import MsJsr233Processor from "./Jsr233Processor";
|
||||
import {parseEnvironment} from "../../definition/model/EnvironmentModel";
|
||||
import MsConstantTimer from "./ConstantTimer";
|
||||
import MsIfController from "./IfController";
|
||||
import MsApiAssertions from "../../definition/components/assertion/ApiAssertions";
|
||||
import MsApiExtract from "../../definition/components/extract/ApiExtract";
|
||||
import MsApiComponent from "./ApiComponent";
|
||||
import {ELEMENTS, ELEMENT_TYPE} from "./Setting";
|
||||
import MsApiCustomize from "./ApiCustomize";
|
||||
import {getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig";
|
||||
import MsInputTag from "./MsInputTag";
|
||||
import MsRun from "./DebugRun";
|
||||
import MsLoopController from "./LoopController";
|
||||
import MsApiScenarioComponent from "./ApiScenarioComponent";
|
||||
import MsApiReportDetail from "../report/ApiReportDetail";
|
||||
import MsVariableList from "./variable/VariableList";
|
||||
import ApiImport from "../../definition/components/import/ApiImport";
|
||||
|
@ -250,6 +223,7 @@
|
|||
import OutsideClick from "@/common/js/outside-click";
|
||||
import ScenarioApiRelevance from "./api/ApiRelevance";
|
||||
import ScenarioRelevance from "./api/ScenarioRelevance";
|
||||
import MsComponentConfig from "./component/ComponentConfig";
|
||||
|
||||
export default {
|
||||
name: "EditApiScenario",
|
||||
|
@ -264,17 +238,10 @@
|
|||
ApiEnvironmentConfig,
|
||||
MsApiReportDetail,
|
||||
MsInputTag, MsRun,
|
||||
MsApiScenarioComponent,
|
||||
MsJsr233Processor,
|
||||
MsConstantTimer,
|
||||
MsIfController,
|
||||
MsApiAssertions,
|
||||
MsApiExtract,
|
||||
MsApiComponent,
|
||||
MsApiCustomize,
|
||||
ApiImport,
|
||||
InputTag,
|
||||
MsLoopController,
|
||||
MsComponentConfig,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -669,7 +636,12 @@
|
|||
if (obj.name) {
|
||||
obj.name = obj.name + '_copy';
|
||||
}
|
||||
const index = hashTree.findIndex(d => d.resourceId === row.resourceId);
|
||||
if (index != -1) {
|
||||
hashTree.splice(index, 0, obj);
|
||||
} else {
|
||||
hashTree.push(obj);
|
||||
}
|
||||
this.sort();
|
||||
this.reload();
|
||||
}
|
||||
|
|
|
@ -64,15 +64,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsSqlBasisParameters from "../../definition/components/request/database/BasisParameters";
|
||||
import MsTcpBasisParameters from "../../definition/components/request/tcp/TcpBasisParameters";
|
||||
import MsDubboBasisParameters from "../../definition/components/request/dubbo/BasisParameters";
|
||||
import MsApiRequestForm from "../../definition/components/request/http/ApiRequestForm";
|
||||
import {REQ_METHOD} from "../../definition/model/JsonData";
|
||||
import MsRequestResultTail from "../../definition/components/response/RequestResultTail";
|
||||
import MsRun from "../../definition/components/Run";
|
||||
import MsSqlBasisParameters from "../../../definition/components/request/database/BasisParameters";
|
||||
import MsTcpBasisParameters from "../../../definition/components/request/tcp/TcpBasisParameters";
|
||||
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
|
||||
import MsApiRequestForm from "../../../definition/components/request/http/ApiHttpRequestForm";
|
||||
import {REQ_METHOD} from "../../../definition/model/JsonData";
|
||||
import MsRequestResultTail from "../../../definition/components/response/RequestResultTail";
|
||||
import MsRun from "../../../definition/components/Run";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
export default {
|
||||
name: "MsApiComponent",
|
||||
props: {
|
|
@ -28,11 +28,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsSqlBasisParameters from "../../definition/components/request/database/BasisParameters";
|
||||
import MsTcpBasisParameters from "../../definition/components/request/tcp/TcpBasisParameters";
|
||||
import MsDubboBasisParameters from "../../definition/components/request/dubbo/BasisParameters";
|
||||
import MsApiRequestForm from "../../definition/components/request/http/ApiRequestForm";
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import MsSqlBasisParameters from "../../../definition/components/request/database/BasisParameters";
|
||||
import MsTcpBasisParameters from "../../../definition/components/request/tcp/TcpBasisParameters";
|
||||
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
|
||||
import MsApiRequestForm from "../../../definition/components/request/http/ApiHttpRequestForm";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
|
||||
export default {
|
||||
name: "ApiScenarioComponent",
|
|
@ -0,0 +1,113 @@
|
|||
<template>
|
||||
<div class="request-form">
|
||||
<component :is="component" :scenario="scenario" :controller="scenario" :timer="scenario" :assertions="scenario" :extract="scenario" :jsr223-processor="scenario" :request="scenario" :currentScenario="currentScenario" :currentEnvironmentId="currentEnvironmentId" :node="node"
|
||||
:draggable="true" :title="title" @suggestClick="suggestClick(node)" :response="response"
|
||||
@remove="remove" @copyRow="copyRow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsConstantTimer from "./ConstantTimer";
|
||||
import MsIfController from "./IfController";
|
||||
import {ELEMENT_TYPE} from "../Setting";
|
||||
import MsJsr233Processor from "./Jsr233Processor";
|
||||
import MsApiAssertions from "../../../definition/components/assertion/ApiAssertions";
|
||||
import MsApiExtract from "../../../definition/components/extract/ApiExtract";
|
||||
import MsApiComponent from "./ApiComponent";
|
||||
import MsLoopController from "./LoopController";
|
||||
import MsApiScenarioComponent from "./ApiScenarioComponent";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "ComponentConfig",
|
||||
components: {MsConstantTimer, MsIfController, MsJsr233Processor, MsApiAssertions, MsApiExtract, MsApiComponent, MsLoopController, MsApiScenarioComponent},
|
||||
props: {
|
||||
type: String,
|
||||
scenario: {},
|
||||
currentScenario: {},
|
||||
currentEnvironmentId: String,
|
||||
response: {},
|
||||
node: {},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('api_test.automation.customize_script'),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
component({type}) {
|
||||
let name;
|
||||
switch (type) {
|
||||
case ELEMENT_TYPE.IfController:
|
||||
name = "MsIfController";
|
||||
break;
|
||||
case ELEMENT_TYPE.ConstantTimer:
|
||||
name = "MsConstantTimer";
|
||||
break;
|
||||
case ELEMENT_TYPE.JSR223Processor:
|
||||
name = this.getComponent(ELEMENT_TYPE.JSR223Processor);
|
||||
break;
|
||||
case ELEMENT_TYPE.JSR223PreProcessor:
|
||||
name = this.getComponent(ELEMENT_TYPE.JSR223PreProcessor);
|
||||
break;
|
||||
case ELEMENT_TYPE.JSR223PostProcessor:
|
||||
name = this.getComponent(ELEMENT_TYPE.JSR223PostProcessor);
|
||||
break;
|
||||
case ELEMENT_TYPE.Assertions:
|
||||
name = "MsApiAssertions";
|
||||
break;
|
||||
case ELEMENT_TYPE.Extract:
|
||||
name = "MsApiExtract";
|
||||
break;
|
||||
case ELEMENT_TYPE.CustomizeReq:
|
||||
name = "MsApiComponent";
|
||||
break;
|
||||
case ELEMENT_TYPE.LoopController:
|
||||
name = "MsLoopController";
|
||||
break;
|
||||
case ELEMENT_TYPE.scenario:
|
||||
name = "MsApiScenarioComponent";
|
||||
break;
|
||||
default:
|
||||
name = "MsApiComponent";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getComponent(type) {
|
||||
if (type === ELEMENT_TYPE.JSR223PreProcessor) {
|
||||
this.title = this.$t('api_test.definition.request.pre_script');
|
||||
return "MsJsr233Processor";
|
||||
} else if (type === ELEMENT_TYPE.JSR223PostProcessor) {
|
||||
this.title = this.$t('api_test.definition.request.post_script');
|
||||
return "MsJsr233Processor";
|
||||
} else {
|
||||
this.title = this.$t('api_test.automation.customize_script');
|
||||
return "MsJsr233Processor";
|
||||
}
|
||||
},
|
||||
remove(row, node) {
|
||||
this.$emit('remove',row,node);
|
||||
|
||||
},
|
||||
copyRow(row, node) {
|
||||
this.$emit('copyRow',row,node);
|
||||
|
||||
},
|
||||
suggestClick(node) {
|
||||
this.$emit('suggestClick',node);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.request-form >>> .debug-button {
|
||||
margin-left: auto;
|
||||
display: block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -17,7 +17,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
export default {
|
||||
name: "MsConstantTimer",
|
||||
components: {ApiBaseComponent},
|
|
@ -25,7 +25,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
export default {
|
||||
name: "MsIfController",
|
||||
components: {ApiBaseComponent},
|
|
@ -35,10 +35,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsCodeEdit from "../../../common/components/MsCodeEdit";
|
||||
import MsInstructionsIcon from "../../../common/components/MsInstructionsIcon";
|
||||
import MsDropdown from "../../../common/components/MsDropdown";
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import MsCodeEdit from "../../../../common/components/MsCodeEdit";
|
||||
import MsInstructionsIcon from "../../../../common/components/MsInstructionsIcon";
|
||||
import MsDropdown from "../../../../common/components/MsDropdown";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
|
||||
export default {
|
||||
name: "MsJsr233Processor",
|
|
@ -70,7 +70,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ApiBaseComponent from "./common/ApiBaseComponent";
|
||||
import ApiBaseComponent from "../common/ApiBaseComponent";
|
||||
|
||||
export default {
|
||||
name: "MsLoopController",
|
|
@ -15,20 +15,8 @@
|
|||
</ms-aside-container>
|
||||
|
||||
<ms-main-container>
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-buttion"
|
||||
@click="handleCommand('ADD')"
|
||||
@command="handleCommand" v-tester>
|
||||
{{ $t('commons.add') }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="debug">{{ $t('api_test.definition.request.fast_debug') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="ADD">{{ $t('api_test.definition.request.title') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="CLOSE_ALL">{{ $t('api_test.definition.request.close_all_label') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<!-- 主框架列表 -->
|
||||
<el-tabs v-model="apiDefaultTab" @edit="handleTabRemove">
|
||||
<el-tabs v-model="apiDefaultTab" @edit="handleTabRemove" @tab-click="addTab">
|
||||
<el-tab-pane v-for="(item) in apiTabs"
|
||||
:key="item.name"
|
||||
:label="item.title"
|
||||
|
@ -98,6 +86,20 @@
|
|||
@refresh="refresh" v-if="currentProtocol==='DUBBO'"/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane name="add">
|
||||
<template v-slot:label>
|
||||
<el-dropdown @command="handleCommand" v-tester>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-tester/>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="debug">{{ $t('api_test.definition.request.fast_debug') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="ADD">{{ $t('api_test.definition.request.title') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="CLOSE_ALL">{{ $t('api_test.definition.request.close_all_label') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ms-main-container>
|
||||
</ms-container>
|
||||
|
@ -204,6 +206,11 @@ export default {
|
|||
isApiListEnableChange(data) {
|
||||
this.isApiListEnable = data;
|
||||
},
|
||||
addTab(tab) {
|
||||
if (tab.name === 'add') {
|
||||
this.handleCommand("ADD");
|
||||
}
|
||||
},
|
||||
handleCommand(e) {
|
||||
switch (e) {
|
||||
case "ADD":
|
||||
|
@ -370,33 +377,21 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ms-api-buttion {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
right: 4px;
|
||||
padding: 0;
|
||||
background: 0 0;
|
||||
border: none;
|
||||
outline: 0;
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.ms-api-div {
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 155px)
|
||||
}
|
||||
|
||||
/deep/ .el-tabs__header {
|
||||
margin: 0 0 5px;
|
||||
width: calc(100% - 90px);
|
||||
}
|
||||
|
||||
/deep/ .el-main {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/deep/ .el-tabs__header {
|
||||
margin: 0 0 0px;
|
||||
/*width: calc(100% - 90px);*/
|
||||
}
|
||||
|
||||
/deep/ .el-card {
|
||||
/*border: 1px solid #EBEEF5;*/
|
||||
/*border-style: none;*/
|
||||
|
|
|
@ -68,9 +68,9 @@
|
|||
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
|
||||
let url = "";
|
||||
if (this.debug) {
|
||||
reqObj.reportId = this.reportId;
|
||||
url = "/api/definition/run/debug";
|
||||
} else {
|
||||
reqObj.reportId = "run";
|
||||
url = "/api/definition/run";
|
||||
}
|
||||
this.$fileUpload(url, null, bodyFiles, reqObj, response => {
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<script>
|
||||
import {AssertionJSR223} from "../../model/ApiTestModel";
|
||||
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiAssertionJsr223",
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
import MsApiAssertionText from "./ApiAssertionText";
|
||||
import MsApiAssertionRegex from "./ApiAssertionRegex";
|
||||
import MsApiAssertionDuration from "./ApiAssertionDuration";
|
||||
import {ASSERTION_TYPE, JSONPath, Scenario} from "../../model/ApiTestModel";
|
||||
import {ASSERTION_TYPE, JSONPath} from "../../model/ApiTestModel";
|
||||
import MsApiAssertionsEdit from "./ApiAssertionsEdit";
|
||||
import MsApiAssertionJsonPath from "./ApiAssertionJsonPath";
|
||||
import MsApiAssertionJsr223 from "./ApiAssertionJsr223";
|
||||
|
@ -91,7 +91,6 @@
|
|||
type: String,
|
||||
default: "margin-top: 10px"
|
||||
},
|
||||
scenario: Scenario,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
|
|
@ -25,17 +25,13 @@
|
|||
{{ $t('api_test.definition.request.body_binary') }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<div style="min-width: 1200px;" v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
||||
<el-row v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
||||
<el-link class="ms-el-link" @click="batchAdd"> {{$t("commons.batch_add")}}</el-link>
|
||||
</el-row>
|
||||
<div style="min-width: 1200px;" v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
||||
<ms-api-variable :is-read-only="isReadOnly"
|
||||
:parameters="body.kvs"
|
||||
:isShowEnable="isShowEnable" type="body" v-if="body.type == 'Form Data'"/>
|
||||
|
||||
<ms-api-from-url-variable :is-read-only="isReadOnly"
|
||||
:parameters="body.kvs"
|
||||
type="body" v-if="body.type == 'WWW_FORM'"/>
|
||||
:isShowEnable="isShowEnable" type="body"/>
|
||||
</div>
|
||||
<div v-if="body.type == 'JSON'">
|
||||
<div style="padding: 10px">
|
||||
|
|
|
@ -92,11 +92,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {_getBodyUploadFiles, getCurrentProjectID, getUUID} from "../../../../../../common/js/utils";
|
||||
import {_getBodyUploadFiles, getCurrentProjectID} from "../../../../../../common/js/utils";
|
||||
import {PRIORITY, RESULT_MAP} from "../../model/JsonData";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsTipButton from "../../../../common/components/MsTipButton";
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import ApiEnvironmentConfig from "../environment/ApiEnvironmentConfig";
|
||||
import MsApiAssertions from "../assertion/ApiAssertions";
|
||||
import MsSqlBasisParameters from "../request/database/BasisParameters";
|
||||
|
|
|
@ -108,13 +108,14 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import MsResponseText from "../response/ResponseText";
|
||||
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
|
||||
import {API_STATUS, REQ_METHOD} from "../../model/JsonData";
|
||||
import {KeyValue} from "../../model/ApiTestModel";
|
||||
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsAddCompleteHttpApi",
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsResponseResult from "../response/ResponseResult";
|
||||
import MsRequestMetric from "../response/RequestMetric";
|
||||
import {getUUID, getCurrentUser} from "@/common/js/utils";
|
||||
|
@ -42,7 +41,7 @@
|
|||
|
||||
export default {
|
||||
name: "ApiConfig",
|
||||
components: {MsRequestResultTail, MsResponseResult, MsApiRequestForm, MsRequestMetric, MsResponseText, MsRun, MsBasisParameters},
|
||||
components: {MsRequestResultTail, MsResponseResult, MsRequestMetric, MsResponseText, MsRun, MsBasisParameters},
|
||||
props: {
|
||||
currentProtocol: String,
|
||||
scenario: Boolean,
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import MsResponseResult from "../response/ResponseResult";
|
||||
import MsRequestMetric from "../response/RequestMetric";
|
||||
import {getUUID, getCurrentUser} from "@/common/js/utils";
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsResponseResult from "../response/ResponseResult";
|
||||
import MsRequestMetric from "../response/RequestMetric";
|
||||
import {getUUID, getCurrentUser} from "@/common/js/utils";
|
||||
|
@ -44,7 +43,7 @@
|
|||
|
||||
export default {
|
||||
name: "ApiConfig",
|
||||
components: {MsRequestResultTail, MsResponseResult, MsApiRequestForm, MsRequestMetric, MsResponseText, MsRun, MsBasisParameters},
|
||||
components: {MsRequestResultTail, MsResponseResult, MsRequestMetric, MsResponseText, MsRun, MsBasisParameters},
|
||||
props: {
|
||||
currentProtocol: String,
|
||||
scenario: Boolean,
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import MsResponseResult from "../response/ResponseResult";
|
||||
import MsRequestMetric from "../response/RequestMetric";
|
||||
import {getUUID, getCurrentUser} from "@/common/js/utils";
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
import ApiEnvironmentConfig from "../../environment/ApiEnvironmentConfig";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsDatabaseConfig",
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
import MsDubboConfigCenter from "../../request/dubbo/ConfigCenter";
|
||||
import MsDubboConsumerService from "../../request/dubbo/ConsumerAndService";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsDatabaseConfig",
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
</div>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<el-row>
|
||||
<el-link class="ms-el-link" @click="batchAdd"> {{$t("commons.batch_add")}}</el-link>
|
||||
</el-row>
|
||||
|
||||
<ms-api-key-value :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :suggestions="headerSuggestions" :items="headers"/>
|
||||
</el-tab-pane>
|
||||
|
||||
|
@ -115,7 +119,7 @@
|
|||
import {getUUID} from "@/common/js/utils";
|
||||
import BatchAddParameter from "../../basis/BatchAddParameter";
|
||||
import MsApiAdvancedConfig from "./ApiAdvancedConfig";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiHttpRequestForm",
|
||||
|
@ -265,6 +269,9 @@
|
|||
case "rest":
|
||||
this.request.rest.unshift(item);
|
||||
break;
|
||||
case "headers":
|
||||
this.request.headers.unshift(item);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<template>
|
||||
<div class="request-form">
|
||||
<component :is="component" :showScript="showScript" :is-read-only="isReadOnly" :referenced="referenced" :request="request" :response="response" :headers="headers" :isShowEnable="isShowEnable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiHttpRequestForm from "./ApiHttpRequestForm";
|
||||
|
||||
export default {
|
||||
name: "MsApiRequestForm",
|
||||
components: {MsApiHttpRequestForm},
|
||||
props: {
|
||||
request: {},
|
||||
response: {},
|
||||
headers: Array,
|
||||
isShowEnable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showScript: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
referenced: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
component({request: {type}}) {
|
||||
return "MsApiHttpRequestForm";
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.request-form >>> .debug-button {
|
||||
margin-left: auto;
|
||||
display: block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -43,7 +43,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import {downloadFile, getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
|
@ -58,7 +57,6 @@
|
|||
export default {
|
||||
name: "RunTestDubboPage",
|
||||
components: {
|
||||
MsApiRequestForm,
|
||||
MsApiCaseList,
|
||||
MsContainer,
|
||||
MsBottomContainer,
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import {downloadFile, getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import {downloadFile, getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
|
@ -57,7 +56,6 @@
|
|||
export default {
|
||||
name: "RunTestSQLPage",
|
||||
components: {
|
||||
MsApiRequestForm,
|
||||
MsApiCaseList,
|
||||
MsContainer,
|
||||
MsBottomContainer,
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import MsApiRequestForm from "../request/http/ApiRequestForm";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import {downloadFile, getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<script>
|
||||
import {AssertionJSR223} from "../../model/ScenarioModel";
|
||||
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiAssertionJsr223",
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
import MsDubboRegistryCenter from "@/business/components/api/test/components/request/dubbo/RegistryCenter";
|
||||
import MsDubboConfigCenter from "@/business/components/api/test/components/request/dubbo/ConfigCenter";
|
||||
import MsDubboConsumerService from "@/business/components/api/test/components/request/dubbo/ConsumerAndService";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiDubboRequestForm",
|
||||
|
|
|
@ -94,7 +94,7 @@ import ApiRequestMethodSelect from "../collapse/ApiRequestMethodSelect";
|
|||
import {REQUEST_HEADERS} from "@/common/js/constants";
|
||||
import MsApiVariable from "@/business/components/api/test/components/ApiVariable";
|
||||
import MsApiAdvancedConfig from "../ApiAdvancedConfig";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiHttpRequestForm",
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
import MsDubboConsumerService from "@/business/components/api/test/components/request/dubbo/ConsumerAndService";
|
||||
import MsCodeEdit from "../../../../common/components/MsCodeEdit";
|
||||
import MsApiScenarioVariables from "../ApiScenarioVariables";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiSqlRequestForm",
|
||||
|
|
|
@ -120,7 +120,7 @@ import {Scenario, TCPConfig, TCPRequest} from "@/business/components/api/test/mo
|
|||
import MsApiAssertions from "@/business/components/api/test/components/assertion/ApiAssertions";
|
||||
import MsApiExtract from "@/business/components/api/test/components/extract/ApiExtract";
|
||||
import MsCodeEdit from "@/business/components/common/components/MsCodeEdit";
|
||||
import MsJsr233Processor from "../../../automation/scenario/Jsr233Processor";
|
||||
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
|
||||
|
||||
export default {
|
||||
name: "MsApiTcpRequestForm",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
body: {},
|
||||
},
|
||||
created() {
|
||||
if (!this.body.jsonSchema && this.body.raw) {
|
||||
if (!this.body.jsonSchema && this.body.raw && this.checkIsJson(this.body.raw)) {
|
||||
let obj = {"root": GenerateSchema(JSON.parse(this.body.raw))}
|
||||
this.schema = obj;
|
||||
}
|
||||
|
@ -70,6 +70,14 @@
|
|||
openOneClickOperation() {
|
||||
this.$refs.importJson.openOneClickOperation();
|
||||
},
|
||||
checkIsJson(json) {
|
||||
try {
|
||||
JSON.parse(json);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
jsonData(data) {
|
||||
let obj = {"root": data}
|
||||
this.schema = obj;
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
json5.parse(json);
|
||||
return true;
|
||||
} catch (e) {
|
||||
alert(1);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -289,7 +289,6 @@
|
|||
for (const k in this.advancedValue) {
|
||||
if (this.pickValue[k]) this.advancedValue[k] = this.pickValue[k]
|
||||
}
|
||||
console.log(this.pickValue)
|
||||
},
|
||||
handleClose() {
|
||||
this.modalVisible = false;
|
||||
|
|
Loading…
Reference in New Issue