Merge branch 'main' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
8cfb1c68f6
|
@ -0,0 +1,15 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ApiReportEnvConfigUtil {
|
||||
|
||||
private String envName;
|
||||
|
||||
private String resourcePoolName;
|
||||
|
||||
|
||||
}
|
|
@ -41,4 +41,7 @@ public class ApiScenarioReportDTO {
|
|||
//<项目名称,<环境名称>>
|
||||
private LinkedHashMap<String, List<String>> projectEnvMap;
|
||||
|
||||
private String mode;
|
||||
private String poolName;
|
||||
|
||||
}
|
||||
|
|
|
@ -385,6 +385,7 @@ public class ApiScenarioExecuteService {
|
|||
configDTO.setEnvMap(request.getEnvironmentMap());
|
||||
request.setConfig(configDTO);
|
||||
}
|
||||
request.getConfig().setEnvMap(request.getEnvironmentMap());
|
||||
// 生成调试结果
|
||||
ApiScenarioReportResult report = apiScenarioReportService.initDebugResult(request);
|
||||
ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(request.getScenarioId());
|
||||
|
|
|
@ -162,6 +162,8 @@ public class ApiDefinitionService {
|
|||
private ApiScenarioMapper apiScenarioMapper;
|
||||
@Resource
|
||||
private JMeterService jMeterService;
|
||||
@Resource
|
||||
private BaseTestResourcePoolService baseTestResourcePoolService;
|
||||
|
||||
private final ThreadLocal<Long> currentApiOrder = new ThreadLocal<>();
|
||||
private final ThreadLocal<Long> currentApiCaseOrder = new ThreadLocal<>();
|
||||
|
@ -1573,7 +1575,11 @@ public class ApiDefinitionService {
|
|||
if (StringUtils.isNotBlank(contentStr)) {
|
||||
JSONObject content = JSONUtil.parseObject(contentStr);
|
||||
if (StringUtils.isNotEmpty(result.getEnvConfig())) {
|
||||
content.put("envName", this.getEnvNameByEnvConfig(result.getProjectId(), result.getEnvConfig()));
|
||||
ApiReportEnvConfigUtil envNameByEnvConfig = this.getEnvNameByEnvConfig(result.getProjectId(), result.getEnvConfig());
|
||||
if (envNameByEnvConfig != null) {
|
||||
content.put("envName", envNameByEnvConfig.getEnvName());
|
||||
content.put("poolName", envNameByEnvConfig.getResourcePoolName());
|
||||
}
|
||||
}
|
||||
contentStr = content.toString();
|
||||
reportResult.setContent(contentStr);
|
||||
|
@ -1584,9 +1590,8 @@ public class ApiDefinitionService {
|
|||
return reportResult;
|
||||
}
|
||||
|
||||
|
||||
public String getEnvNameByEnvConfig(String projectId, String envConfig) {
|
||||
String envName = null;
|
||||
public ApiReportEnvConfigUtil getEnvNameByEnvConfig(String projectId, String envConfig) {
|
||||
ApiReportEnvConfigUtil apiReportEnvConfig = new ApiReportEnvConfigUtil();
|
||||
RunModeConfigDTO runModeConfigDTO = null;
|
||||
try {
|
||||
runModeConfigDTO = JSON.parseObject(envConfig, RunModeConfigDTO.class);
|
||||
|
@ -1595,9 +1600,17 @@ public class ApiDefinitionService {
|
|||
}
|
||||
if (StringUtils.isNotEmpty(projectId) && runModeConfigDTO != null && MapUtils.isNotEmpty(runModeConfigDTO.getEnvMap())) {
|
||||
String envId = runModeConfigDTO.getEnvMap().get(projectId);
|
||||
envName = apiTestEnvironmentService.selectNameById(envId);
|
||||
apiReportEnvConfig.setEnvName(apiTestEnvironmentService.selectNameById(envId));
|
||||
}
|
||||
return envName;
|
||||
if (runModeConfigDTO != null && StringUtils.isNotBlank(runModeConfigDTO.getResourcePoolId())) {
|
||||
TestResourcePool resourcePool = baseTestResourcePoolService.getResourcePool(runModeConfigDTO.getResourcePoolId());
|
||||
if (resourcePool != null) {
|
||||
apiReportEnvConfig.setResourcePoolName(resourcePool.getName());
|
||||
}
|
||||
} else {
|
||||
apiReportEnvConfig.setResourcePoolName("LOCAL");
|
||||
}
|
||||
return apiReportEnvConfig;
|
||||
}
|
||||
|
||||
public ApiReportResult getDbResult(String testId, String type) {
|
||||
|
@ -2785,8 +2798,10 @@ public class ApiDefinitionService {
|
|||
runModeConfigDTO.setEnvMap(new HashMap<>() {{
|
||||
this.put(request.getProjectId(), request.getEnvironmentId());
|
||||
}});
|
||||
runModeConfigDTO.setResourcePoolId(request.getConfig().getResourcePoolId());
|
||||
result.setEnvConfig(JSON.toJSONString(runModeConfigDTO));
|
||||
}
|
||||
result.setActuator(request.getConfig().getResourcePoolId());
|
||||
apiDefinitionExecResultMapper.insert(result);
|
||||
}
|
||||
if (request.isEditCaseRequest() && CollectionUtils.isNotEmpty(request.getTestElement().getHashTree()) && CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().get(0).getHashTree())) {
|
||||
|
|
|
@ -764,6 +764,16 @@ public class TestPlanApiCaseService {
|
|||
result.setName(reportName);
|
||||
result.setProjectId(apiCase.getProjectId());
|
||||
result.setTriggerMode(TriggerMode.MANUAL.name());
|
||||
RunModeConfigDTO runModeConfigDTO = new RunModeConfigDTO();
|
||||
jMeterService.verifyPool(result.getProjectId(), runModeConfigDTO);
|
||||
if (StringUtils.isNotEmpty(testPlanApiCase.getEnvironmentId())) {
|
||||
runModeConfigDTO.setEnvMap(new HashMap<>() {{
|
||||
this.put(result.getProjectId(), testPlanApiCase.getEnvironmentId());
|
||||
}});
|
||||
runModeConfigDTO.setResourcePoolId(runModeConfigDTO.getResourcePoolId());
|
||||
result.setEnvConfig(JSON.toJSONString(runModeConfigDTO));
|
||||
}
|
||||
result.setActuator(runModeConfigDTO.getResourcePoolId());
|
||||
apiDefinitionExecResultMapper.insert(result);
|
||||
apiCase.setId(testId);
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ public class ApiScenarioReportService {
|
|||
reportResult.setTestId(reportId);
|
||||
ApiScenarioReportDTO dto = apiScenarioReportStructureService.apiIntegratedReport(reportId);
|
||||
apiScenarioReportStructureService.initProjectEnvironmentByEnvConfig(dto, result.getEnvConfig());
|
||||
apiScenarioReportStructureService.getEnvConfig(dto, result.getEnvConfig());
|
||||
reportResult.setContent(JSON.toJSONString(dto));
|
||||
return reportResult;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ import io.metersphere.commons.enums.ApiReportStatus;
|
|||
import io.metersphere.commons.utils.*;
|
||||
import io.metersphere.constants.RunModeConstants;
|
||||
import io.metersphere.dto.RequestResult;
|
||||
import io.metersphere.dto.RunModeConfigDTO;
|
||||
import io.metersphere.service.BaseTestResourcePoolService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
|
@ -70,6 +72,8 @@ public class ApiScenarioReportStructureService {
|
|||
private ApiScenarioEnvService apiScenarioEnvService;
|
||||
@Resource
|
||||
private ApiScenarioReportMapper apiScenarioReportMapper;
|
||||
@Resource
|
||||
private BaseTestResourcePoolService baseTestResourcePoolService;
|
||||
|
||||
public void save(List<ApiScenarioWithBLOBs> apiScenarios, String reportId, String reportType) {
|
||||
List<StepTreeDTO> dtoList = new LinkedList<>();
|
||||
|
@ -500,6 +504,10 @@ public class ApiScenarioReportStructureService {
|
|||
dto.setName(report.getName());
|
||||
dto.setEnvConfig(report.getEnvConfig());
|
||||
this.initProjectEnvironmentByEnvConfig(dto, report.getEnvConfig());
|
||||
this.getEnvConfig(dto, report.getEnvConfig());
|
||||
if (report != null && report.getReportType().equals(ReportTypeConstants.SCENARIO_INDEPENDENT.name())) {
|
||||
dto.setMode(null);
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
@ -692,4 +700,24 @@ public class ApiScenarioReportStructureService {
|
|||
return (T) clazz.getInterfaces();
|
||||
}
|
||||
}
|
||||
|
||||
public void getEnvConfig(ApiScenarioReportDTO dto, String envConfig) {
|
||||
RunModeConfigDTO runModeConfigDTO = null;
|
||||
try {
|
||||
runModeConfigDTO = JSON.parseObject(envConfig, RunModeConfigDTO.class);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("解析" + envConfig + "为RunModeConfigDTO时失败!", e);
|
||||
}
|
||||
if (runModeConfigDTO != null && StringUtils.isNotBlank(runModeConfigDTO.getResourcePoolId())) {
|
||||
TestResourcePool resourcePool = baseTestResourcePoolService.getResourcePool(runModeConfigDTO.getResourcePoolId());
|
||||
if (resourcePool != null) {
|
||||
dto.setPoolName(resourcePool.getName());
|
||||
}
|
||||
} else {
|
||||
dto.setPoolName("LOCAL");
|
||||
}
|
||||
if (runModeConfigDTO != null && StringUtils.isNotBlank(runModeConfigDTO.getMode())) {
|
||||
dto.setMode(runModeConfigDTO.getMode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
:debug="debug"
|
||||
:report="report"
|
||||
:project-env-map="projectEnvMap"
|
||||
:mode="mode"
|
||||
:pool-name="poolName"
|
||||
@reportExport="handleExport"
|
||||
@reportSave="handleSave" />
|
||||
|
||||
|
@ -99,6 +101,8 @@
|
|||
:project-env-map="projectEnvMap"
|
||||
:title="report.name"
|
||||
:content="content"
|
||||
:mode="mode"
|
||||
:pool-name="poolName"
|
||||
:report="report"
|
||||
:total-time="totalTime" />
|
||||
</div>
|
||||
|
@ -163,6 +167,8 @@ export default {
|
|||
tempResult: [],
|
||||
projectEnvMap: {},
|
||||
showCancel: false,
|
||||
poolName: '',
|
||||
mode: '',
|
||||
};
|
||||
},
|
||||
activated() {
|
||||
|
@ -489,6 +495,10 @@ export default {
|
|||
if (report.projectEnvMap) {
|
||||
this.projectEnvMap = report.projectEnvMap;
|
||||
}
|
||||
if (report.poolName) {
|
||||
this.poolName = report.poolName;
|
||||
}
|
||||
this.mode = report.mode;
|
||||
this.fullTreeNodes = report.steps;
|
||||
this.content.console = report.console;
|
||||
this.content.error = report.error;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
:title="title"
|
||||
:report="report"
|
||||
:project-env-map="projectEnvMap"
|
||||
:pool-name="poolName"
|
||||
:mode="mode"
|
||||
:type="$t('report.api_test_report')">
|
||||
<ms-metric-chart :content="content" :is-export="true" :totalTime="totalTime" :report="report" />
|
||||
<div class="scenario-result" v-for="(scenario, index) in content.scenarios" :key="index" :scenario="scenario">
|
||||
|
@ -95,6 +97,8 @@ export default {
|
|||
totalTime: Number,
|
||||
projectEnvMap: {},
|
||||
title: String,
|
||||
poolName: String,
|
||||
mode: String,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
|
|
|
@ -81,7 +81,26 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="showProjectEnv" type="flex">
|
||||
<el-row type="flex" style="margin-top: 5px">
|
||||
<el-col v-if="this.mode">
|
||||
<div style="float: left">
|
||||
<span> {{ $t('report.run_model') + ':' }} </span>
|
||||
</div>
|
||||
<div style="color: #61c550; margin-left: 10px; float: left">
|
||||
{{ getModeName(this.mode) }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col v-if="this.poolName">
|
||||
<div style="float: left">
|
||||
<span> {{ $t('load_test.select_resource_pool') + ':' }} </span>
|
||||
</div>
|
||||
<div style="color: #61c550; margin-left: 10px; float: left">
|
||||
{{ this.poolName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row v-if="showProjectEnv" type="flex" style="margin-top: 5px">
|
||||
<span> {{ $t('commons.environment') + ':' }} </span>
|
||||
<div v-for="(values, key) in projectEnvMap" :key="key" style="margin-right: 10px">
|
||||
{{ key + ':' }}
|
||||
|
@ -121,6 +140,8 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
isPlan: Boolean,
|
||||
poolName: String,
|
||||
mode: String,
|
||||
},
|
||||
computed: {
|
||||
showProjectEnv() {
|
||||
|
@ -235,6 +256,14 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getModeName(mode) {
|
||||
switch (mode) {
|
||||
case 'serial':
|
||||
return this.$t('run_mode.serial');
|
||||
case 'parallel':
|
||||
return this.$t('run_mode.parallel');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="scenario-div" v-loading="result">
|
||||
<el-card class="scenario-div" v-loading="result">
|
||||
<slot name="version"></slot>
|
||||
<ms-search :condition.sync="condition" :base-search-tip="$t('commons.search_by_id_name_tag')" @search="search">
|
||||
</ms-search>
|
||||
|
@ -369,7 +369,7 @@
|
|||
ref="apiDeleteConfirm" />
|
||||
<!-- 引用场景弹窗 -->
|
||||
<ms-show-reference ref="viewRef" @showCaseRef="showScenarioRef" @openScenario="openScenario" />
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -522,7 +522,7 @@ export default {
|
|||
type: API_SCENARIO_LIST,
|
||||
fields: getCustomTableHeader('API_SCENARIO', undefined),
|
||||
fieldsWidth: getCustomTableWidth('API_SCENARIO'),
|
||||
screenHeight: 'calc(100vh - 180px)', //屏幕高度,
|
||||
screenHeight: 'calc(100vh - 200px)', //屏幕高度,
|
||||
condition: {
|
||||
components: this.trashEnable ? API_SCENARIO_CONFIGS_TRASH : API_SCENARIO_CONFIGS,
|
||||
},
|
||||
|
|
|
@ -81,120 +81,121 @@
|
|||
|
||||
<!-- 右侧部分 -->
|
||||
<ms-main-container style="overflow: hidden" class="ms-scenario-main-container">
|
||||
<!-- header 调试部分 -->
|
||||
<div class="ms-debug-div" @click="showAll" ref="debugHeader">
|
||||
<el-row style="margin: 5px">
|
||||
<el-col :span="1" class="ms-col-one ms-font" v-show="scenarioDefinition.length > 1">
|
||||
<el-tooltip
|
||||
:content="$t('test_track.case.batch_operate')"
|
||||
placement="top"
|
||||
effect="light"
|
||||
v-show="!isBatchProcess">
|
||||
<font-awesome-icon
|
||||
class="ms-batch-btn"
|
||||
:icon="['fa', 'bars']"
|
||||
v-prevent-re-click
|
||||
@click="batchProcessing" />
|
||||
</el-tooltip>
|
||||
<el-checkbox v-show="isBatchProcess" v-model="isCheckedAll" @change="checkedAll" />
|
||||
<el-tooltip :content="$t('commons.cancel')" placement="top" effect="light" v-show="isBatchProcess">
|
||||
<font-awesome-icon
|
||||
class="ms-batch-btn"
|
||||
:icon="['fa', 'times']"
|
||||
v-prevent-re-click
|
||||
@click="cancelBatchProcessing" />
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
{{ $t('api_test.automation.step_total') }}:{{ scenarioDefinition.length }}
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
<el-link class="head" @click="showScenarioParameters"
|
||||
<el-card>
|
||||
<!-- header 调试部分 -->
|
||||
<div class="ms-debug-div" @click="showAll" ref="debugHeader">
|
||||
<el-row style="margin: 5px">
|
||||
<el-col :span="1" class="ms-col-one ms-font" v-show="scenarioDefinition.length > 1">
|
||||
<el-tooltip
|
||||
:content="$t('test_track.case.batch_operate')"
|
||||
placement="top"
|
||||
effect="light"
|
||||
v-show="!isBatchProcess">
|
||||
<font-awesome-icon
|
||||
class="ms-batch-btn"
|
||||
:icon="['fa', 'bars']"
|
||||
v-prevent-re-click
|
||||
@click="batchProcessing" />
|
||||
</el-tooltip>
|
||||
<el-checkbox v-show="isBatchProcess" v-model="isCheckedAll" @change="checkedAll" />
|
||||
<el-tooltip :content="$t('commons.cancel')" placement="top" effect="light" v-show="isBatchProcess">
|
||||
<font-awesome-icon
|
||||
class="ms-batch-btn"
|
||||
:icon="['fa', 'times']"
|
||||
v-prevent-re-click
|
||||
@click="cancelBatchProcessing" />
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
{{ $t('api_test.automation.step_total') }}:{{ scenarioDefinition.length }}
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
<el-link class="head" @click="showScenarioParameters"
|
||||
>{{ $t('api_test.automation.scenario_total') }}
|
||||
</el-link>
|
||||
:{{ getVariableSize() }}
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
<el-checkbox v-model="enableCookieShare">
|
||||
<span style="font-size: 13px">{{ $t('api_test.scenario.share_cookie') }}</span>
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="3" class="ms-col-one ms-font">
|
||||
<el-checkbox v-model="onSampleError">
|
||||
<span style="font-size: 13px">{{ $t('commons.failure_continues') }}</span>
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
</el-link>
|
||||
:{{ getVariableSize() }}
|
||||
</el-col>
|
||||
<el-col :span="2" class="ms-col-one ms-font">
|
||||
<el-checkbox v-model="enableCookieShare">
|
||||
<span style="font-size: 13px">{{ $t('api_test.scenario.share_cookie') }}</span>
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="3" class="ms-col-one ms-font">
|
||||
<el-checkbox v-model="onSampleError">
|
||||
<span style="font-size: 13px">{{ $t('commons.failure_continues') }}</span>
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="13">
|
||||
<env-popover
|
||||
:disabled="scenarioDefinition.length < 1"
|
||||
:env-map="projectEnvMap"
|
||||
:project-ids="projectIds"
|
||||
:result="envResult"
|
||||
:environment-type.sync="environmentType"
|
||||
:isReadOnly="scenarioDefinition.length < 1"
|
||||
:group-id="envGroupId"
|
||||
:project-list="projectList"
|
||||
:show-config-button-with-out-permission="showConfigButtonWithOutPermission"
|
||||
@setProjectEnvMap="setProjectEnvMap"
|
||||
@setEnvGroup="setEnvGroup"
|
||||
@showPopover="showPopover"
|
||||
:has-option-group="true"
|
||||
ref="envPopover"
|
||||
class="ms-message-right" />
|
||||
<el-tooltip v-if="!debugLoading" content="Ctrl + R" placement="top">
|
||||
<el-dropdown
|
||||
split-button
|
||||
type="primary"
|
||||
@click="runDebug"
|
||||
class="ms-message-right"
|
||||
size="mini"
|
||||
@command="handleCommand"
|
||||
v-permission="[
|
||||
<el-col :span="13">
|
||||
<env-popover
|
||||
:disabled="scenarioDefinition.length < 1"
|
||||
:env-map="projectEnvMap"
|
||||
:project-ids="projectIds"
|
||||
:result="envResult"
|
||||
:environment-type.sync="environmentType"
|
||||
:isReadOnly="scenarioDefinition.length < 1"
|
||||
:group-id="envGroupId"
|
||||
:project-list="projectList"
|
||||
:show-config-button-with-out-permission="showConfigButtonWithOutPermission"
|
||||
@setProjectEnvMap="setProjectEnvMap"
|
||||
@setEnvGroup="setEnvGroup"
|
||||
@showPopover="showPopover"
|
||||
:has-option-group="true"
|
||||
ref="envPopover"
|
||||
class="ms-message-right" />
|
||||
<el-tooltip v-if="!debugLoading" content="Ctrl + R" placement="top">
|
||||
<el-dropdown
|
||||
split-button
|
||||
type="primary"
|
||||
@click="runDebug"
|
||||
class="ms-message-right"
|
||||
size="mini"
|
||||
@command="handleCommand"
|
||||
v-permission="[
|
||||
'PROJECT_API_SCENARIO:READ+EDIT',
|
||||
'PROJECT_API_SCENARIO:READ+CREATE',
|
||||
'PROJECT_API_SCENARIO:READ+COPY',
|
||||
]">
|
||||
{{ $t('api_test.request.debug') }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-tooltip>
|
||||
<el-button size="mini" type="primary" v-else @click="stop">{{ $t('report.stop_btn') }}</el-button>
|
||||
{{ $t('api_test.request.debug') }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-tooltip>
|
||||
<el-button size="mini" type="primary" v-else @click="stop">{{ $t('report.stop_btn') }}</el-button>
|
||||
|
||||
<el-button
|
||||
id="inputDelay"
|
||||
type="primary"
|
||||
size="mini"
|
||||
v-prevent-re-click
|
||||
@click="editScenario"
|
||||
title="ctrl + s"
|
||||
v-permission="[
|
||||
<el-button
|
||||
id="inputDelay"
|
||||
type="primary"
|
||||
size="mini"
|
||||
v-prevent-re-click
|
||||
@click="editScenario"
|
||||
title="ctrl + s"
|
||||
v-permission="[
|
||||
'PROJECT_API_SCENARIO:READ+EDIT',
|
||||
'PROJECT_API_SCENARIO:READ+CREATE',
|
||||
'PROJECT_API_SCENARIO:READ+COPY',
|
||||
]">
|
||||
{{ $t('commons.save') }}
|
||||
</el-button>
|
||||
{{ $t('commons.save') }}
|
||||
</el-button>
|
||||
|
||||
<el-tooltip class="item" effect="dark" :content="$t('commons.refresh')" placement="top-start">
|
||||
<el-button
|
||||
:disabled="scenarioDefinition.length < 1"
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
v-prevent-re-click
|
||||
@click="refreshApiScenario"></el-button>
|
||||
</el-tooltip>
|
||||
<!--操作按钮-->
|
||||
<el-link type="primary" @click.stop @click="showHistory" style="margin: 0px 5px">
|
||||
{{ $t('commons.debug_history') }}
|
||||
</el-link>
|
||||
<el-tooltip class="item" effect="dark" :content="$t('commons.refresh')" placement="top-start">
|
||||
<el-button
|
||||
:disabled="scenarioDefinition.length < 1"
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
v-prevent-re-click
|
||||
@click="refreshApiScenario"></el-button>
|
||||
</el-tooltip>
|
||||
<!--操作按钮-->
|
||||
<el-link type="primary" @click.stop @click="showHistory" style="margin: 0px 5px">
|
||||
{{ $t('commons.debug_history') }}
|
||||
</el-link>
|
||||
|
||||
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-show="!showFollow">
|
||||
<i
|
||||
class="el-icon-star-off"
|
||||
style="
|
||||
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-show="!showFollow">
|
||||
<i
|
||||
class="el-icon-star-off"
|
||||
style="
|
||||
color: var(--primary_color);
|
||||
font-size: 22px;
|
||||
margin-right: 5px;
|
||||
|
@ -202,12 +203,12 @@
|
|||
position: relative;
|
||||
top: 3px;
|
||||
"
|
||||
@click="saveFollow" />
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-show="showFollow">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
@click="saveFollow" />
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-show="showFollow">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
color: var(--primary_color);
|
||||
font-size: 22px;
|
||||
margin-right: 5px;
|
||||
|
@ -215,81 +216,81 @@
|
|||
position: relative;
|
||||
top: 3px;
|
||||
"
|
||||
@click="saveFollow" />
|
||||
</el-tooltip>
|
||||
<el-link
|
||||
type="primary"
|
||||
style="margin-right: 5px"
|
||||
@click="openHis"
|
||||
v-show="path === '/api/automation/update'"
|
||||
@click="saveFollow" />
|
||||
</el-tooltip>
|
||||
<el-link
|
||||
type="primary"
|
||||
style="margin-right: 5px"
|
||||
@click="openHis"
|
||||
v-show="path === '/api/automation/update'"
|
||||
>{{ $t('operating_log.change_history') }}
|
||||
</el-link>
|
||||
<!-- 版本历史 -->
|
||||
<mx-version-history
|
||||
v-xpack
|
||||
ref="versionHistory"
|
||||
:version-data="versionData"
|
||||
:current-id="currentScenario.id"
|
||||
@compare="compare"
|
||||
@checkout="checkout"
|
||||
@create="create"
|
||||
@del="del" />
|
||||
</el-col>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="$t('commons.full_screen_editing')"
|
||||
placement="top-start"
|
||||
style="margin-top: 6px">
|
||||
<font-awesome-icon class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen" />
|
||||
</el-tooltip>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-link>
|
||||
<!-- 版本历史 -->
|
||||
<mx-version-history
|
||||
v-xpack
|
||||
ref="versionHistory"
|
||||
:version-data="versionData"
|
||||
:current-id="currentScenario.id"
|
||||
@compare="compare"
|
||||
@checkout="checkout"
|
||||
@create="create"
|
||||
@del="del" />
|
||||
</el-col>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="$t('commons.full_screen_editing')"
|
||||
placement="top-start"
|
||||
style="margin-top: 6px">
|
||||
<font-awesome-icon class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen" />
|
||||
</el-tooltip>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="card-content">
|
||||
<!-- 场景步骤-->
|
||||
<div v-loading="loading">
|
||||
<el-row>
|
||||
<el-col :span="21">
|
||||
<div class="ms-debug-result" v-show="debug">
|
||||
<span class="ms-message-right"> {{ reqTotalTime }} ms </span>
|
||||
<span class="ms-message-right">{{ $t('api_test.automation.request_total') }} {{ reqTotal }}</span>
|
||||
<span class="ms-message-right">{{ $t('api_test.automation.request_success') }} {{ reqSuccess }}</span>
|
||||
<span class="ms-message-right">
|
||||
<div class="card-content">
|
||||
<!-- 场景步骤-->
|
||||
<div v-loading="loading">
|
||||
<el-row>
|
||||
<el-col :span="21">
|
||||
<div class="ms-debug-result" v-show="debug">
|
||||
<span class="ms-message-right"> {{ reqTotalTime }} ms </span>
|
||||
<span class="ms-message-right">{{ $t('api_test.automation.request_total') }} {{ reqTotal }}</span>
|
||||
<span class="ms-message-right">{{ $t('api_test.automation.request_success') }} {{ reqSuccess }}</span>
|
||||
<span class="ms-message-right">
|
||||
{{ $t('api_test.automation.request_error') }}
|
||||
{{ reqError }}</span
|
||||
>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="21">
|
||||
<!-- 场景步骤内容 -->
|
||||
<div ref="stepInfo">
|
||||
<el-tree
|
||||
node-key="resourceId"
|
||||
:props="props"
|
||||
:data="scenarioDefinition"
|
||||
class="ms-tree"
|
||||
:expand-on-click-node="false"
|
||||
:allow-drop="allowDrop"
|
||||
:allow-drag="allowDrag"
|
||||
:empty-text="$t('api_test.scenario.step_info')"
|
||||
highlight-current
|
||||
:show-checkbox="isBatchProcess"
|
||||
@check-change="chooseHeadsUp"
|
||||
@node-drag-end="nodeDragEnd"
|
||||
@node-click="nodeClick"
|
||||
draggable
|
||||
ref="stepTree"
|
||||
:key="reloadTree">
|
||||
<el-row
|
||||
class="custom-tree-node"
|
||||
:gutter="10"
|
||||
type="flex"
|
||||
align="middle"
|
||||
slot-scope="{ node, data }"
|
||||
style="width: 100%">
|
||||
>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="21">
|
||||
<!-- 场景步骤内容 -->
|
||||
<div ref="stepInfo">
|
||||
<el-tree
|
||||
node-key="resourceId"
|
||||
:props="props"
|
||||
:data="scenarioDefinition"
|
||||
class="ms-tree"
|
||||
:expand-on-click-node="false"
|
||||
:allow-drop="allowDrop"
|
||||
:allow-drag="allowDrag"
|
||||
:empty-text="$t('api_test.scenario.step_info')"
|
||||
highlight-current
|
||||
:show-checkbox="isBatchProcess"
|
||||
@check-change="chooseHeadsUp"
|
||||
@node-drag-end="nodeDragEnd"
|
||||
@node-click="nodeClick"
|
||||
draggable
|
||||
ref="stepTree"
|
||||
:key="reloadTree">
|
||||
<el-row
|
||||
class="custom-tree-node"
|
||||
:gutter="10"
|
||||
type="flex"
|
||||
align="middle"
|
||||
slot-scope="{ node, data }"
|
||||
style="width: 100%">
|
||||
<span
|
||||
class="custom-tree-node-col"
|
||||
style="padding-left: 0px; padding-right: 0px"
|
||||
|
@ -303,11 +304,11 @@
|
|||
class="el-icon-remove-outline custom-node_e"
|
||||
@click="openOrClose(node, data)" />
|
||||
</span>
|
||||
<!-- 批量操作 -->
|
||||
<span
|
||||
:class="data.checkBox ? 'custom-tree-node-hide' : 'custom-tree-node-col'"
|
||||
style="padding-left: 0px; padding-right: 0px"
|
||||
v-show="(data.hashTree && data.hashTree.length === 0) || data.isLeaf">
|
||||
<!-- 批量操作 -->
|
||||
<span
|
||||
:class="data.checkBox ? 'custom-tree-node-hide' : 'custom-tree-node-col'"
|
||||
style="padding-left: 0px; padding-right: 0px"
|
||||
v-show="(data.hashTree && data.hashTree.length === 0) || data.isLeaf">
|
||||
<show-more-btn
|
||||
:is-show="node.checked"
|
||||
:buttons="batchOperators"
|
||||
|
@ -315,7 +316,7 @@
|
|||
v-show="data.checkBox"
|
||||
style="margin-right: 10px" />
|
||||
</span>
|
||||
<span style="width: calc(100% - 40px)">
|
||||
<span style="width: calc(100% - 40px)">
|
||||
<!-- 步骤组件-->
|
||||
<ms-component-config
|
||||
:scenario-definition="scenarioDefinition"
|
||||
|
@ -349,194 +350,195 @@
|
|||
{{ hideNode(node) }}
|
||||
</div>
|
||||
</span>
|
||||
</el-row>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 按钮列表 -->
|
||||
<el-col :span="3">
|
||||
<div
|
||||
@click="fabClick"
|
||||
v-permission="['PROJECT_API_SCENARIO:READ+EDIT', 'PROJECT_API_SCENARIO:READ+CREATE']">
|
||||
<vue-fab
|
||||
id="fab"
|
||||
mainBtnColor="#783887"
|
||||
size="small"
|
||||
:global-options="globalOptions"
|
||||
:click-auto-close="false"
|
||||
v-outside-click="outsideClick"
|
||||
ref="refFab">
|
||||
<fab-item
|
||||
v-for="(item, index) in buttonData"
|
||||
:key="index"
|
||||
:idx="getIdx(index)"
|
||||
:title="item.title"
|
||||
:title-bg-color="item.titleBgColor"
|
||||
:title-color="item.titleColor"
|
||||
:color="item.titleColor"
|
||||
:icon="item.icon"
|
||||
@clickItem="item.click" />
|
||||
</vue-fab>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 按钮列表 -->
|
||||
<el-col :span="3">
|
||||
<div
|
||||
@click="fabClick"
|
||||
v-permission="['PROJECT_API_SCENARIO:READ+EDIT', 'PROJECT_API_SCENARIO:READ+CREATE']">
|
||||
<vue-fab
|
||||
id="fab"
|
||||
mainBtnColor="#783887"
|
||||
size="small"
|
||||
:global-options="globalOptions"
|
||||
:click-auto-close="false"
|
||||
v-outside-click="outsideClick"
|
||||
ref="refFab">
|
||||
<fab-item
|
||||
v-for="(item, index) in buttonData"
|
||||
:key="index"
|
||||
:idx="getIdx(index)"
|
||||
:title="item.title"
|
||||
:title-bg-color="item.titleBgColor"
|
||||
:title-color="item.titleColor"
|
||||
:color="item.titleColor"
|
||||
:icon="item.icon"
|
||||
@clickItem="item.click" />
|
||||
</vue-fab>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!--参数设置-->
|
||||
<ms-api-variable-advance
|
||||
ref="scenarioVariableAdvance"
|
||||
:append-to-body="true"
|
||||
:current-item="currentItem"
|
||||
:variables="currentScenario.variables"
|
||||
:scenario-definition="scenarioDefinition" />
|
||||
<!--参数设置-->
|
||||
<ms-api-variable-advance
|
||||
ref="scenarioVariableAdvance"
|
||||
:append-to-body="true"
|
||||
:current-item="currentItem"
|
||||
:variables="currentScenario.variables"
|
||||
:scenario-definition="scenarioDefinition" />
|
||||
|
||||
<!--接口列表-->
|
||||
<scenario-api-relevance
|
||||
@save="pushApiOrCase"
|
||||
@close="setHideBtn"
|
||||
ref="scenarioApiRelevance"
|
||||
:is-across-space="true"
|
||||
v-if="type !== 'detail'" />
|
||||
<!--接口列表-->
|
||||
<scenario-api-relevance
|
||||
@save="pushApiOrCase"
|
||||
@close="setHideBtn"
|
||||
ref="scenarioApiRelevance"
|
||||
:is-across-space="true"
|
||||
v-if="type !== 'detail'" />
|
||||
|
||||
<!--自定义接口-->
|
||||
<el-drawer
|
||||
v-if="type !== 'detail'"
|
||||
: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" />
|
||||
</el-drawer>
|
||||
<!--场景导入 -->
|
||||
<scenario-relevance
|
||||
v-if="type !== 'detail'"
|
||||
@save="addScenario"
|
||||
@close="setHideBtn"
|
||||
:is-across-space="true"
|
||||
ref="scenarioRelevance" />
|
||||
<!--自定义接口-->
|
||||
<el-drawer
|
||||
v-if="type !== 'detail'"
|
||||
: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" />
|
||||
</el-drawer>
|
||||
<!--场景导入 -->
|
||||
<scenario-relevance
|
||||
v-if="type !== 'detail'"
|
||||
@save="addScenario"
|
||||
@close="setHideBtn"
|
||||
:is-across-space="true"
|
||||
ref="scenarioRelevance" />
|
||||
|
||||
<!-- 环境 -->
|
||||
<api-environment-config v-if="type !== 'detail'" ref="environmentConfig" @close="environmentConfigClose" />
|
||||
<!-- 环境 -->
|
||||
<api-environment-config v-if="type !== 'detail'" ref="environmentConfig" @close="environmentConfigClose" />
|
||||
|
||||
<!--执行组件-->
|
||||
<ms-run
|
||||
:debug="true"
|
||||
v-if="type !== 'detail'"
|
||||
:environment="projectEnvMap"
|
||||
:reportId="reportId"
|
||||
:saved="saved"
|
||||
:run-data="debugData"
|
||||
:environment-type="environmentType"
|
||||
:environment-group-id="envGroupId"
|
||||
:executeType="executeType"
|
||||
@runRefresh="runRefresh"
|
||||
@errorRefresh="errorRefresh"
|
||||
ref="runTest" />
|
||||
<!-- 调试结果 -->
|
||||
<el-drawer
|
||||
v-if="type !== 'detail'"
|
||||
:visible.sync="debugVisible"
|
||||
:destroy-on-close="true"
|
||||
direction="ltr"
|
||||
:withHeader="true"
|
||||
:modal="false"
|
||||
size="80%">
|
||||
<ms-api-report-detail
|
||||
:scenario="currentScenario"
|
||||
:report-id="reportId"
|
||||
<!--执行组件-->
|
||||
<ms-run
|
||||
:debug="true"
|
||||
:currentProjectId="projectId"
|
||||
@refresh="detailRefresh" />
|
||||
</el-drawer>
|
||||
v-if="type !== 'detail'"
|
||||
:environment="projectEnvMap"
|
||||
:reportId="reportId"
|
||||
:saved="saved"
|
||||
:run-data="debugData"
|
||||
:environment-type="environmentType"
|
||||
:environment-group-id="envGroupId"
|
||||
:executeType="executeType"
|
||||
@runRefresh="runRefresh"
|
||||
@errorRefresh="errorRefresh"
|
||||
ref="runTest" />
|
||||
<!-- 调试结果 -->
|
||||
<el-drawer
|
||||
v-if="type !== 'detail'"
|
||||
:visible.sync="debugVisible"
|
||||
:destroy-on-close="true"
|
||||
direction="ltr"
|
||||
:withHeader="true"
|
||||
:modal="false"
|
||||
size="80%">
|
||||
<ms-api-report-detail
|
||||
:scenario="currentScenario"
|
||||
:report-id="reportId"
|
||||
:debug="true"
|
||||
:currentProjectId="projectId"
|
||||
@refresh="detailRefresh" />
|
||||
</el-drawer>
|
||||
|
||||
<!--场景公共参数-->
|
||||
<ms-variable-list
|
||||
v-if="type !== 'detail'"
|
||||
@setVariables="setVariables"
|
||||
ref="scenarioParameters"
|
||||
class="ms-sc-variable-header" />
|
||||
<!--外部导入-->
|
||||
<api-import v-if="type !== 'detail'" ref="apiImport" :saved="false" @refresh="apiImport" />
|
||||
<!--场景公共参数-->
|
||||
<ms-variable-list
|
||||
v-if="type !== 'detail'"
|
||||
@setVariables="setVariables"
|
||||
ref="scenarioParameters"
|
||||
class="ms-sc-variable-header" />
|
||||
<!--外部导入-->
|
||||
<api-import v-if="type !== 'detail'" ref="apiImport" :saved="false" @refresh="apiImport" />
|
||||
|
||||
<!--步骤最大化-->
|
||||
<ms-drawer
|
||||
:visible="drawer"
|
||||
:size="100"
|
||||
@close="close"
|
||||
direction="default"
|
||||
:show-full-screen="false"
|
||||
:is-show-close="false"
|
||||
style="overflow: hidden"
|
||||
v-if="drawer">
|
||||
<maximize-scenario
|
||||
:scenario-definition="scenarioDefinition"
|
||||
:projectIds.sync="projectIds"
|
||||
:projectList="projectList"
|
||||
:envMap="projectEnvMap"
|
||||
:moduleOptions="moduleOptions"
|
||||
:req-error="reqError"
|
||||
:req-success="reqSuccess"
|
||||
:req-total="reqTotal"
|
||||
:req-total-time="reqTotalTime"
|
||||
:currentScenario="currentScenario"
|
||||
:type="type"
|
||||
:debug="debugLoading"
|
||||
:reloadDebug="reloadDebug"
|
||||
:stepReEnable="stepEnable"
|
||||
:message="message"
|
||||
:enable-cookie="enableCookieShare"
|
||||
:on-sample-error="onSampleError"
|
||||
@setEnvType="setEnvType"
|
||||
@envGroupId="setEnvGroup"
|
||||
@closePage="close"
|
||||
@unFullScreen="unFullScreen"
|
||||
@showAllBtn="showAllBtn"
|
||||
@runDebug="runDebug"
|
||||
@handleCommand="handleCommand"
|
||||
@setProjectEnvMap="setProjectEnvMap"
|
||||
@showScenarioParameters="showScenarioParameters"
|
||||
@setCookieShare="setCookieShare"
|
||||
@setSampleError="setSampleError"
|
||||
@stop="stop"
|
||||
@sort="sort"
|
||||
@openScenario="openScenario"
|
||||
@runScenario="runDebug"
|
||||
@stopScenario="stop"
|
||||
@editScenarioAdvance="editScenarioAdvance"
|
||||
ref="maximizeScenario" />
|
||||
</ms-drawer>
|
||||
<ms-change-history ref="changeHistory" />
|
||||
<el-backtop target=".card-content" :visibility-height="100" :right="20"></el-backtop>
|
||||
</div>
|
||||
<ms-task-center ref="taskCenter" :show-menu="false" />
|
||||
<!--步骤最大化-->
|
||||
<ms-drawer
|
||||
:visible="drawer"
|
||||
:size="100"
|
||||
@close="close"
|
||||
direction="default"
|
||||
:show-full-screen="false"
|
||||
:is-show-close="false"
|
||||
style="overflow: hidden"
|
||||
v-if="drawer">
|
||||
<maximize-scenario
|
||||
:scenario-definition="scenarioDefinition"
|
||||
:projectIds.sync="projectIds"
|
||||
:projectList="projectList"
|
||||
:envMap="projectEnvMap"
|
||||
:moduleOptions="moduleOptions"
|
||||
:req-error="reqError"
|
||||
:req-success="reqSuccess"
|
||||
:req-total="reqTotal"
|
||||
:req-total-time="reqTotalTime"
|
||||
:currentScenario="currentScenario"
|
||||
:type="type"
|
||||
:debug="debugLoading"
|
||||
:reloadDebug="reloadDebug"
|
||||
:stepReEnable="stepEnable"
|
||||
:message="message"
|
||||
:enable-cookie="enableCookieShare"
|
||||
:on-sample-error="onSampleError"
|
||||
@setEnvType="setEnvType"
|
||||
@envGroupId="setEnvGroup"
|
||||
@closePage="close"
|
||||
@unFullScreen="unFullScreen"
|
||||
@showAllBtn="showAllBtn"
|
||||
@runDebug="runDebug"
|
||||
@handleCommand="handleCommand"
|
||||
@setProjectEnvMap="setProjectEnvMap"
|
||||
@showScenarioParameters="showScenarioParameters"
|
||||
@setCookieShare="setCookieShare"
|
||||
@setSampleError="setSampleError"
|
||||
@stop="stop"
|
||||
@sort="sort"
|
||||
@openScenario="openScenario"
|
||||
@runScenario="runDebug"
|
||||
@stopScenario="stop"
|
||||
@editScenarioAdvance="editScenarioAdvance"
|
||||
ref="maximizeScenario" />
|
||||
</ms-drawer>
|
||||
<ms-change-history ref="changeHistory" />
|
||||
<el-backtop target=".card-content" :visibility-height="100" :right="20"></el-backtop>
|
||||
</div>
|
||||
<ms-task-center ref="taskCenter" :show-menu="false" />
|
||||
|
||||
<!--版本对比-->
|
||||
<el-dialog
|
||||
:fullscreen="true"
|
||||
:visible.sync="dialogVisible"
|
||||
:destroy-on-close="true"
|
||||
@close="closeDiff"
|
||||
width="100%">
|
||||
<scenario-diff
|
||||
v-if="dialogVisible"
|
||||
:custom-num="customNum"
|
||||
:currentScenarioId="currentScenario.id"
|
||||
:dffScenarioId="dffScenarioId"
|
||||
:scenarioRefId="scenarioRefId"
|
||||
:module-options="moduleOptions"
|
||||
:project-env-map="projectEnvMap"
|
||||
:old-enable-cookie-share="enableCookieShare"
|
||||
:old-on-sample-error="onSampleError"
|
||||
:project-list="projectList"
|
||||
:new-create-time="newCreateTime"
|
||||
:old-create-time="oldCreateTime"
|
||||
:old-user-name="oldUserName"
|
||||
:type="type" />
|
||||
</el-dialog>
|
||||
<!--版本对比-->
|
||||
<el-dialog
|
||||
:fullscreen="true"
|
||||
:visible.sync="dialogVisible"
|
||||
:destroy-on-close="true"
|
||||
@close="closeDiff"
|
||||
width="100%">
|
||||
<scenario-diff
|
||||
v-if="dialogVisible"
|
||||
:custom-num="customNum"
|
||||
:currentScenarioId="currentScenario.id"
|
||||
:dffScenarioId="dffScenarioId"
|
||||
:scenarioRefId="scenarioRefId"
|
||||
:module-options="moduleOptions"
|
||||
:project-env-map="projectEnvMap"
|
||||
:old-enable-cookie-share="enableCookieShare"
|
||||
:old-on-sample-error="onSampleError"
|
||||
:project-list="projectList"
|
||||
:new-create-time="newCreateTime"
|
||||
:old-create-time="oldCreateTime"
|
||||
:old-user-name="oldUserName"
|
||||
:type="type" />
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</ms-main-container>
|
||||
</ms-container>
|
||||
</template>
|
||||
|
@ -2544,7 +2546,7 @@ export default {
|
|||
|
||||
<style scoped>
|
||||
.card-content {
|
||||
height: calc(100vh - 160px);
|
||||
height: calc(100vh - 170px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
@ -2569,7 +2571,7 @@ export default {
|
|||
}
|
||||
|
||||
#fab {
|
||||
right: 60px;
|
||||
right: 70px;
|
||||
bottom: 120px;
|
||||
z-index: 5;
|
||||
}
|
||||
|
|
|
@ -54,13 +54,24 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" v-if="response && response.envName">
|
||||
<div style="font-size: 14px; color: #aaaaaa; float: left">
|
||||
<span> {{ $t('commons.environment') + ':' }} </span>
|
||||
</div>
|
||||
<div style="font-size: 14px; color: #61c550; margin-left: 10px; float: left">
|
||||
{{ response.envName }}
|
||||
</div>
|
||||
<el-row type="flex" style="margin-top: 5px">
|
||||
<el-col v-if="response && response.poolName">
|
||||
<div style="font-size: 14px; color: #aaaaaa; float: left">
|
||||
<span> {{ $t('load_test.select_resource_pool') + ':' }} </span>
|
||||
</div>
|
||||
<div style="font-size: 14px; color: #61c550; margin-left: 10px; float: left">
|
||||
{{ response.poolName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col type="flex" v-if="response && response.envName">
|
||||
<div style="font-size: 14px; color: #aaaaaa; float: left">
|
||||
<span> {{ $t('commons.environment') + ':' }} </span>
|
||||
</div>
|
||||
<div style="font-size: 14px; color: #61c550; margin-left: 10px; float: left">
|
||||
{{ response.envName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<template>
|
||||
<div class="report-export">
|
||||
<ms-report-title :title="title" :type="type" :report="report" :project-env-map="projectEnvMap"/>
|
||||
<ms-report-title
|
||||
:title="title"
|
||||
:type="type"
|
||||
:report="report"
|
||||
:project-env-map="projectEnvMap"
|
||||
:mode="mode"
|
||||
:pool-name="poolName"
|
||||
/>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -10,13 +17,19 @@ import MsReportTitle from "./MsReportTitle";
|
|||
|
||||
export default {
|
||||
name: "MsReportExportTemplate",
|
||||
components: {MsReportTitle},
|
||||
props: {title: String, type: String, report: Object, projectEnvMap: {}},
|
||||
}
|
||||
components: { MsReportTitle },
|
||||
props: {
|
||||
title: String,
|
||||
type: String,
|
||||
report: Object,
|
||||
projectEnvMap: {},
|
||||
mode: String,
|
||||
poolName: String,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.report-export {
|
||||
padding: 30px;
|
||||
}
|
||||
|
|
|
@ -5,23 +5,55 @@
|
|||
<div class="title">
|
||||
【{{ type }}】- {{ title }}
|
||||
<span v-if="report && (report.endTime || report.createTime)">
|
||||
<span style="margin-left: 10px">{{ $t('report.test_start_time') }}:</span>
|
||||
<span class="time"> {{ report.createTime | datetimeFormat }}</span>
|
||||
<span style="margin-left: 10px">{{ $t('report.test_end_time') }}:</span>
|
||||
<span class="time"> {{ report.endTime | datetimeFormat }}</span>
|
||||
</span>
|
||||
<span style="margin-left: 10px"
|
||||
>{{ $t("report.test_start_time") }}:</span
|
||||
>
|
||||
<span class="time"> {{ report.createTime | datetimeFormat }}</span>
|
||||
<span style="margin-left: 10px"
|
||||
>{{ $t("report.test_end_time") }}:</span
|
||||
>
|
||||
<span class="time"> {{ report.endTime | datetimeFormat }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-right">
|
||||
<img class="logo" src="/assets/logo-MeterSphere.png">
|
||||
<img class="logo" src="/assets/logo-MeterSphere.png" />
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row v-if="showProjectEnv" type="flex">
|
||||
<span> {{ $t('commons.environment') + ':' }} </span>
|
||||
<div v-for="(values,key) in projectEnvMap" :key="key" style="margin-right: 10px">
|
||||
<el-row type="flex" style="margin-top: 5px">
|
||||
<el-col v-if="this.mode">
|
||||
<div style="float: left">
|
||||
<span> {{ $t("report.run_model") + ":" }} </span>
|
||||
</div>
|
||||
<div style="color: #61c550; margin-left: 10px; float: left">
|
||||
{{ getModeName(this.mode) }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col v-if="this.poolName">
|
||||
<div style="float: left">
|
||||
<span> {{ $t("load_test.select_resource_pool") + ":" }} </span>
|
||||
</div>
|
||||
<div style="color: #61c550; margin-left: 10px; float: left">
|
||||
{{ this.poolName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row v-if="showProjectEnv" type="flex" style="margin-top: 5px">
|
||||
<span> {{ $t("commons.environment") + ":" }} </span>
|
||||
<div
|
||||
v-for="(values, key) in projectEnvMap"
|
||||
:key="key"
|
||||
style="margin-right: 10px"
|
||||
>
|
||||
{{ key + ":" }}
|
||||
<ms-tag v-for="(item,index) in values" :key="index" type="success" :content="item"
|
||||
style="margin-left: 2px"/>
|
||||
<ms-tag
|
||||
v-for="(item, index) in values"
|
||||
:key="index"
|
||||
type="success"
|
||||
:content="item"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -32,21 +64,37 @@ import MsTag from "../MsTag";
|
|||
|
||||
export default {
|
||||
name: "MsReportTitle",
|
||||
components: {MsTag},
|
||||
props: {title: String, type: String, report: Object, projectEnvMap: {}},
|
||||
components: { MsTag },
|
||||
props: {
|
||||
title: String,
|
||||
type: String,
|
||||
report: Object,
|
||||
projectEnvMap: {},
|
||||
mode: String,
|
||||
poolName: String,
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
showProjectEnv() {
|
||||
return this.projectEnvMap && JSON.stringify(this.projectEnvMap) !== '{}';
|
||||
return this.projectEnvMap && JSON.stringify(this.projectEnvMap) !== "{}";
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getModeName(mode) {
|
||||
switch (mode) {
|
||||
case "serial":
|
||||
return this.$t("run_mode.serial");
|
||||
case "parallel":
|
||||
return this.$t("run_mode.parallel");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.report-left {
|
||||
float: left;
|
||||
}
|
||||
|
@ -58,10 +106,9 @@ export default {
|
|||
.logo {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
vertical-align: middle
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
.report-left {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
@ -73,6 +120,4 @@ export default {
|
|||
.title {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
|
@ -63,6 +63,7 @@ const message = {
|
|||
current_project: 'Current Project',
|
||||
not_exist: "Not exist",
|
||||
name: 'Name',
|
||||
template_name: 'Template Name',
|
||||
description: 'Description',
|
||||
annotation: 'Annotation',
|
||||
clear: 'Clear',
|
||||
|
|
|
@ -62,6 +62,7 @@ const message = {
|
|||
current_project: '当前项目',
|
||||
not_exist: "不存在",
|
||||
name: '名称',
|
||||
template_name: '模板名称',
|
||||
description: '描述',
|
||||
annotation: '注释',
|
||||
clear: '清空',
|
||||
|
|
|
@ -62,6 +62,7 @@ const message = {
|
|||
current_project: '當前項目',
|
||||
not_exist: "不存在",
|
||||
name: '名稱',
|
||||
template_name: '模版名稱',
|
||||
description: '描述',
|
||||
annotation: '註釋',
|
||||
clear: '清空',
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -23,7 +23,7 @@
|
|||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<spring-security.version>5.7.5</spring-security.version>
|
||||
<dubbo.version>2.7.18</dubbo.version>
|
||||
<platform-plugin-sdk.version>1.1.0</platform-plugin-sdk.version>
|
||||
<platform-plugin-sdk.version>1.2.0</platform-plugin-sdk.version>
|
||||
<flyway.version>7.15.0</flyway.version>
|
||||
<shiro.version>1.10.1</shiro.version>
|
||||
<mssql-jdbc.version>7.4.1.jre8</mssql-jdbc.version>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<ms-form-divider :title="$t('test_track.plan_view.base_info')"/>
|
||||
|
||||
<el-form :model="form" :rules="rules" label-position="right" label-width="80px" size="small" ref="form">
|
||||
<el-form-item :label="$t('commons.name')" prop="name" :label-width="labelWidth">
|
||||
<el-form-item :label="$t('commons.template_name')" prop="name" :label-width="labelWidth">
|
||||
<el-input :disabled="isSystem" v-model="form.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
|
|
@ -210,6 +210,11 @@ public class IssuesController {
|
|||
return issuesService.getPlatformTransitions(request);
|
||||
}
|
||||
|
||||
@PostMapping("/platform/status")
|
||||
public List<PlatformStatusDTO> getPlatformStatus(@RequestBody PlatformIssueTypeRequest request) {
|
||||
return issuesService.getPlatformStatus(request);
|
||||
}
|
||||
|
||||
@GetMapping("/platform/option")
|
||||
public List<SelectOption> getPlatformOptions() {
|
||||
return platformPluginService.getPlatformOptions();
|
||||
|
|
|
@ -1449,16 +1449,45 @@ public class IssuesService {
|
|||
return extIssuesMapper.getIssues(request);
|
||||
}
|
||||
|
||||
public List<PlatformStatusDTO> getPlatformStatus(PlatformIssueTypeRequest request) {
|
||||
List<PlatformStatusDTO> platformStatusDTOS = new ArrayList<>();
|
||||
Project project = baseProjectService.getProjectById(request.getProjectId());
|
||||
String projectConfig = PlatformPluginService.getCompatibleProjectConfig(project);
|
||||
String platform = project.getPlatform();
|
||||
if (PlatformPluginService.isPluginPlatform(platform)) {
|
||||
return platformPluginService.getPlatform(platform)
|
||||
.getStatusList(projectConfig)
|
||||
.stream().map(item -> {
|
||||
// 全部插件化后简化
|
||||
PlatformStatusDTO platformStatusDTO = new PlatformStatusDTO();
|
||||
platformStatusDTO.setLabel(item.getLabel());
|
||||
platformStatusDTO.setValue(item.getValue());
|
||||
return platformStatusDTO;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
List<String> platforms = getPlatforms(project);
|
||||
if (CollectionUtils.isEmpty(platforms)) {
|
||||
return platformStatusDTOS;
|
||||
}
|
||||
|
||||
IssuesRequest issuesRequest = getDefaultIssueRequest(request.getProjectId(), request.getWorkspaceId());
|
||||
return IssueFactory.createPlatform(platform, issuesRequest).getTransitions(request.getPlatformKey());
|
||||
}
|
||||
}
|
||||
|
||||
public List<PlatformStatusDTO> getPlatformTransitions(PlatformIssueTypeRequest request) {
|
||||
List<PlatformStatusDTO> platformStatusDTOS = new ArrayList<>();
|
||||
|
||||
if (!StringUtils.isBlank(request.getPlatformKey())) {
|
||||
Project project = baseProjectService.getProjectById(request.getProjectId());
|
||||
String projectConfig = PlatformPluginService.getCompatibleProjectConfig(project);
|
||||
String platform = project.getPlatform();
|
||||
if (PlatformPluginService.isPluginPlatform(platform)) {
|
||||
return platformPluginService.getPlatform(platform)
|
||||
.getStatusList(request.getPlatformKey())
|
||||
.getTransitions(projectConfig, request.getPlatformKey())
|
||||
.stream().map(item -> {
|
||||
// 全部插件化后简化
|
||||
PlatformStatusDTO platformStatusDTO = new PlatformStatusDTO();
|
||||
platformStatusDTO.setLabel(item.getLabel());
|
||||
platformStatusDTO.setValue(item.getValue());
|
||||
|
|
|
@ -212,6 +212,10 @@ export function getPlatformStatus(param) {
|
|||
return post('/issues/platform/status', param);
|
||||
}
|
||||
|
||||
export function getPlatformTransitions(param) {
|
||||
return post('/issues/platform/transitions', param);
|
||||
}
|
||||
|
||||
export function enableThirdPartTemplate(projectId) {
|
||||
return get(BASE_URL + 'third/part/template/enable/' + projectId);
|
||||
}
|
||||
|
|
|
@ -200,13 +200,11 @@ import {hasLicense} from "metersphere-frontend/src/utils/permission";
|
|||
import {
|
||||
enableThirdPartTemplate,
|
||||
getIssuePartTemplateWithProject,
|
||||
getPlatformStatus,
|
||||
getIssuesById,
|
||||
saveOrUpdateIssue,
|
||||
saveFollow,
|
||||
getFollow,
|
||||
getComments,
|
||||
getTapdUser
|
||||
getTapdUser, getPlatformTransitions
|
||||
} from "@/api/issue";
|
||||
import {
|
||||
uploadIssueAttachment,
|
||||
|
@ -433,7 +431,7 @@ export default {
|
|||
projectId: getCurrentProjectID(),
|
||||
workspaceId: getCurrentWorkspaceId()
|
||||
}
|
||||
getPlatformStatus(data).then(response => {
|
||||
getPlatformTransitions(data).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
this.platformTransitions = response.data;
|
||||
}
|
||||
|
|
|
@ -65,15 +65,14 @@
|
|||
<template v-slot="scope">
|
||||
|
||||
<span v-if="item.id === 'platformStatus'">
|
||||
<span v-if="scope.row.platform ==='Zentao'">
|
||||
{{
|
||||
scope.row.platformStatus ? issueStatusMap[scope.row.platformStatus] : '--'
|
||||
}}
|
||||
<span v-if="scope.row.platform === 'Tapd'">
|
||||
{{ scope.row.platformStatus ? tapdIssueStatusMap[scope.row.platformStatus] : '--' }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="scope.row.platform ==='Tapd'">{{
|
||||
scope.row.platformStatus ? tapdIssueStatusMap[scope.row.platformStatus] : '--'
|
||||
}}
|
||||
<span v-else-if="scope.row.platform ==='Local'">
|
||||
{{ scope.row.platformStatus ? tapdIssueStatusMap[scope.row.platformStatus] : '--' }}
|
||||
</span>
|
||||
<span v-else-if="platformStatusMap && platformStatusMap.get(scope.row.platformStatus)">
|
||||
{{ platformStatusMap.get(scope.row.platformStatus) }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ scope.row.platformStatus ? scope.row.platformStatus : '--' }}
|
||||
|
@ -161,7 +160,7 @@ import {
|
|||
getIssues,
|
||||
syncIssues,
|
||||
deleteIssue,
|
||||
getIssuesById, batchDeleteIssue, getPlatformOption, syncAllIssues
|
||||
getIssuesById, batchDeleteIssue, getPlatformOption, syncAllIssues, getPlatformStatus
|
||||
} from "@/api/issue";
|
||||
import {
|
||||
getCustomFieldValue,
|
||||
|
@ -240,6 +239,8 @@ export default {
|
|||
loading: false,
|
||||
dataSelectRange: "",
|
||||
platformOptions: [],
|
||||
platformStatus: [],
|
||||
platformStatusMap: new Map(),
|
||||
hasLicense: false,
|
||||
columns: {
|
||||
num: {
|
||||
|
@ -303,6 +304,17 @@ export default {
|
|||
});
|
||||
|
||||
this.hasLicense = hasLicense();
|
||||
|
||||
getPlatformStatus( {
|
||||
projectId: getCurrentProjectID(),
|
||||
workspaceId: getCurrentWorkspaceId()
|
||||
}).then((r) => {
|
||||
this.platformStatus = r.data;
|
||||
this.platformStatusMap = new Map();
|
||||
this.platformStatus.forEach(item => {
|
||||
this.platformStatusMap.set(item.value, item.label);
|
||||
});
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
platformFilters() {
|
||||
|
|
Loading…
Reference in New Issue