Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
95be5207b2
|
@ -84,7 +84,9 @@ public class MsTCPSampler extends MsTestElement {
|
||||||
this.setProjectId(config.getProjectId());
|
this.setProjectId(config.getProjectId());
|
||||||
config.setConfig(getEnvironmentConfig(useEnvironment));
|
config.setConfig(getEnvironmentConfig(useEnvironment));
|
||||||
}
|
}
|
||||||
|
if(config.getConfig()!=null){
|
||||||
parseEnvironment(config.getConfig().get(this.projectId));
|
parseEnvironment(config.getConfig().get(this.projectId));
|
||||||
|
}
|
||||||
|
|
||||||
// 添加环境中的公共变量
|
// 添加环境中的公共变量
|
||||||
Arguments arguments = this.addArguments(config);
|
Arguments arguments = this.addArguments(config);
|
||||||
|
|
|
@ -20,4 +20,5 @@ public class ApiDocumentRequest {
|
||||||
private String type;
|
private String type;
|
||||||
private String orderCondition;
|
private String orderCondition;
|
||||||
private List<String> apiIdList;
|
private List<String> apiIdList;
|
||||||
|
private boolean trashEnable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import io.metersphere.api.service.*;
|
||||||
import io.metersphere.base.domain.ApiDefinitionExecResult;
|
import io.metersphere.base.domain.ApiDefinitionExecResult;
|
||||||
import io.metersphere.base.domain.ApiScenarioReport;
|
import io.metersphere.base.domain.ApiScenarioReport;
|
||||||
import io.metersphere.base.domain.ApiTestReport;
|
import io.metersphere.base.domain.ApiTestReport;
|
||||||
import io.metersphere.base.domain.TestPlanReport;
|
|
||||||
import io.metersphere.commons.constants.*;
|
import io.metersphere.commons.constants.*;
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
@ -15,7 +14,6 @@ import io.metersphere.notice.sender.NoticeModel;
|
||||||
import io.metersphere.notice.service.NoticeSendService;
|
import io.metersphere.notice.service.NoticeSendService;
|
||||||
import io.metersphere.service.SystemParameterService;
|
import io.metersphere.service.SystemParameterService;
|
||||||
import io.metersphere.track.service.TestPlanReportService;
|
import io.metersphere.track.service.TestPlanReportService;
|
||||||
import io.metersphere.track.service.TestPlanService;
|
|
||||||
import io.metersphere.track.service.TestPlanTestCaseService;
|
import io.metersphere.track.service.TestPlanTestCaseService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -206,7 +204,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
} else {
|
} else {
|
||||||
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name());
|
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name());
|
||||||
}
|
}
|
||||||
} else if (StringUtils.equalsAny(this.runMode, ApiRunMode.SCENARIO.name(), ApiRunMode.SCENARIO_PLAN.name(), ApiRunMode.SCHEDULE_SCENARIO_PLAN.name())) {
|
} else if (StringUtils.equalsAny(this.runMode, ApiRunMode.SCENARIO.name(), ApiRunMode.SCENARIO_PLAN.name(), ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(),ApiRunMode.SCHEDULE_SCENARIO.name())) {
|
||||||
// 执行报告不需要存储,由用户确认后在存储
|
// 执行报告不需要存储,由用户确认后在存储
|
||||||
testResult.setTestId(testId);
|
testResult.setTestId(testId);
|
||||||
ApiScenarioReport scenarioReport = apiScenarioReportService.complete(testResult, this.runMode);
|
ApiScenarioReport scenarioReport = apiScenarioReportService.complete(testResult, this.runMode);
|
||||||
|
|
|
@ -269,6 +269,9 @@ public class ApiAutomationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteApiScenarioReport(List<String> scenarioIds) {
|
private void deleteApiScenarioReport(List<String> scenarioIds) {
|
||||||
|
if(scenarioIds == null || scenarioIds.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
ApiScenarioReportExample scenarioReportExample = new ApiScenarioReportExample();
|
ApiScenarioReportExample scenarioReportExample = new ApiScenarioReportExample();
|
||||||
scenarioReportExample.createCriteria().andScenarioIdIn(scenarioIds);
|
scenarioReportExample.createCriteria().andScenarioIdIn(scenarioIds);
|
||||||
List<ApiScenarioReport> list = apiScenarioReportMapper.selectByExample(scenarioReportExample);
|
List<ApiScenarioReport> list = apiScenarioReportMapper.selectByExample(scenarioReportExample);
|
||||||
|
|
|
@ -149,10 +149,11 @@ public class ApiTestCaseService {
|
||||||
public ApiTestCaseWithBLOBs get(String id) {
|
public ApiTestCaseWithBLOBs get(String id) {
|
||||||
// ApiTestCaseWithBLOBs returnBlobs = apiTestCaseMapper.selectByPrimaryKey(id);
|
// ApiTestCaseWithBLOBs returnBlobs = apiTestCaseMapper.selectByPrimaryKey(id);
|
||||||
ApiTestCaseInfo model = extApiTestCaseMapper.selectApiCaseInfoByPrimaryKey(id);
|
ApiTestCaseInfo model = extApiTestCaseMapper.selectApiCaseInfoByPrimaryKey(id);
|
||||||
|
if(model != null ){
|
||||||
if(StringUtils.equalsIgnoreCase(model.getApiMethod(),"esb")){
|
if(StringUtils.equalsIgnoreCase(model.getApiMethod(),"esb")){
|
||||||
esbApiParamService.handleApiEsbParams(model);
|
esbApiParamService.handleApiEsbParams(model);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,13 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="io.metersphere.base.mapper.ext.ExtApiDocumentMapper">
|
<mapper namespace="io.metersphere.base.mapper.ext.ExtApiDocumentMapper">
|
||||||
<select id="findApiDocumentSimpleInfoByRequest" resultType="io.metersphere.api.dto.document.ApiDocumentInfoDTO">
|
<select id="findApiDocumentSimpleInfoByRequest" resultType="io.metersphere.api.dto.document.ApiDocumentInfoDTO">
|
||||||
SELECT api.id,api.name FROM Api_definition api WHERE api.protocol = 'HTTP' AND api.status != 'Trash'
|
SELECT api.id,api.name FROM Api_definition api WHERE api.protocol = 'HTTP'
|
||||||
|
<if test="request.trashEnable == true">
|
||||||
|
AND api.status = 'Trash'
|
||||||
|
</if>
|
||||||
|
<if test="request.trashEnable == false">
|
||||||
|
AND api.status != 'Trash'
|
||||||
|
</if>
|
||||||
<if test="request.projectId != null">
|
<if test="request.projectId != null">
|
||||||
AND api.project_Id = #{request.projectId}
|
AND api.project_Id = #{request.projectId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package io.metersphere.commons.constants;
|
package io.metersphere.commons.constants;
|
||||||
|
|
||||||
public enum ApiRunMode {
|
public enum ApiRunMode {
|
||||||
RUN, DEBUG, DEFINITION, SCENARIO, API_PLAN, JENKINS_API_PLAN, JENKINS, SCENARIO_PLAN, API, SCHEDULE_API_PLAN, SCHEDULE_SCENARIO_PLAN, SCHEDULE_PERFORMANCE_TEST
|
RUN, DEBUG, DEFINITION, SCENARIO, API_PLAN, JENKINS_API_PLAN, JENKINS, SCENARIO_PLAN, API, SCHEDULE_API_PLAN, SCHEDULE_SCENARIO,SCHEDULE_SCENARIO_PLAN, SCHEDULE_PERFORMANCE_TEST
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package io.metersphere.job.sechedule;
|
||||||
import io.metersphere.api.dto.automation.ExecuteType;
|
import io.metersphere.api.dto.automation.ExecuteType;
|
||||||
import io.metersphere.api.dto.automation.RunScenarioRequest;
|
import io.metersphere.api.dto.automation.RunScenarioRequest;
|
||||||
import io.metersphere.api.service.ApiAutomationService;
|
import io.metersphere.api.service.ApiAutomationService;
|
||||||
|
import io.metersphere.commons.constants.ApiRunMode;
|
||||||
import io.metersphere.commons.constants.ReportTriggerMode;
|
import io.metersphere.commons.constants.ReportTriggerMode;
|
||||||
import io.metersphere.commons.constants.ScheduleGroup;
|
import io.metersphere.commons.constants.ScheduleGroup;
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||||
|
@ -58,6 +59,7 @@ public class ApiScenarioTestJob extends MsScheduleJob {
|
||||||
request.setExecuteType(ExecuteType.Saved.name());
|
request.setExecuteType(ExecuteType.Saved.name());
|
||||||
request.setIds(this.scenarioIds);
|
request.setIds(this.scenarioIds);
|
||||||
request.setReportUserID(this.userId);
|
request.setReportUserID(this.userId);
|
||||||
|
request.setRunMode(ApiRunMode.SCHEDULE_SCENARIO.name());
|
||||||
|
|
||||||
apiAutomationService.run(request);
|
apiAutomationService.run(request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -611,6 +611,9 @@ public class TestPlanService {
|
||||||
|
|
||||||
List<ReportComponent> components = ReportComponentFactory.createComponents(componentIds.toJavaList(String.class), testPlan);
|
List<ReportComponent> components = ReportComponentFactory.createComponents(componentIds.toJavaList(String.class), testPlan);
|
||||||
List<Issues> issues = buildFunctionalCaseReport(planId, components);
|
List<Issues> issues = buildFunctionalCaseReport(planId, components);
|
||||||
|
buildApiCaseReport(planId, components);
|
||||||
|
buildScenarioCaseReport(planId, components);
|
||||||
|
buildLoadCaseReport(planId, components);
|
||||||
|
|
||||||
TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO();
|
TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO();
|
||||||
components.forEach(component -> {
|
components.forEach(component -> {
|
||||||
|
|
|
@ -268,7 +268,7 @@
|
||||||
if (api) {
|
if (api) {
|
||||||
let data = JSON.parse(JSON.stringify(api));
|
let data = JSON.parse(JSON.stringify(api));
|
||||||
data.id = getUUID();
|
data.id = getUUID();
|
||||||
this.httpForm = {id: data.id, name: data.name, protocol: data.protocol, path: data.path, method: REQ_METHOD[0].id, userId: getCurrentUser().id, request: data};
|
this.httpForm = {id: data.id, name: data.name, protocol: data.protocol, path: data.path, method: api.method, userId: getCurrentUser().id, request: data};
|
||||||
this.getMaintainerOptions();
|
this.getMaintainerOptions();
|
||||||
this.list(data);
|
this.list(data);
|
||||||
this.httpVisible = true;
|
this.httpVisible = true;
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
<api-documents-page class="api-doc-page"
|
<api-documents-page class="api-doc-page"
|
||||||
v-if="activeDom==='right'"
|
v-if="activeDom==='right'"
|
||||||
:project-id="projectId"
|
:project-id="projectId"
|
||||||
|
:trash-enable="trashEnable"
|
||||||
:module-ids="selectNodeIds"/>
|
:module-ids="selectNodeIds"/>
|
||||||
</ms-tab-button>
|
</ms-tab-button>
|
||||||
<!-- 添加/编辑测试窗口-->
|
<!-- 添加/编辑测试窗口-->
|
||||||
|
@ -81,13 +82,13 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- 快捷调试 -->
|
<!-- 快捷调试 -->
|
||||||
<div v-else-if="item.type=== 'debug'" class="ms-api-div">
|
<div v-else-if="item.type=== 'debug'" class="ms-api-div">
|
||||||
<ms-debug-http-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi"
|
<ms-debug-http-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi" @refreshModule="refreshModule"
|
||||||
v-if="currentProtocol==='HTTP'"/>
|
v-if="currentProtocol==='HTTP'"/>
|
||||||
<ms-debug-jdbc-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi"
|
<ms-debug-jdbc-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi" @refreshModule="refreshModule"
|
||||||
v-if="currentProtocol==='SQL'"/>
|
v-if="currentProtocol==='SQL'"/>
|
||||||
<ms-debug-tcp-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi"
|
<ms-debug-tcp-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi" @refreshModule="refreshModule"
|
||||||
v-if="currentProtocol==='TCP'"/>
|
v-if="currentProtocol==='TCP'"/>
|
||||||
<ms-debug-dubbo-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi"
|
<ms-debug-dubbo-page :currentProtocol="currentProtocol" :testCase="item.api" @saveAs="editApi" @refreshModule="refreshModule"
|
||||||
v-if="currentProtocol==='DUBBO'"/>
|
v-if="currentProtocol==='DUBBO'"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -356,6 +357,9 @@
|
||||||
}
|
}
|
||||||
this.$refs.apiList[0].exportApi(type);
|
this.$refs.apiList[0].exportApi(type);
|
||||||
},
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$refs.nodeTree.list();
|
||||||
|
},
|
||||||
refresh(data) {
|
refresh(data) {
|
||||||
this.$refs.apiList[0].initTable(data);
|
this.$refs.apiList[0].initTable(data);
|
||||||
},
|
},
|
||||||
|
|
|
@ -278,6 +278,7 @@
|
||||||
let url = '/api/module/getModuleByName/' + getCurrentProjectID() + "/" + this.api.protocol;
|
let url = '/api/module/getModuleByName/' + getCurrentProjectID() + "/" + this.api.protocol;
|
||||||
this.$get(url, response => {
|
this.$get(url, response => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
this.$emit('refreshModule');
|
||||||
this.saveApi(row, response.data);
|
this.saveApi(row, response.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -332,6 +333,10 @@
|
||||||
row.id = data.id;
|
row.id = data.id;
|
||||||
row.createTime = data.createTime;
|
row.createTime = data.createTime;
|
||||||
row.updateTime = data.updateTime;
|
row.updateTime = data.updateTime;
|
||||||
|
if (!row.message) {
|
||||||
|
this.$success(this.$t('commons.save_success'));
|
||||||
|
this.$emit('refresh');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveTestCase(row) {
|
saveTestCase(row) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
<api-case-item v-loading="singleLoading && singleRunId === item.id || batchLoadingIds.indexOf(item.id) > -1"
|
<api-case-item v-loading="singleLoading && singleRunId === item.id || batchLoadingIds.indexOf(item.id) > -1"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
@singleRun="singleRun"
|
@singleRun="singleRun"
|
||||||
|
@refreshModule="refreshModule"
|
||||||
@copyCase="copyCase"
|
@copyCase="copyCase"
|
||||||
@showExecResult="showExecResult"
|
@showExecResult="showExecResult"
|
||||||
@batchEditCase="batchEditCase"
|
@batchEditCase="batchEditCase"
|
||||||
|
@ -181,7 +182,9 @@
|
||||||
this.apiCaseList = [];
|
this.apiCaseList = [];
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
|
refreshModule(){
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
runRefresh() {
|
runRefresh() {
|
||||||
this.batchLoadingIds = [];
|
this.batchLoadingIds = [];
|
||||||
this.singleLoading = false;
|
this.singleLoading = false;
|
||||||
|
|
|
@ -30,25 +30,25 @@
|
||||||
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 加载用例 -->
|
<!-- 加载用例 -->
|
||||||
<ms-api-case-list :loaded="false" ref="caseList"/>
|
<ms-api-case-list @refreshModule="refreshModule" :loaded="false" ref="caseList"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsResponseResult from "../response/ResponseResult";
|
import MsResponseResult from "../response/ResponseResult";
|
||||||
import MsRequestMetric from "../response/RequestMetric";
|
import MsRequestMetric from "../response/RequestMetric";
|
||||||
import {getUUID} from "@/common/js/utils";
|
import {getUUID} from "@/common/js/utils";
|
||||||
import MsResponseText from "../response/ResponseText";
|
import MsResponseText from "../response/ResponseText";
|
||||||
import MsRun from "../Run";
|
import MsRun from "../Run";
|
||||||
import {createComponent} from "../jmeter/components";
|
import {createComponent} from "../jmeter/components";
|
||||||
import {REQ_METHOD} from "../../model/JsonData";
|
import {REQ_METHOD} from "../../model/JsonData";
|
||||||
import MsRequestResultTail from "../response/RequestResultTail";
|
import MsRequestResultTail from "../response/RequestResultTail";
|
||||||
import MsBasisParameters from "../request/dubbo/BasisParameters";
|
import MsBasisParameters from "../request/dubbo/BasisParameters";
|
||||||
import MsJmxStep from "../step/JmxStep";
|
import MsJmxStep from "../step/JmxStep";
|
||||||
import MsApiCaseList from "../case/ApiCaseList";
|
import MsApiCaseList from "../case/ApiCaseList";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ApiConfig",
|
name: "ApiConfig",
|
||||||
components: {
|
components: {
|
||||||
MsRequestResultTail,
|
MsRequestResultTail,
|
||||||
|
@ -122,7 +122,9 @@ export default {
|
||||||
this.runDebug();
|
this.runDebug();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
runDebug() {
|
runDebug() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.request.name = getUUID().substring(0, 8);
|
this.request.name = getUUID().substring(0, 8);
|
||||||
|
|
|
@ -44,25 +44,25 @@
|
||||||
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 加载用例 -->
|
<!-- 加载用例 -->
|
||||||
<ms-api-case-list :loaded="false" ref="caseList"/>
|
<ms-api-case-list @refreshModule="refreshModule" :loaded="false" ref="caseList"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||||
import MsResponseResult from "../response/ResponseResult";
|
import MsResponseResult from "../response/ResponseResult";
|
||||||
import MsRequestMetric from "../response/RequestMetric";
|
import MsRequestMetric from "../response/RequestMetric";
|
||||||
import {getCurrentUser, getUUID} from "@/common/js/utils";
|
import {getCurrentUser, getUUID} from "@/common/js/utils";
|
||||||
import MsResponseText from "../response/ResponseText";
|
import MsResponseText from "../response/ResponseText";
|
||||||
import MsRun from "../Run";
|
import MsRun from "../Run";
|
||||||
import {createComponent} from "../jmeter/components";
|
import {createComponent} from "../jmeter/components";
|
||||||
import {REQ_METHOD} from "../../model/JsonData";
|
import {REQ_METHOD} from "../../model/JsonData";
|
||||||
import MsRequestResultTail from "../response/RequestResultTail";
|
import MsRequestResultTail from "../response/RequestResultTail";
|
||||||
import MsJmxStep from "../step/JmxStep";
|
import MsJmxStep from "../step/JmxStep";
|
||||||
import {KeyValue} from "../../model/ApiTestModel";
|
import {KeyValue} from "../../model/ApiTestModel";
|
||||||
import MsApiCaseList from "../case/ApiCaseList";
|
import MsApiCaseList from "../case/ApiCaseList";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ApiConfig",
|
name: "ApiConfig",
|
||||||
components: {
|
components: {
|
||||||
MsRequestResultTail,
|
MsRequestResultTail,
|
||||||
|
@ -166,6 +166,9 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
runRefresh(data) {
|
runRefresh(data) {
|
||||||
this.responseData = data;
|
this.responseData = data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -32,26 +32,26 @@
|
||||||
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 加载用例 -->
|
<!-- 加载用例 -->
|
||||||
<ms-api-case-list :loaded="false" ref="caseList"/>
|
<ms-api-case-list @refreshModule="refreshModule" :loaded="false" ref="caseList"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsResponseResult from "../response/ResponseResult";
|
import MsResponseResult from "../response/ResponseResult";
|
||||||
import MsRequestMetric from "../response/RequestMetric";
|
import MsRequestMetric from "../response/RequestMetric";
|
||||||
import {getUUID} from "@/common/js/utils";
|
import {getUUID} from "@/common/js/utils";
|
||||||
import MsResponseText from "../response/ResponseText";
|
import MsResponseText from "../response/ResponseText";
|
||||||
import MsRun from "../Run";
|
import MsRun from "../Run";
|
||||||
import {createComponent} from "../jmeter/components";
|
import {createComponent} from "../jmeter/components";
|
||||||
import {REQ_METHOD} from "../../model/JsonData";
|
import {REQ_METHOD} from "../../model/JsonData";
|
||||||
import MsRequestResultTail from "../response/RequestResultTail";
|
import MsRequestResultTail from "../response/RequestResultTail";
|
||||||
import MsBasisParameters from "../request/database/BasisParameters";
|
import MsBasisParameters from "../request/database/BasisParameters";
|
||||||
import MsJmxStep from "../step/JmxStep";
|
import MsJmxStep from "../step/JmxStep";
|
||||||
import MsApiCaseList from "../case/ApiCaseList";
|
import MsApiCaseList from "../case/ApiCaseList";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ApiConfig",
|
name: "ApiConfig",
|
||||||
components: {
|
components: {
|
||||||
MsRequestResultTail,
|
MsRequestResultTail,
|
||||||
|
@ -125,7 +125,9 @@ export default {
|
||||||
this.$refs['requestForm'].validate();
|
this.$refs['requestForm'].validate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
runDebug() {
|
runDebug() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.request.name = getUUID().substring(0, 8);
|
this.request.name = getUUID().substring(0, 8);
|
||||||
|
|
|
@ -42,27 +42,27 @@
|
||||||
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 加载用例 -->
|
<!-- 加载用例 -->
|
||||||
<ms-api-case-list :loaded="false" ref="caseList"/>
|
<ms-api-case-list @refreshModule="refreshModule" :loaded="false" ref="caseList"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||||
import MsResponseResult from "../response/ResponseResult";
|
import MsResponseResult from "../response/ResponseResult";
|
||||||
import MsRequestMetric from "../response/RequestMetric";
|
import MsRequestMetric from "../response/RequestMetric";
|
||||||
import {getUUID} from "@/common/js/utils";
|
import {getUUID} from "@/common/js/utils";
|
||||||
import MsResponseText from "../response/ResponseText";
|
import MsResponseText from "../response/ResponseText";
|
||||||
import MsRun from "../Run";
|
import MsRun from "../Run";
|
||||||
import {createComponent} from "../jmeter/components";
|
import {createComponent} from "../jmeter/components";
|
||||||
import {REQ_METHOD} from "../../model/JsonData";
|
import {REQ_METHOD} from "../../model/JsonData";
|
||||||
import MsRequestResultTail from "../response/RequestResultTail";
|
import MsRequestResultTail from "../response/RequestResultTail";
|
||||||
import TcpBasisParameters from "../request/tcp/TcpBasisParameters";
|
import TcpBasisParameters from "../request/tcp/TcpBasisParameters";
|
||||||
import MsJmxStep from "../step/JmxStep";
|
import MsJmxStep from "../step/JmxStep";
|
||||||
import MsApiCaseList from "../case/ApiCaseList";
|
import MsApiCaseList from "../case/ApiCaseList";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ApiConfig",
|
name: "ApiConfig",
|
||||||
components: {
|
components: {
|
||||||
MsJmxStep,
|
MsJmxStep,
|
||||||
|
@ -130,7 +130,9 @@ export default {
|
||||||
this.$refs['requestForm'].validate();
|
this.$refs['requestForm'].validate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
runDebug() {
|
runDebug() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.request.name = getUUID().substring(0, 8);
|
this.request.name = getUUID().substring(0, 8);
|
||||||
|
|
|
@ -369,6 +369,10 @@ export default {
|
||||||
moduleIds: Array,
|
moduleIds: Array,
|
||||||
sharePage:Boolean,
|
sharePage:Boolean,
|
||||||
pageHeaderHeight:Number,
|
pageHeaderHeight:Number,
|
||||||
|
trashEnable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.initApiDocSimpleList();
|
this.initApiDocSimpleList();
|
||||||
|
@ -409,6 +413,9 @@ export default {
|
||||||
},
|
},
|
||||||
clientHeight() { //如果clientHeight 发生改变,这个函数就会运行
|
clientHeight() { //如果clientHeight 发生改变,这个函数就会运行
|
||||||
this.changeFixed(this.clientHeight);
|
this.changeFixed(this.clientHeight);
|
||||||
|
},
|
||||||
|
trashEnable() {
|
||||||
|
this.initApiDocSimpleList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -441,7 +448,10 @@ export default {
|
||||||
}
|
}
|
||||||
if (this.moduleIds.length > 0) {
|
if (this.moduleIds.length > 0) {
|
||||||
simpleRequest.moduleIds = this.moduleIds;
|
simpleRequest.moduleIds = this.moduleIds;
|
||||||
|
} else {
|
||||||
|
simpleRequest.moduleIds = [];
|
||||||
}
|
}
|
||||||
|
simpleRequest.trashEnable = this.trashEnable;
|
||||||
|
|
||||||
let simpleInfoUrl = "/api/document/selectApiSimpleInfo";
|
let simpleInfoUrl = "/api/document/selectApiSimpleInfo";
|
||||||
this.apiInfoArray = [];
|
this.apiInfoArray = [];
|
||||||
|
@ -533,9 +543,6 @@ export default {
|
||||||
//检查数据
|
//检查数据
|
||||||
this.checkApiInfoNode(this.apiStepIndex,true);
|
this.checkApiInfoNode(this.apiStepIndex,true);
|
||||||
},
|
},
|
||||||
stepClick(stepIndex) {
|
|
||||||
this.apiStepIndex = stepIndex;
|
|
||||||
},
|
|
||||||
getColor(enable, method) {
|
getColor(enable, method) {
|
||||||
return this.methodColorMap.get(method);
|
return this.methodColorMap.get(method);
|
||||||
},
|
},
|
||||||
|
@ -642,8 +649,6 @@ export default {
|
||||||
for(let i = 0;i<this.apiShowArray.length;i++){
|
for(let i = 0;i<this.apiShowArray.length;i++){
|
||||||
names += this.apiShowArray[i].name+";";
|
names += this.apiShowArray[i].name+";";
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("["+apiDocDivScrollTop+":"+this.apiStepIndex+"]:["+lastIndex+":"+this.currentApiIndexInApiShowArray+"]-------->"+names);
|
|
||||||
if(lastIndex < this.currentApiIndexInApiShowArray){
|
if(lastIndex < this.currentApiIndexInApiShowArray){
|
||||||
//上移
|
//上移
|
||||||
if(this.needAsyncSelect){
|
if(this.needAsyncSelect){
|
||||||
|
@ -684,10 +689,6 @@ export default {
|
||||||
}
|
}
|
||||||
this.apiStepIndex ++;
|
this.apiStepIndex ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.apiStepIndex = lastIndex;
|
|
||||||
// //检查上下文 2个以内的节点有没有查询出来
|
|
||||||
// this.checkApiInfoNode(this.apiStepIndex);
|
|
||||||
},
|
},
|
||||||
redirectScroll(){
|
redirectScroll(){
|
||||||
//滚动条跳转:将滚动条下拉到显示对应对api接口的位置
|
//滚动条跳转:将滚动条下拉到显示对应对api接口的位置
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- <api-document-item :project-id="projectId" :module-ids="moduleIds"/>-->
|
<!-- <api-document-item :project-id="projectId" :module-ids="moduleIds"/>-->
|
||||||
<api-document-anchor :is-share-page="isSharePage" :project-id="projectId" :module-ids="moduleIds"></api-document-anchor>
|
<api-document-anchor :is-share-page="isSharePage" :trash-enable="trashEnable" :project-id="projectId" :module-ids="moduleIds"></api-document-anchor>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ export default {
|
||||||
projectId:String,
|
projectId:String,
|
||||||
moduleIds:Array,
|
moduleIds:Array,
|
||||||
activeDom:String,
|
activeDom:String,
|
||||||
|
trashEnable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
},
|
},
|
||||||
|
|
|
@ -43,16 +43,6 @@ export default {
|
||||||
name: "ApiReportView",
|
name: "ApiReportView",
|
||||||
component: () => import('@/business/components/api/report/ApiReportView'),
|
component: () => import('@/business/components/api/report/ApiReportView'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "definition/:redirectID?/:dataType?/:dataSelectRange?",
|
|
||||||
name: "ApiDefinition",
|
|
||||||
component: () => import('@/business/components/api/definition/ApiDefinition'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "automation/:redirectID?/:dataType?/:dataSelectRange?",
|
|
||||||
name: "ApiAutomation",
|
|
||||||
component: () => import('@/business/components/api/automation/ApiAutomation'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "automation/report",
|
path: "automation/report",
|
||||||
name: "ApiReportList",
|
name: "ApiReportList",
|
||||||
|
@ -64,6 +54,16 @@ export default {
|
||||||
component: () => import('@/business/components/api/automation/report/ApiReportView'),
|
component: () => import('@/business/components/api/automation/report/ApiReportView'),
|
||||||
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "definition/:redirectID?/:dataType?/:dataSelectRange?",
|
||||||
|
name: "ApiDefinition",
|
||||||
|
component: () => import('@/business/components/api/definition/ApiDefinition'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "automation/:redirectID?/:dataType?/:dataSelectRange?",
|
||||||
|
name: "ApiAutomation",
|
||||||
|
component: () => import('@/business/components/api/automation/ApiAutomation'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'monitor/view',
|
path: 'monitor/view',
|
||||||
name: 'ApiMonitor',
|
name: 'ApiMonitor',
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2115bd28a90854d2b6276a90878934715498c584
|
Subproject commit 07951ba17aef6f29e50cfd68e40de3266f9a60cd
|
Loading…
Reference in New Issue