feat(测试计划): 测试计划内批量执行用例时增加默认环境的展示方式
--story=1012486 --user=宋天阳 【货车之家】接口场景包含跨项目步骤时取消跨项目环境必选&测试计划关联接口、UI测试时取消运行环境必选 https://www.tapd.cn/55049933/s/1402102
This commit is contained in:
parent
87dd88209d
commit
2265199e37
|
@ -6,11 +6,11 @@
|
||||||
<el-form-item :label="$t('load_test.select_resource_pool')">
|
<el-form-item :label="$t('load_test.select_resource_pool')">
|
||||||
<el-select v-model="resourcePool" size="mini" @change="resourcePoolChange">
|
<el-select v-model="resourcePool" size="mini" @change="resourcePoolChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in resourcePools"
|
v-for="item in resourcePools"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:disabled="!item.performance"
|
:disabled="!item.performance"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -81,10 +81,10 @@
|
||||||
<el-form-item :label="$t('load_test.on_sample_error')">
|
<el-form-item :label="$t('load_test.on_sample_error')">
|
||||||
<el-select v-model="threadGroup.onSampleError" size="mini">
|
<el-select v-model="threadGroup.onSampleError" size="mini">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in onSampleErrors"
|
v-for="item in onSampleErrors"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -213,10 +213,10 @@
|
||||||
<el-select v-model="threadGroup.resourceNodeIndex" @change="specifyNodeChange(threadGroup)"
|
<el-select v-model="threadGroup.resourceNodeIndex" @change="specifyNodeChange(threadGroup)"
|
||||||
size="mini">
|
size="mini">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(node, index) in resourceNodes"
|
v-for="(node, index) in resourceNodes"
|
||||||
:key="node.ip"
|
:key="node.ip"
|
||||||
:label="node.ip"
|
:label="node.ip"
|
||||||
:value="index">
|
:value="index">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -283,7 +283,7 @@ const RATIOS = "ratios";
|
||||||
|
|
||||||
const hexToRgb = function (hex) {
|
const hexToRgb = function (hex) {
|
||||||
return 'rgb(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5))
|
return 'rgb(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5))
|
||||||
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
|
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -398,138 +398,139 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
getResourcePools() {
|
getResourcePools() {
|
||||||
getResourcePools(this.isShare)
|
getResourcePools(this.isShare)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.resourcePools = response.data;
|
this.resourcePools = response.data;
|
||||||
// 如果当前的资源池无效 设置 null
|
// 如果当前的资源池无效 设置 null
|
||||||
if (this.resourcePool) {
|
if (this.resourcePool) {
|
||||||
if (response.data.filter(p => p.id === this.resourcePool && p.performance).length === 0) {
|
if (response.data.filter(p => p.id === this.resourcePool && p.performance).length === 0) {
|
||||||
this.resourcePool = null;
|
this.resourcePool = null;
|
||||||
// 标记因资源池无效而将资源池ID置为null
|
// 标记因资源池无效而将资源池ID置为null
|
||||||
this.setPoolNull = true;
|
this.setPoolNull = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.resourcePoolChange();
|
this.resourcePoolChange();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getLoadConfig() {
|
getLoadConfig() {
|
||||||
|
this.loadIsOver = false;
|
||||||
getLoadConfig(this.testId, this.reportId, this.isShare)
|
getLoadConfig(this.testId, this.reportId, this.isShare)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
let data = JSON.parse(response.data);
|
let data = JSON.parse(response.data);
|
||||||
this.loadIsOver = false;
|
for (let i = 0; i < this.threadGroups.length; i++) {
|
||||||
for (let i = 0; i < this.threadGroups.length; i++) {
|
data[i].forEach(item => {
|
||||||
data[i].forEach(item => {
|
switch (item.key) {
|
||||||
switch (item.key) {
|
case TARGET_LEVEL:
|
||||||
case TARGET_LEVEL:
|
this.threadGroups[i].threadNumber = item.value;
|
||||||
this.threadGroups[i].threadNumber = item.value;
|
break;
|
||||||
break;
|
case RAMP_UP:
|
||||||
case RAMP_UP:
|
this.threadGroups[i].rampUpTime = item.value;
|
||||||
this.threadGroups[i].rampUpTime = item.value;
|
break;
|
||||||
break;
|
case ITERATE_RAMP_UP:
|
||||||
case ITERATE_RAMP_UP:
|
this.threadGroups[i].iterateRampUp = item.value;
|
||||||
this.threadGroups[i].iterateRampUp = item.value;
|
break;
|
||||||
break;
|
case DURATION:
|
||||||
case DURATION:
|
this.threadGroups[i].duration = item.value;
|
||||||
this.threadGroups[i].duration = item.value;
|
break;
|
||||||
break;
|
case DURATION_HOURS:
|
||||||
case DURATION_HOURS:
|
this.threadGroups[i].durationHours = item.value;
|
||||||
this.threadGroups[i].durationHours = item.value;
|
break;
|
||||||
break;
|
case DURATION_MINUTES:
|
||||||
case DURATION_MINUTES:
|
this.threadGroups[i].durationMinutes = item.value;
|
||||||
this.threadGroups[i].durationMinutes = item.value;
|
break;
|
||||||
break;
|
case DURATION_SECONDS:
|
||||||
case DURATION_SECONDS:
|
this.threadGroups[i].durationSeconds = item.value;
|
||||||
this.threadGroups[i].durationSeconds = item.value;
|
break;
|
||||||
break;
|
case UNIT:
|
||||||
case UNIT:
|
this.threadGroups[i].unit = item.value;
|
||||||
this.threadGroups[i].unit = item.value;
|
break;
|
||||||
break;
|
case STEPS:
|
||||||
case STEPS:
|
this.threadGroups[i].step = item.value;
|
||||||
this.threadGroups[i].step = item.value;
|
break;
|
||||||
break;
|
case RPS_LIMIT:
|
||||||
case RPS_LIMIT:
|
this.threadGroups[i].rpsLimit = item.value;
|
||||||
this.threadGroups[i].rpsLimit = item.value;
|
break;
|
||||||
break;
|
case RPS_LIMIT_ENABLE:
|
||||||
case RPS_LIMIT_ENABLE:
|
this.threadGroups[i].rpsLimitEnable = item.value;
|
||||||
this.threadGroups[i].rpsLimitEnable = item.value;
|
break;
|
||||||
break;
|
case THREAD_TYPE:
|
||||||
case THREAD_TYPE:
|
this.threadGroups[i].threadType = item.value;
|
||||||
this.threadGroups[i].threadType = item.value;
|
break;
|
||||||
break;
|
case ITERATE_NUM:
|
||||||
case ITERATE_NUM:
|
this.threadGroups[i].iterateNum = item.value;
|
||||||
this.threadGroups[i].iterateNum = item.value;
|
break;
|
||||||
break;
|
case ENABLED:
|
||||||
case ENABLED:
|
this.threadGroups[i].enabled = item.value;
|
||||||
this.threadGroups[i].enabled = item.value;
|
break;
|
||||||
break;
|
case DELETED:
|
||||||
case DELETED:
|
this.threadGroups[i].deleted = item.value;
|
||||||
this.threadGroups[i].deleted = item.value;
|
break;
|
||||||
break;
|
case HANDLER:
|
||||||
case HANDLER:
|
this.threadGroups[i].handler = item.value;
|
||||||
this.threadGroups[i].handler = item.value;
|
break;
|
||||||
break;
|
case THREAD_GROUP_TYPE:
|
||||||
case THREAD_GROUP_TYPE:
|
this.threadGroups[i].tgType = item.value;
|
||||||
this.threadGroups[i].tgType = item.value;
|
break;
|
||||||
break;
|
case ON_SAMPLE_ERROR:
|
||||||
case ON_SAMPLE_ERROR:
|
this.threadGroups[i].onSampleError = item.value;
|
||||||
this.threadGroups[i].onSampleError = item.value;
|
break;
|
||||||
break;
|
case STRATEGY:
|
||||||
case STRATEGY:
|
this.threadGroups[i].strategy = item.value;
|
||||||
this.threadGroups[i].strategy = item.value;
|
break;
|
||||||
break;
|
case RESOURCE_NODE_INDEX:
|
||||||
case RESOURCE_NODE_INDEX:
|
this.threadGroups[i].resourceNodeIndex = item.value;
|
||||||
this.threadGroups[i].resourceNodeIndex = item.value;
|
break;
|
||||||
break;
|
case RATIOS:
|
||||||
case RATIOS:
|
this.threadGroups[i].ratios = item.value;
|
||||||
this.threadGroups[i].ratios = item.value;
|
break;
|
||||||
break;
|
case SERIALIZE_THREAD_GROUPS:
|
||||||
case SERIALIZE_THREAD_GROUPS:
|
this.serializeThreadGroups = item.value;// 所有的线程组值一样
|
||||||
this.serializeThreadGroups = item.value;// 所有的线程组值一样
|
break;
|
||||||
break;
|
case AUTO_STOP:
|
||||||
case AUTO_STOP:
|
this.autoStop = item.value;// 所有的线程组值一样
|
||||||
this.autoStop = item.value;// 所有的线程组值一样
|
break;
|
||||||
break;
|
case AUTO_STOP_DELAY:
|
||||||
case AUTO_STOP_DELAY:
|
this.autoStopDelay = item.value;// 所有的线程组值一样
|
||||||
this.autoStopDelay = item.value;// 所有的线程组值一样
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
break;
|
||||||
break;
|
}
|
||||||
}
|
//
|
||||||
//
|
this.$set(this.threadGroups[i], "unit", this.threadGroups[i].unit || 'S');
|
||||||
this.$set(this.threadGroups[i], "unit", this.threadGroups[i].unit || 'S');
|
this.$set(this.threadGroups[i], "threadType", this.threadGroups[i].threadType || 'DURATION');
|
||||||
this.$set(this.threadGroups[i], "threadType", this.threadGroups[i].threadType || 'DURATION');
|
this.$set(this.threadGroups[i], "iterateNum", this.threadGroups[i].iterateNum || 1);
|
||||||
this.$set(this.threadGroups[i], "iterateNum", this.threadGroups[i].iterateNum || 1);
|
this.$set(this.threadGroups[i], "iterateRampUp", this.threadGroups[i].iterateRampUp || 10);
|
||||||
this.$set(this.threadGroups[i], "iterateRampUp", this.threadGroups[i].iterateRampUp || 10);
|
this.$set(this.threadGroups[i], "enabled", this.threadGroups[i].enabled || 'true');
|
||||||
this.$set(this.threadGroups[i], "enabled", this.threadGroups[i].enabled || 'true');
|
this.$set(this.threadGroups[i], "deleted", this.threadGroups[i].deleted || 'false');
|
||||||
this.$set(this.threadGroups[i], "deleted", this.threadGroups[i].deleted || 'false');
|
this.$set(this.threadGroups[i], "onSampleError", this.threadGroups[i].onSampleError || 'continue');
|
||||||
this.$set(this.threadGroups[i], "onSampleError", this.threadGroups[i].onSampleError || 'continue');
|
});
|
||||||
});
|
}
|
||||||
}
|
for (let i = 0; i < this.threadGroups.length; i++) {
|
||||||
for (let i = 0; i < this.threadGroups.length; i++) {
|
let tg = this.threadGroups[i];
|
||||||
let tg = this.threadGroups[i];
|
tg.durationHours = Math.floor(tg.duration / 3600);
|
||||||
tg.durationHours = Math.floor(tg.duration / 3600);
|
tg.durationMinutes = Math.floor((tg.duration / 60 % 60));
|
||||||
tg.durationMinutes = Math.floor((tg.duration / 60 % 60));
|
tg.durationSeconds = Math.floor((tg.duration % 60));
|
||||||
tg.durationSeconds = Math.floor((tg.duration % 60));
|
}
|
||||||
}
|
this.resourcePoolChange();
|
||||||
this.loadIsOver = true;
|
this.calculateTotalChart();
|
||||||
this.resourcePoolChange();
|
}).finally(() => {
|
||||||
this.calculateTotalChart();
|
this.loadIsOver = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getJmxContent() {
|
getJmxContent() {
|
||||||
let threadGroups = [];
|
let threadGroups = [];
|
||||||
getJmxContent(this.testId, this.reportId, this.isShare)
|
getJmxContent(this.testId, this.reportId, this.isShare)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
response.data.forEach(d => {
|
response.data.forEach(d => {
|
||||||
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
||||||
threadGroups.forEach(tg => {
|
threadGroups.forEach(tg => {
|
||||||
tg.options = {};
|
tg.options = {};
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
this.threadGroups = threadGroups;
|
||||||
|
this.$emit('fileChange', threadGroups);
|
||||||
|
this.getLoadConfig();
|
||||||
});
|
});
|
||||||
this.threadGroups = threadGroups;
|
|
||||||
this.$emit('fileChange', threadGroups);
|
|
||||||
this.getLoadConfig();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
resourcePoolChange() {
|
resourcePoolChange() {
|
||||||
let result = this.resourcePools.filter(p => p.id === this.resourcePool);
|
let result = this.resourcePools.filter(p => p.id === this.resourcePool);
|
||||||
|
@ -610,8 +611,8 @@ export default {
|
||||||
let tg = handler.threadGroups[i];
|
let tg = handler.threadGroups[i];
|
||||||
|
|
||||||
if (tg.enabled === 'false' ||
|
if (tg.enabled === 'false' ||
|
||||||
tg.deleted === 'true' ||
|
tg.deleted === 'true' ||
|
||||||
tg.threadType === 'ITERATION') {
|
tg.threadType === 'ITERATION') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (this.getDuration(tg) < tg.rampUpTime) {
|
if (this.getDuration(tg) < tg.rampUpTime) {
|
||||||
|
@ -736,7 +737,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tg.threadNumber || !tg.duration
|
if (!tg.threadNumber || !tg.duration
|
||||||
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
|
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
|
||||||
this.$warning(this.$t('load_test.pressure_config_params_is_empty'));
|
this.$warning(this.$t('load_test.pressure_config_params_is_empty'));
|
||||||
this.$emit('changeActive', '1');
|
this.$emit('changeActive', '1');
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -267,20 +267,22 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
open(testType, runModeConfig) {
|
open(testType, runModeConfig) {
|
||||||
this.defaultEnvMap = {};
|
this.defaultEnvMap = {};
|
||||||
if (runModeConfig) {
|
if (this.type === 'plan') {
|
||||||
this.runConfig = JSON.parse(runModeConfig);
|
if (runModeConfig) {
|
||||||
if (!this.runConfig.envMap || JSON.stringify(this.runConfig.envMap) === "{}") {
|
this.runConfig = JSON.parse(runModeConfig);
|
||||||
this.isEnvSaved = false;
|
if (!this.runConfig.envMap || JSON.stringify(this.runConfig.envMap) === "{}") {
|
||||||
|
this.isEnvSaved = false;
|
||||||
|
} else {
|
||||||
|
this.isEnvSaved = true;
|
||||||
|
}
|
||||||
|
this.runConfig.envMap = new Map();
|
||||||
|
this.runConfig.testPlanDefaultEnvMap = {};
|
||||||
|
this.runConfig.onSampleError =
|
||||||
|
this.runConfig.onSampleError === "true" ||
|
||||||
|
this.runConfig.onSampleError === true;
|
||||||
} else {
|
} else {
|
||||||
this.isEnvSaved = true;
|
this.isEnvSaved = false;
|
||||||
}
|
}
|
||||||
this.runConfig.envMap = new Map();
|
|
||||||
this.runConfig.testPlanDefaultEnvMap = {};
|
|
||||||
this.runConfig.onSampleError =
|
|
||||||
this.runConfig.onSampleError === "true" ||
|
|
||||||
this.runConfig.onSampleError === true;
|
|
||||||
} else {
|
|
||||||
this.isEnvSaved = false;
|
|
||||||
}
|
}
|
||||||
this.runConfig.environmentType = ENV_TYPE.JSON;
|
this.runConfig.environmentType = ENV_TYPE.JSON;
|
||||||
this.runModeVisible = true;
|
this.runModeVisible = true;
|
||||||
|
@ -401,24 +403,17 @@ export default {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.projectEnvListMap = data;
|
this.projectEnvListMap = data;
|
||||||
for (let d in data) {
|
|
||||||
this.projectIds.add(d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (this.projectIds.size === 0) {
|
param = {id: this.planId};
|
||||||
param = {id: this.planId};
|
getPlanCaseProjectIds(param).then((res) => {
|
||||||
getPlanCaseProjectIds(param).then((res) => {
|
let data = res.data;
|
||||||
let data = res.data;
|
if (data) {
|
||||||
if (data) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
for (let i = 0; i < data.length; i++) {
|
this.projectIds.add(data[i]);
|
||||||
this.projectIds.add(data[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.$refs.envSelectPopover.open();
|
}
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$refs.envSelectPopover.open();
|
this.$refs.envSelectPopover.open();
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- {{ JSON.stringify(eventData) }}-->
|
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="radio"
|
v-model="radio"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|
|
@ -24,13 +24,17 @@
|
||||||
@refreshTable="initTable"
|
@refreshTable="initTable"
|
||||||
ref="apitable">
|
ref="apitable">
|
||||||
|
|
||||||
<template v-slot:header>
|
|
||||||
<ms-environment-select :project-id="projectId" :is-read-only="isReadOnly"
|
|
||||||
@setEnvironment="setEnvironment" ref="msEnvironmentSelect"/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</api-table-list>
|
</api-table-list>
|
||||||
|
<div>
|
||||||
|
<el-radio-group v-model="envType" style="float: left;margin-top: 8px;">
|
||||||
|
<el-radio label="default">{{ $t("api_test.environment.default_environment") }}</el-radio>
|
||||||
|
<el-radio label="newEnv">{{ $t("api_test.environment.choose_new_environment") }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<ms-environment-select v-if="envType==='newEnv'" :project-id="projectId" :is-read-only="isReadOnly"
|
||||||
|
@setEnvironment="setEnvironment" ref="msEnvironmentSelect"
|
||||||
|
style="float: left;margin-left: 16px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</api-list-container>
|
</api-list-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -60,6 +64,7 @@ export default {
|
||||||
condition: {
|
condition: {
|
||||||
components: TEST_PLAN_RELEVANCE_API_DEFINITION_CONFIGS
|
components: TEST_PLAN_RELEVANCE_API_DEFINITION_CONFIGS
|
||||||
},
|
},
|
||||||
|
envType: 'default',
|
||||||
result: {},
|
result: {},
|
||||||
screenHeight: 'calc(100vh - 400px)',//屏幕高度,
|
screenHeight: 'calc(100vh - 400px)',//屏幕高度,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
@ -94,6 +99,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.condition.versionId = this.currentVersion;
|
this.condition.versionId = this.currentVersion;
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectNodeIds() {
|
selectNodeIds() {
|
||||||
|
@ -112,7 +118,7 @@ export default {
|
||||||
currentVersion() {
|
currentVersion() {
|
||||||
this.condition.versionId = this.currentVersion;
|
this.condition.versionId = this.currentVersion;
|
||||||
this.initTable();
|
this.initTable();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setSelectRow(setSelectRow) {
|
setSelectRow(setSelectRow) {
|
||||||
|
|
|
@ -7,13 +7,6 @@
|
||||||
<template>
|
<template>
|
||||||
<slot name="version"></slot>
|
<slot name="version"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<ms-environment-select
|
|
||||||
:project-id="projectId"
|
|
||||||
:is-read-only="isReadOnly"
|
|
||||||
@setEnvironment="setEnvironment"
|
|
||||||
ref="msEnvironmentSelect"
|
|
||||||
/>
|
|
||||||
<ms-search
|
<ms-search
|
||||||
:condition.sync="condition"
|
:condition.sync="condition"
|
||||||
v-if="clearOver"
|
v-if="clearOver"
|
||||||
|
@ -132,6 +125,20 @@
|
||||||
:page-size.sync="pageSize"
|
:page-size.sync="pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
|
<el-radio-group v-model="envType" style="float: left;margin-top: 8px;">
|
||||||
|
<el-radio label="default">{{ $t("api_test.environment.default_environment") }}</el-radio>
|
||||||
|
<el-radio label="newEnv">{{ $t("api_test.environment.choose_new_environment") }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<ms-environment-select
|
||||||
|
:project-id="projectId"
|
||||||
|
:is-read-only="isReadOnly"
|
||||||
|
@setEnvironment="setEnvironment"
|
||||||
|
ref="msEnvironmentSelect"
|
||||||
|
v-if="envType==='newEnv'"
|
||||||
|
style="float: left;margin-left: 16px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</api-list-container>
|
</api-list-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -141,23 +148,16 @@ import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
||||||
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
||||||
import MsTablePagination from "metersphere-frontend/src/components/pagination/TablePagination";
|
import MsTablePagination from "metersphere-frontend/src/components/pagination/TablePagination";
|
||||||
import MsTag from "metersphere-frontend/src/components/MsTag";
|
import MsTag from "metersphere-frontend/src/components/MsTag";
|
||||||
import {
|
import {API_METHOD_COLOUR, CASE_PRIORITY,} from "metersphere-frontend/src/model/JsonData";
|
||||||
API_METHOD_COLOUR,
|
|
||||||
CASE_PRIORITY,
|
|
||||||
} from "metersphere-frontend/src/model/JsonData";
|
|
||||||
import MsEnvironmentSelect from "metersphere-frontend/src/components/environment/snippet/ext/MsEnvironmentSelect";
|
import MsEnvironmentSelect from "metersphere-frontend/src/components/environment/snippet/ext/MsEnvironmentSelect";
|
||||||
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
|
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
|
||||||
import { TEST_PLAN_RELEVANCE_API_CASE_CONFIGS } from "metersphere-frontend/src/components/search/search-components";
|
import {TEST_PLAN_RELEVANCE_API_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
|
||||||
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
||||||
import ApiListContainer from "@/business/plan/view/comonents/api/ApiListContainer";
|
import ApiListContainer from "@/business/plan/view/comonents/api/ApiListContainer";
|
||||||
import {
|
import {buildBatchParam, hasLicense, isProjectVersionEnable,} from "@/business/utils/sdk-utils";
|
||||||
buildBatchParam,
|
|
||||||
hasLicense,
|
|
||||||
isProjectVersionEnable,
|
|
||||||
} from "@/business/utils/sdk-utils";
|
|
||||||
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
|
||||||
import { apiDefinitionGet } from "@/api/remote/api/api-definition";
|
import {apiDefinitionGet} from "@/api/remote/api/api-definition";
|
||||||
import { testPlanApiCaseRelevanceList } from "@/api/remote/plan/test-plan-api-case";
|
import {testPlanApiCaseRelevanceList} from "@/api/remote/plan/test-plan-api-case";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RelevanceCaseList",
|
name: "RelevanceCaseList",
|
||||||
|
@ -177,6 +177,7 @@ export default {
|
||||||
condition: {
|
condition: {
|
||||||
components: TEST_PLAN_RELEVANCE_API_CASE_CONFIGS,
|
components: TEST_PLAN_RELEVANCE_API_CASE_CONFIGS,
|
||||||
},
|
},
|
||||||
|
envType: 'default',
|
||||||
selectCase: {},
|
selectCase: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
moduleId: "",
|
moduleId: "",
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="result.loading">
|
<div v-loading="result.loading">
|
||||||
<env-group-popover
|
|
||||||
:env-map="projectEnvMap"
|
|
||||||
:project-ids="projectIds"
|
|
||||||
@setProjectEnvMap="setProjectEnvMap"
|
|
||||||
:environment-type.sync="environmentType"
|
|
||||||
:group-id="envGroupId"
|
|
||||||
:is-scenario="false"
|
|
||||||
@setEnvGroup="setEnvGroup"
|
|
||||||
:show-config-button-with-out-permission="
|
|
||||||
showConfigButtonWithOutPermission
|
|
||||||
"
|
|
||||||
:project-list="projectList"
|
|
||||||
ref="envPopover"
|
|
||||||
class="env-popover"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<mx-version-select
|
<mx-version-select
|
||||||
v-xpack
|
v-xpack
|
||||||
:project-id="projectId"
|
:project-id="projectId"
|
||||||
|
@ -162,6 +146,27 @@
|
||||||
:page-size.sync="pageSize"
|
:page-size.sync="pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
|
<el-radio-group v-model="envType" style="float: left;margin-top: 18px;">
|
||||||
|
<el-radio label="default">{{ $t("api_test.environment.default_environment") }}</el-radio>
|
||||||
|
<el-radio label="newEnv">{{ $t("api_test.environment.choose_new_environment") }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<env-group-popover
|
||||||
|
:env-map="projectEnvMap"
|
||||||
|
:project-ids="projectIds"
|
||||||
|
@setProjectEnvMap="setProjectEnvMap"
|
||||||
|
:environment-type.sync="environmentType"
|
||||||
|
:group-id="envGroupId"
|
||||||
|
:is-scenario="false"
|
||||||
|
@setEnvGroup="setEnvGroup"
|
||||||
|
:show-config-button-with-out-permission="showConfigButtonWithOutPermission"
|
||||||
|
:project-list="projectList"
|
||||||
|
ref="envPopover"
|
||||||
|
class="env-popover"
|
||||||
|
v-if="envType==='newEnv'"
|
||||||
|
style="float: left;margin-left: 16px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -172,21 +177,15 @@ import MsTag from "metersphere-frontend/src/components/MsTag"; // import MsApiRe
|
||||||
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
|
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
|
||||||
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
|
||||||
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
|
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
|
||||||
import { TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS } from "metersphere-frontend/src/components/search/search-components";
|
import {TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
|
||||||
import { ENV_TYPE } from "metersphere-frontend/src/utils/constants";
|
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
|
||||||
import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
||||||
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
||||||
import {
|
import {getOwnerProjects, getVersionFilters,} from "@/business/utils/sdk-utils";
|
||||||
getOwnerProjects,
|
|
||||||
getVersionFilters,
|
|
||||||
} from "@/business/utils/sdk-utils";
|
|
||||||
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
|
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
|
||||||
import { getProjectApplicationConfig } from "@/api/project-application";
|
import {getProjectApplicationConfig} from "@/api/project-application";
|
||||||
import { getApiScenarioEnvByProjectId } from "@/api/remote/api/api-automation";
|
import {getApiScenarioEnvByProjectId} from "@/api/remote/api/api-automation";
|
||||||
import {
|
import {scenarioRelevanceList, scenarioRelevanceProjectIds,} from "@/api/remote/plan/test-plan-scenario";
|
||||||
scenarioRelevanceList,
|
|
||||||
scenarioRelevanceProjectIds,
|
|
||||||
} from "@/api/remote/plan/test-plan-scenario";
|
|
||||||
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
||||||
import ApiReportStatus from "@/business/plan/view/comonents/report/detail/api/ApiReportStatus";
|
import ApiReportStatus from "@/business/plan/view/comonents/report/detail/api/ApiReportStatus";
|
||||||
import MsApiReportStatus from "@/business/plan/view/comonents/report/detail/api/ApiReportStatus";
|
import MsApiReportStatus from "@/business/plan/view/comonents/report/detail/api/ApiReportStatus";
|
||||||
|
@ -225,6 +224,7 @@ export default {
|
||||||
condition: {
|
condition: {
|
||||||
components: TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS,
|
components: TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS,
|
||||||
},
|
},
|
||||||
|
envType: 'default',
|
||||||
currentScenario: {},
|
currentScenario: {},
|
||||||
schedule: {},
|
schedule: {},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
|
|
@ -123,6 +123,13 @@ export default {
|
||||||
projectId() {
|
projectId() {
|
||||||
this.getVersionOptions();
|
this.getVersionOptions();
|
||||||
},
|
},
|
||||||
|
isApiListEnable() {
|
||||||
|
if (this.isApiListEnable) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getVersionOptions();
|
this.getVersionOptions();
|
||||||
|
|
Loading…
Reference in New Issue