Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
1344e94e94
|
@ -1 +1 @@
|
||||||
Subproject commit bb494fc68a2367359c9048fa7250c7618de4afb6
|
Subproject commit 61397c16728a63493507679f7e0940d9099f337f
|
|
@ -30,7 +30,7 @@
|
||||||
:name="item.name"
|
:name="item.name"
|
||||||
closable>
|
closable>
|
||||||
<div class="ms-api-scenario-div">
|
<div class="ms-api-scenario-div">
|
||||||
<ms-edit-api-scenario :currentScenario="item.currentScenario" :moduleOptions="moduleOptions"/>
|
<ms-edit-api-scenario @refresh="refresh" :currentScenario="item.currentScenario" :moduleOptions="moduleOptions"/>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
let label = this.$t('api_test.automation.add_scenario');
|
let label = this.$t('api_test.automation.add_scenario');
|
||||||
let name = getUUID().substring(0, 8);
|
let name = getUUID().substring(0, 8);
|
||||||
this.activeName = name;
|
this.activeName = name;
|
||||||
this.tabs.push({label: label, name: name, currentScenario: {}});
|
this.tabs.push({label: label, name: name, currentScenario: {apiScenarioModuleId: "", id: getUUID()}});
|
||||||
}
|
}
|
||||||
if (tab.name === 'edit') {
|
if (tab.name === 'edit') {
|
||||||
let label = this.$t('api_test.automation.add_scenario');
|
let label = this.$t('api_test.automation.add_scenario');
|
||||||
|
|
|
@ -95,13 +95,21 @@
|
||||||
try {
|
try {
|
||||||
let urlObject = new URL(this.request.url);
|
let urlObject = new URL(this.request.url);
|
||||||
let url = urlObject.protocol + "//" + urlObject.host + "/";
|
let url = urlObject.protocol + "//" + urlObject.host + "/";
|
||||||
let path = this.request.url.substr(url.length);
|
if (url) {
|
||||||
if (!path.startsWith('/')) {
|
let path = this.request.url.substr(url.length);
|
||||||
path = "/" + path;
|
if (!path.startsWith('/')) {
|
||||||
|
path = "/" + path;
|
||||||
|
}
|
||||||
|
this.request.path = path;
|
||||||
|
} else {
|
||||||
|
this.request.url = this.request.path;
|
||||||
}
|
}
|
||||||
this.request.path = path;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.request.path = this.request.url;
|
if (this.request.url) {
|
||||||
|
this.request.path = this.request.url;
|
||||||
|
} else {
|
||||||
|
this.request.url = this.request.path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -200,9 +200,9 @@
|
||||||
<div v-if="operatingElements.indexOf('HTTPSamplerProxy')>0 || operatingElements.indexOf('DubboSampler')>0 || operatingElements.indexOf('JDBCSampler')>0 || operatingElements.indexOf('TCPSampler')>0 ">
|
<div v-if="operatingElements.indexOf('HTTPSamplerProxy')>0 || operatingElements.indexOf('DubboSampler')>0 || operatingElements.indexOf('JDBCSampler')>0 || operatingElements.indexOf('TCPSampler')>0 ">
|
||||||
<el-button class="ms-right-buttion ms-btn-1" size="small" @click="apiListImport">+{{$t('api_test.automation.api_list_import')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-1" size="small" @click="apiListImport">+{{$t('api_test.automation.api_list_import')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!--<div v-if="operatingElements.indexOf('OT_IMPORT')>0">
|
<div v-if="operatingElements.indexOf('OT_IMPORT')>0">
|
||||||
<el-button class="ms-right-buttion" size="small" style="color: #409EFF;background-color: #EEF5FE" @click="addComponent('OT_IMPORT')">+{{$t('api_test.automation.external_import')}}</el-button>
|
<el-button class="ms-right-buttion" size="small" style="color: #409EFF;background-color: #EEF5FE" @click="addComponent('OT_IMPORT')">+{{$t('api_test.automation.external_import')}}</el-button>
|
||||||
</div>-->
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('ConstantTimer')>0">
|
<div v-if="operatingElements.indexOf('ConstantTimer')>0">
|
||||||
<el-button class="ms-right-buttion ms-btn-3" size="small" @click="addComponent('ConstantTimer')">+{{$t('api_test.automation.wait_controller')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-3" size="small" @click="addComponent('ConstantTimer')">+{{$t('api_test.automation.wait_controller')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -245,7 +245,7 @@
|
||||||
<!--自定义接口-->
|
<!--自定义接口-->
|
||||||
<el-drawer :visible.sync="customizeVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.customize_req')" style="overflow: auto" :modal="false" size="90%">
|
<el-drawer :visible.sync="customizeVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.customize_req')" style="overflow: auto" :modal="false" size="90%">
|
||||||
<ms-api-customize :request="customizeRequest" @addCustomizeApi="addCustomizeApi"/>
|
<ms-api-customize :request="customizeRequest" @addCustomizeApi="addCustomizeApi"/>
|
||||||
<!--<el-button style="float: right;margin: 20px" @click="addCustomizeApi">{{$t('commons.save')}}</el-button>-->
|
<el-button style="float: right;margin: 20px" @click="addCustomizeApi">{{$t('commons.save')}}</el-button>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<!--场景导入 -->
|
<!--场景导入 -->
|
||||||
<el-drawer :visible.sync="scenarioVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.scenario_import')" style="overflow: auto" :modal="false" size="90%">
|
<el-drawer :visible.sync="scenarioVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.scenario_import')" style="overflow: auto" :modal="false" size="90%">
|
||||||
|
@ -682,6 +682,7 @@
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.path = "/api/automation/update";
|
this.path = "/api/automation/update";
|
||||||
this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId);
|
this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId);
|
||||||
|
this.$emit('refresh');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -708,6 +709,7 @@
|
||||||
},
|
},
|
||||||
setParameter() {
|
setParameter() {
|
||||||
this.currentScenario.stepTotal = this.scenarioDefinition.length;
|
this.currentScenario.stepTotal = this.scenarioDefinition.length;
|
||||||
|
this.currentScenario.projectId = getCurrentProjectID();
|
||||||
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
||||||
// 构建一个场景对象 方便引用处理
|
// 构建一个场景对象 方便引用处理
|
||||||
let scenario = {
|
let scenario = {
|
||||||
|
@ -715,7 +717,9 @@
|
||||||
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.currentScenario.scenarioDefinition = scenario;
|
this.currentScenario.scenarioDefinition = scenario;
|
||||||
this.currentScenario.tagId = JSON.stringify(this.currentScenario.tagId);
|
if (this.currentScenario.tagId instanceof Array) {
|
||||||
|
this.currentScenario.tagId = JSON.stringify(this.currentScenario.tagId);
|
||||||
|
}
|
||||||
if (this.currentModule != null) {
|
if (this.currentModule != null) {
|
||||||
this.currentScenario.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null;
|
this.currentScenario.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null;
|
||||||
this.currentScenario.apiScenarioModuleId = this.currentModule.id;
|
this.currentScenario.apiScenarioModuleId = this.currentModule.id;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-container style="padding-bottom: 200px">
|
<el-container style="padding-bottom: 300px">
|
||||||
<el-header style="width: 100% ;padding: 0px">
|
<el-header style="width: 100% ;padding: 0px">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit a22a3005d9bd254793fcf634d72539cbdf31be3a
|
Subproject commit aaeb324621dc3197c1bcbd3920600c0963fdea08
|
Loading…
Reference in New Issue