Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7e2c7fd5aa
|
@ -1,6 +1,6 @@
|
||||||
[submodule "backend/src/main/java/io/metersphere/xpack"]
|
[submodule "backend/src/main/java/io/metersphere/xpack"]
|
||||||
path = backend/src/main/java/io/metersphere/xpack
|
path = backend/src/main/java/io/metersphere/xpack
|
||||||
url = https://github.com/metersphere/xpack-backend.git
|
url = git@github.com:metersphere/xpack-backend.git
|
||||||
[submodule "frontend/src/business/components/xpack"]
|
[submodule "frontend/src/business/components/xpack"]
|
||||||
path = frontend/src/business/components/xpack
|
path = frontend/src/business/components/xpack
|
||||||
url = https://github.com/metersphere/xpack-frontend.git
|
url = git@github.com:metersphere/xpack-frontend.git
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
node {
|
||||||
|
label 'master'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options { quietPeriod(2400) }
|
||||||
|
parameters {
|
||||||
|
string(name: 'IMAGE_NAME', defaultValue: 'metersphere', description: '构建后的 Docker 镜像名称')
|
||||||
|
string(name: 'IMAGE_FREFIX', defaultValue: 'registry.cn-qingdao.aliyuncs.com/metersphere', description: '构建后的 Docker 镜像带仓库名的前缀')
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build/Test') {
|
||||||
|
steps {
|
||||||
|
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
|
||||||
|
sh "mvn clean package --settings ./settings.xml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker build & push') {
|
||||||
|
steps {
|
||||||
|
sh "docker build --build-arg MS_VERSION=\${TAG_NAME:-\$BRANCH_NAME}-b\${BUILD_NUMBER} -t ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ."
|
||||||
|
sh "docker tag ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ${IMAGE_FREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
|
||||||
|
sh "docker push ${IMAGE_FREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -280,7 +280,7 @@ public class ApiAutomationService {
|
||||||
// 调用执行方法
|
// 调用执行方法
|
||||||
jMeterService.runDefinition(request.getId(), jmeterTestPlanHashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
jMeterService.runDefinition(request.getId(), jmeterTestPlanHashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
||||||
|
|
||||||
createAPIReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.API.name() : request.getTriggerMode());
|
createAPIReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode());
|
||||||
return request.getId();
|
return request.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,6 +303,7 @@ public class ApiAutomationService {
|
||||||
ParameterConfig config = new ParameterConfig();
|
ParameterConfig config = new ParameterConfig();
|
||||||
config.setConfig(envConfig);
|
config.setConfig(envConfig);
|
||||||
HashTree hashTree = request.getTestElement().generateHashTree(config);
|
HashTree hashTree = request.getTestElement().generateHashTree(config);
|
||||||
|
request.getTestElement().getJmx(hashTree);
|
||||||
// 调用执行方法
|
// 调用执行方法
|
||||||
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
||||||
createAPIReportResult(request.getId(), ReportTriggerMode.MANUAL.name());
|
createAPIReportResult(request.getId(), ReportTriggerMode.MANUAL.name());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 61397c16728a63493507679f7e0940d9099f337f
|
Subproject commit b5643ac73fb4a2db3f11b23a81848990d8e78703
|
|
@ -92,7 +92,7 @@
|
||||||
let testPlan = createComponent('TestPlan');
|
let testPlan = createComponent('TestPlan');
|
||||||
let threadGroup = createComponent('ThreadGroup');
|
let threadGroup = createComponent('ThreadGroup');
|
||||||
threadGroup.hashTree = [];
|
threadGroup.hashTree = [];
|
||||||
threadGroup.name = this.runData.name;
|
threadGroup.name = this.runData.name ? this.runData.name : "Debug-Scenario";
|
||||||
threadGroup.hashTree.push(this.runData);
|
threadGroup.hashTree.push(this.runData);
|
||||||
testPlan.hashTree.push(threadGroup);
|
testPlan.hashTree.push(threadGroup);
|
||||||
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan};
|
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan};
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<!-- 场景步骤内容 -->
|
<!-- 场景步骤内容 -->
|
||||||
<div style="margin-top: 10px" v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition"
|
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition"
|
||||||
:default-expanded-keys="expandedNode"
|
:default-expanded-keys="expandedNode"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
|
@ -197,37 +197,37 @@
|
||||||
<el-col :span="3" class="ms-left-cell">
|
<el-col :span="3" class="ms-left-cell">
|
||||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="showAll">{{$t('commons.show_all')}}</el-button>
|
<el-button type="primary" icon="el-icon-refresh" size="small" @click="showAll">{{$t('commons.show_all')}}</el-button>
|
||||||
<br/>
|
<br/>
|
||||||
<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')!=-1 || operatingElements.indexOf('DubboSampler')!=-1 || operatingElements.indexOf('JDBCSampler')!=-1 || operatingElements.indexOf('TCPSampler')!=-1 ">
|
||||||
<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')!=-1">
|
||||||
<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')!=-1">
|
||||||
<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>
|
||||||
<div v-if="operatingElements.indexOf('IfController')>0">
|
<div v-if="operatingElements.indexOf('IfController')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-4" size="small" @click="addComponent('IfController')">+{{$t('api_test.automation.if_controller')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-4" size="small" @click="addComponent('IfController')">+{{$t('api_test.automation.if_controller')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('scenario')===0">
|
<div v-if="operatingElements.indexOf('scenario')===0">
|
||||||
<el-button class="ms-right-buttion ms-btn-5" size="small" @click="addComponent('scenario')">+{{$t('api_test.automation.scenario_import')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-5" size="small" @click="addComponent('scenario')">+{{$t('api_test.automation.scenario_import')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223Processor')>0">
|
<div v-if="operatingElements.indexOf('JSR223Processor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-6" size="small" @click="addComponent('JSR223Processor')">+{{$t('api_test.automation.customize_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-6" size="small" @click="addComponent('JSR223Processor')">+{{$t('api_test.automation.customize_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('CustomizeReq')>0">
|
<div v-if="operatingElements.indexOf('CustomizeReq')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-7" size="small" @click="addComponent('CustomizeReq')">+{{$t('api_test.automation.customize_req')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-7" size="small" @click="addComponent('CustomizeReq')">+{{$t('api_test.automation.customize_req')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223PreProcessor')>0">
|
<div v-if="operatingElements.indexOf('JSR223PreProcessor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-8" size="small" @click="addComponent('JSR223PreProcessor')">+{{$t('api_test.definition.request.pre_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-8" size="small" @click="addComponent('JSR223PreProcessor')">+{{$t('api_test.definition.request.pre_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223PostProcessor')>0">
|
<div v-if="operatingElements.indexOf('JSR223PostProcessor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-9" size="small" @click="addComponent('JSR223PostProcessor')">+{{$t('api_test.definition.request.post_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-9" size="small" @click="addComponent('JSR223PostProcessor')">+{{$t('api_test.definition.request.post_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('Assertions')>0">
|
<div v-if="operatingElements.indexOf('Assertions')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-10" size="small" @click="addComponent('Assertions')">+{{$t('api_test.definition.request.assertions_rule')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-10" size="small" @click="addComponent('Assertions')">+{{$t('api_test.definition.request.assertions_rule')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('Extract')>0">
|
<div v-if="operatingElements.indexOf('Extract')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-11" size="small" @click="addComponent('Extract')">+{{$t('api_test.definition.request.extract_param')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-11" size="small" @click="addComponent('Extract')">+{{$t('api_test.definition.request.extract_param')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -245,7 +245,6 @@
|
||||||
<!--自定义接口-->
|
<!--自定义接口-->
|
||||||
<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-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%">
|
||||||
|
@ -373,6 +372,11 @@
|
||||||
this.getApiScenario();
|
this.getApiScenario();
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
document.addEventListener('click', e => {
|
||||||
|
this.showAll();
|
||||||
|
})
|
||||||
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
methods: {
|
methods: {
|
||||||
addComponent(type) {
|
addComponent(type) {
|
||||||
|
@ -486,6 +490,9 @@
|
||||||
} else {
|
} else {
|
||||||
request = item.request;
|
request = item.request;
|
||||||
}
|
}
|
||||||
|
if (item.protocol) {
|
||||||
|
request.protocol = item.protocol;
|
||||||
|
}
|
||||||
request.id = item.id;
|
request.id = item.id;
|
||||||
request.name = item.name;
|
request.name = item.name;
|
||||||
request.refType = refType;
|
request.refType = refType;
|
||||||
|
@ -606,13 +613,16 @@
|
||||||
environmentConfigClose() {
|
environmentConfigClose() {
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
allowDrop(draggingNode, dropNode, type) {
|
allowDrop(draggingNode, dropNode, dropType) {
|
||||||
if (dropNode.data.type === draggingNode.data.type || ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) {
|
if (dropType != "inner") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (dropType === "inner" && ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
allowDrag() {
|
allowDrag(draggingNode, dropNode, dropType) {
|
||||||
this.sort();
|
this.sort();
|
||||||
this.reload();
|
this.reload();
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
export const ELEMENTS = new Map([
|
export const ELEMENTS = new Map([
|
||||||
['ALL', ["scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['ALL', ["scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "CustomizeReq"]],
|
||||||
['scenario', ["API", "CASE", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['scenario', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "CASE", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "CustomizeReq"]],
|
||||||
['HTTPSamplerProxy', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['HTTPSamplerProxy', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['DubboSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['DubboSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['JDBCSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['JDBCSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['TCPSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['TCPSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['OT_IMPORT', []],
|
['OT_IMPORT', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['IfController', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['IfController', ["IfController", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
||||||
['ConstantTimer', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['ConstantTimer', []],
|
||||||
['JSR223Processor', []],
|
['JSR223Processor', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['JSR223PreProcessor', []],
|
['JSR223PreProcessor', []],
|
||||||
['JSR223PostProcessor', []],
|
['JSR223PostProcessor', []],
|
||||||
['Assertions', []],
|
['Assertions', []],
|
||||||
['Extract', []],
|
['Extract', []],
|
||||||
['CustomizeReq', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['CustomizeReq', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
])
|
])
|
||||||
|
|
||||||
export const ELEMENT_TYPE = {
|
export const ELEMENT_TYPE = {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-container>
|
<ms-container>
|
||||||
<ms-aside-container>
|
<ms-aside-container>
|
||||||
<ms-node-tree @selectModule="selectModule" @getApiModuleTree="initTree" @changeProtocol="changeProtocol"
|
<ms-node-tree @nodeSelectEvent="selectModule" @getApiModuleTree="initTree" @protocolChange="changeProtocol"
|
||||||
@refresh="refresh" @saveAsEdit="editApi" @exportAPI="exportAPI"/>
|
@refresh="refresh" @saveAsEdit="editApi" @exportAPI="exportAPI"/>
|
||||||
</ms-aside-container>
|
</ms-aside-container>
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
this.isHide = true;
|
this.isHide = true;
|
||||||
},
|
},
|
||||||
selectModule(data) {
|
selectModule(data) {
|
||||||
this.currentModule = data;
|
this.currentModule = data.data;
|
||||||
},
|
},
|
||||||
exportAPI() {
|
exportAPI() {
|
||||||
if (!this.$refs.apiList[0].tableData) {
|
if (!this.$refs.apiList[0].tableData) {
|
||||||
|
|
|
@ -76,14 +76,14 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<ms-table-pagination :change="initApiTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div id="svgResize"/>
|
<div id="svgResize"/>
|
||||||
<div id="svgDown">
|
<div id="svgDown">
|
||||||
<ms-bottom-container v-bind:enableAsideHidden="isHide">
|
<ms-bottom-container v-bind:enableAsideHidden="isHide">
|
||||||
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initApiTable" :visible="visible" :currentRow="currentRow" :api="selectApi"/>
|
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initTable" :visible="visible" :currentRow="currentRow" :api="selectApi"/>
|
||||||
</ms-bottom-container>
|
</ms-bottom-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -150,38 +150,35 @@
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.projectId = getCurrentProjectID();
|
this.projectId = getCurrentProjectID();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.dragControllerDiv();
|
this.dragControllerDiv();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentModule() {
|
currentModule() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
visible() {
|
visible() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
currentProtocol() {
|
currentProtocol() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initApiTable() {
|
initTable() {
|
||||||
|
this.selectRows = new Set();
|
||||||
this.condition.filters = ["Prepare", "Underway", "Completed"];
|
this.condition.filters = ["Prepare", "Underway", "Completed"];
|
||||||
if (this.currentModule != null) {
|
if (this.currentModule) {
|
||||||
if (this.currentModule.id == "root") {
|
this.condition.moduleIds = [this.currentModule.id];
|
||||||
this.condition.moduleIds = [];
|
}
|
||||||
} else if (this.currentModule.id == "gc") {
|
if (this.trashEnable) {
|
||||||
this.condition.moduleIds = [];
|
this.condition.filters = ["Trash"];
|
||||||
this.condition.filters = ["Trash"];
|
this.condition.moduleIds = [];
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.condition.moduleIds = this.currentModule.ids;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (this.projectId != null) {
|
if (this.projectId != null) {
|
||||||
this.condition.projectId = this.projectId;
|
this.condition.projectId = this.projectId;
|
||||||
|
@ -193,7 +190,6 @@
|
||||||
this.total = response.data.itemCount;
|
this.total = response.data.itemCount;
|
||||||
this.tableData = response.data.listObject;
|
this.tableData = response.data.listObject;
|
||||||
});
|
});
|
||||||
this.selectRows = new Set();
|
|
||||||
},
|
},
|
||||||
handleSelect(selection, row) {
|
handleSelect(selection, row) {
|
||||||
row.hashTree = [];
|
row.hashTree = [];
|
||||||
|
@ -241,7 +237,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
buildPagePath(path) {
|
buildPagePath(path) {
|
||||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
|
@ -268,7 +264,7 @@
|
||||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
this.$post('/api/definition/deleteBatch/', ids, () => {
|
this.$post('/api/definition/deleteBatch/', ids, () => {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -282,7 +278,7 @@
|
||||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
this.$post('/api/definition/removeToGc/', ids, () => {
|
this.$post('/api/definition/removeToGc/', ids, () => {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -307,7 +303,7 @@
|
||||||
if (this.currentModule != undefined && this.currentModule.id == "gc") {
|
if (this.currentModule != undefined && this.currentModule.id == "gc") {
|
||||||
this.$get('/api/definition/delete/' + api.id, () => {
|
this.$get('/api/definition/delete/' + api.id, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -318,7 +314,7 @@
|
||||||
let ids = [api.id];
|
let ids = [api.id];
|
||||||
this.$post('/api/definition/removeToGc/', ids, () => {
|
this.$post('/api/definition/removeToGc/', ids, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_info')" v-model="condition.priority"
|
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_info')" v-model="condition.priority"
|
||||||
:disabled="isCaseEdit"
|
:disabled="isCaseEdit"
|
||||||
class="ms-api-header-select" @change="getApiTest">
|
class="ms-api-header-select" @change="getApiTest" clearable>
|
||||||
<el-option v-for="grd in priorities" :key="grd.id" :label="grd.name" :value="grd.id"/>
|
<el-option v-for="grd in priorities" :key="grd.id" :label="grd.name" :value="grd.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getMaintainerOptions();
|
this.getMaintainerOptions();
|
||||||
this.httpForm = this.basisData;
|
this.httpForm = JSON.parse(JSON.stringify(this.basisData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
let validateURL = (rule, value, callback) => {
|
let validateURL = (rule, value, callback) => {
|
||||||
try {
|
try {
|
||||||
new URL(this.debugForm.url);
|
new URL(this.debugForm.url);
|
||||||
|
callback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
callback(this.$t('api_test.request.url_invalid'));
|
callback(this.$t('api_test.request.url_invalid'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,15 @@ export default {
|
||||||
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
|
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
|
||||||
localStorage.setItem(PROJECT_ID, projectId);
|
localStorage.setItem(PROJECT_ID, projectId);
|
||||||
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
|
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
|
||||||
|
if (path === '/api') {
|
||||||
|
if (this.$store.state.switch.value === 'new') {
|
||||||
|
path = "/api/home";
|
||||||
|
} else if (this.$store.state.switch.value === 'old') {
|
||||||
|
path = "/api/home_obsolete";
|
||||||
|
} else {
|
||||||
|
path = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$router.push(path).then(() => {
|
this.$router.push(path).then(() => {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}).catch(err => err);
|
}).catch(err => err);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -273,6 +273,7 @@ export default {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
pre {
|
pre {
|
||||||
margin: 0 0;
|
margin: 0 0;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -13,11 +13,10 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8" :offset="1">
|
<el-col :span="8" :offset="1">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:placeholder="$t('test_track.plan.input_name')"
|
|
||||||
:label="$t('test_track.plan.plan_name')"
|
:label="$t('test_track.plan.plan_name')"
|
||||||
:label-width="formLabelWidth"
|
:label-width="formLabelWidth"
|
||||||
prop="name">
|
prop="name">
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input v-model="form.name" :placeholder="$t('test_track.plan.input_plan_name')"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,7 @@ export default {
|
||||||
api_case_passing_rate: "Use case pass rate",
|
api_case_passing_rate: "Use case pass rate",
|
||||||
create_tip: "Note: Detailed interface information can be filled out on the edit page",
|
create_tip: "Note: Detailed interface information can be filled out on the edit page",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "From high to low",
|
grade_info: "Filter by rank",
|
||||||
run_env: "Operating environment",
|
run_env: "Operating environment",
|
||||||
select_case: "Search use cases",
|
select_case: "Search use cases",
|
||||||
case: "Case",
|
case: "Case",
|
||||||
|
|
|
@ -497,7 +497,7 @@ export default {
|
||||||
api_case_passing_rate: "用例通过率",
|
api_case_passing_rate: "用例通过率",
|
||||||
create_tip: "注: 详细的接口信息可以在编辑页面填写",
|
create_tip: "注: 详细的接口信息可以在编辑页面填写",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "按等级从高到低",
|
grade_info: "按等级筛选",
|
||||||
run_env: "运行环境",
|
run_env: "运行环境",
|
||||||
select_case: "搜索用例",
|
select_case: "搜索用例",
|
||||||
case: "用例",
|
case: "用例",
|
||||||
|
|
|
@ -497,7 +497,7 @@ export default {
|
||||||
api_case_passing_rate: "用例通過率",
|
api_case_passing_rate: "用例通過率",
|
||||||
create_tip: "註: 詳細的接口信息可以在編輯頁面填寫",
|
create_tip: "註: 詳細的接口信息可以在編輯頁面填寫",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "按等級從高到低",
|
grade_info: "按等級筛选",
|
||||||
run_env: "運行環境",
|
run_env: "運行環境",
|
||||||
select_case: "搜索用例",
|
select_case: "搜索用例",
|
||||||
case: "用例",
|
case: "用例",
|
||||||
|
|
Loading…
Reference in New Issue