revert: 回退环境管理代码
This commit is contained in:
parent
d4b43e273a
commit
0ef3306614
|
@ -18,18 +18,12 @@
|
||||||
:content="$t('commons.import')"
|
:content="$t('commons.import')"
|
||||||
@click="importJSON"
|
@click="importJSON"
|
||||||
/>
|
/>
|
||||||
<el-dropdown @command="handleExportCommand" class="scenario-ext-btn" trigger="hover"
|
|
||||||
v-permission="['PROJECT_ENVIRONMENT:READ+EXPORT']">
|
|
||||||
<ms-table-button
|
<ms-table-button
|
||||||
style="margin-left: 10px"
|
v-permission="['PROJECT_ENVIRONMENT:READ+EXPORT']"
|
||||||
icon="el-icon-box"
|
icon="el-icon-box"
|
||||||
:content="$t('commons.export')"
|
:content="$t('commons.export')"
|
||||||
|
@click="exportJSON"
|
||||||
/>
|
/>
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item command="exportApi">{{ $t('envrionment.export_variable_tip') }}</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
|
|
||||||
<el-link
|
<el-link
|
||||||
style="margin-left: 10px"
|
style="margin-left: 10px"
|
||||||
@click="batchAdd"
|
@click="batchAdd"
|
||||||
|
@ -64,31 +58,6 @@
|
||||||
>
|
>
|
||||||
<ms-table-column prop="num" sortable label="ID" min-width="60">
|
<ms-table-column prop="num" sortable label="ID" min-width="60">
|
||||||
</ms-table-column>
|
</ms-table-column>
|
||||||
|
|
||||||
<ms-table-column
|
|
||||||
prop="scope"
|
|
||||||
sortable
|
|
||||||
:label="$t('commons.scope')"
|
|
||||||
:filters="scopeTypeFilters"
|
|
||||||
:filter-method="filterScope"
|
|
||||||
min-width="120">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-select
|
|
||||||
v-model="scope.row.scope"
|
|
||||||
:placeholder="$t('commons.please_select')"
|
|
||||||
size="mini"
|
|
||||||
@change="changeType(scope.row)"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in scopeTypeFilters"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.text"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</ms-table-column>
|
|
||||||
|
|
||||||
<ms-table-column
|
<ms-table-column
|
||||||
prop="name"
|
prop="name"
|
||||||
:label="$t('api_test.variable_name')"
|
:label="$t('api_test.variable_name')"
|
||||||
|
@ -115,9 +84,9 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="scope.row.type"
|
v-model="scope.row.type"
|
||||||
v-if="!scope.row.scope || scope.row.scope == 'api'"
|
|
||||||
:placeholder="$t('commons.please_select')"
|
:placeholder="$t('commons.please_select')"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
@change="changeType(scope.row)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in typeSelectOptions"
|
v-for="item in typeSelectOptions"
|
||||||
|
@ -126,20 +95,6 @@
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-select
|
|
||||||
v-else
|
|
||||||
v-model="scope.row.type"
|
|
||||||
:placeholder="$t('commons.please_select')"
|
|
||||||
size="mini"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in uiTypeSelectOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
</template>
|
||||||
</ms-table-column>
|
</ms-table-column>
|
||||||
|
|
||||||
|
@ -173,14 +128,14 @@
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.description" size="mini"/>
|
<el-input v-model="scope.row.description" size="mini" />
|
||||||
</template>
|
</template>
|
||||||
</ms-table-column>
|
</ms-table-column>
|
||||||
|
|
||||||
<ms-table-column :label="$t('commons.operating')" width="150">
|
<ms-table-column :label="$t('commons.operating')" width="150">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<span>
|
<span>
|
||||||
<el-switch v-model="scope.row.enable" size="mini"/>
|
<el-switch v-model="scope.row.enable" size="mini" />
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="dark"
|
effect="dark"
|
||||||
:content="$t('commons.remove')"
|
:content="$t('commons.remove')"
|
||||||
|
@ -217,7 +172,7 @@
|
||||||
</ms-table-column>
|
</ms-table-column>
|
||||||
</ms-table>
|
</ms-table>
|
||||||
</div>
|
</div>
|
||||||
<batch-add-parameter @batchSave="batchSave" ref="batchAdd"/>
|
<batch-add-parameter @batchSave="batchSave" ref="batchAdd" />
|
||||||
<api-variable-setting ref="apiVariableSetting"></api-variable-setting>
|
<api-variable-setting ref="apiVariableSetting"></api-variable-setting>
|
||||||
<variable-import
|
<variable-import
|
||||||
ref="variableImport"
|
ref="variableImport"
|
||||||
|
@ -227,7 +182,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {KeyValue} from "../../../model/EnvTestModel";
|
import { KeyValue } from "../../../model/EnvTestModel";
|
||||||
import MsApiVariableInput from "./ApiVariableInput";
|
import MsApiVariableInput from "./ApiVariableInput";
|
||||||
import BatchAddParameter from "./BatchAddParameter";
|
import BatchAddParameter from "./BatchAddParameter";
|
||||||
import MsTableButton from "../../MsTableButton";
|
import MsTableButton from "../../MsTableButton";
|
||||||
|
@ -235,9 +190,8 @@ import MsTable from "../../table/MsTable";
|
||||||
import MsTableColumn from "../../table/MsTableColumn";
|
import MsTableColumn from "../../table/MsTableColumn";
|
||||||
import ApiVariableSetting from "./ApiVariableSetting";
|
import ApiVariableSetting from "./ApiVariableSetting";
|
||||||
import CsvFileUpload from "./variable/CsvFileUpload";
|
import CsvFileUpload from "./variable/CsvFileUpload";
|
||||||
import {downloadFile, getUUID, operationConfirm} from "../../../utils";
|
import { downloadFile, getUUID, operationConfirm } from "../../../utils";
|
||||||
import VariableImport from "./variable/VariableImport";
|
import VariableImport from "./variable/VariableImport";
|
||||||
import _ from "lodash";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiScenarioVariables",
|
name: "MsApiScenarioVariables",
|
||||||
|
@ -277,25 +231,15 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
typeSelectOptions: [
|
typeSelectOptions: [
|
||||||
{value: "CONSTANT", label: this.$t("api_test.automation.constant")},
|
{ value: "CONSTANT", label: this.$t("api_test.automation.constant") },
|
||||||
{value: "LIST", label: this.$t("test_track.case.list")},
|
{ value: "LIST", label: this.$t("test_track.case.list") },
|
||||||
{value: "CSV", label: "CSV"},
|
{ value: "CSV", label: "CSV" },
|
||||||
{value: "COUNTER", label: this.$t("api_test.automation.counter")},
|
{ value: "COUNTER", label: this.$t("api_test.automation.counter") },
|
||||||
{value: "RANDOM", label: this.$t("api_test.automation.random")},
|
{ value: "RANDOM", label: this.$t("api_test.automation.random") },
|
||||||
],
|
|
||||||
uiTypeSelectOptions: [
|
|
||||||
{value: "STRING", label: this.$t("api_test.automation.string")},
|
|
||||||
{value: "ARRAY", label: this.$t("api_test.automation.array")},
|
|
||||||
{value: "JSON", label: this.$t("api_test.automation.json")},
|
|
||||||
{value: "NUMBER", label: this.$t("api_test.automation.number")},
|
|
||||||
],
|
],
|
||||||
variables: {},
|
variables: {},
|
||||||
selectVariable: "",
|
selectVariable: "",
|
||||||
editData: {},
|
editData: {},
|
||||||
scopeTypeFilters: [
|
|
||||||
{text: this.$t("commons.api"), value: "api"},
|
|
||||||
{text: this.$t("commons.ui_test"), value: "ui"},
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -344,7 +288,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (isNeedCreate) {
|
if (isNeedCreate) {
|
||||||
this.variables.push(
|
this.variables.push(
|
||||||
new KeyValue({enable: true, id: getUUID(), type: "CONSTANT", scope: "api"})
|
new KeyValue({ enable: true, id: getUUID(), type: "CONSTANT" })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.$emit("change", this.variables);
|
this.$emit("change", this.variables);
|
||||||
|
@ -361,10 +305,6 @@ export default {
|
||||||
data.files = [];
|
data.files = [];
|
||||||
data.quotedData = "false";
|
data.quotedData = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.scope || data.scope == "ui") {
|
|
||||||
data.type = 'STRING';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
valueText(data) {
|
valueText(data) {
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
|
@ -381,11 +321,11 @@ export default {
|
||||||
},
|
},
|
||||||
querySearch(queryString, cb) {
|
querySearch(queryString, cb) {
|
||||||
let restaurants = [
|
let restaurants = [
|
||||||
{value: "UTF-8"},
|
{ value: "UTF-8" },
|
||||||
{value: "UTF-16"},
|
{ value: "UTF-16" },
|
||||||
{value: "GB2312"},
|
{ value: "GB2312" },
|
||||||
{value: "ISO-8859-15"},
|
{ value: "ISO-8859-15" },
|
||||||
{value: "US-ASCll"},
|
{ value: "US-ASCll" },
|
||||||
];
|
];
|
||||||
let results = queryString
|
let results = queryString
|
||||||
? restaurants.filter(this.createFilter(queryString))
|
? restaurants.filter(this.createFilter(queryString))
|
||||||
|
@ -407,9 +347,6 @@ export default {
|
||||||
this.$set(item, "description", item.remark);
|
this.$set(item, "description", item.remark);
|
||||||
item.remark = undefined;
|
item.remark = undefined;
|
||||||
}
|
}
|
||||||
if (!item.scope) {
|
|
||||||
this.$set(item, "scope", "api");
|
|
||||||
}
|
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -433,7 +370,7 @@ export default {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
filter(scope) {
|
filter() {
|
||||||
let datas = [];
|
let datas = [];
|
||||||
this.variables.forEach((item) => {
|
this.variables.forEach((item) => {
|
||||||
if (this.selectVariable && this.selectVariable != "" && item.name) {
|
if (this.selectVariable && this.selectVariable != "" && item.name) {
|
||||||
|
@ -453,12 +390,6 @@ export default {
|
||||||
});
|
});
|
||||||
this.variables = datas;
|
this.variables = datas;
|
||||||
},
|
},
|
||||||
filterScope(value, row) {
|
|
||||||
if (value == "ui") {
|
|
||||||
return row.scope == "ui";
|
|
||||||
}
|
|
||||||
return !row.scope || row.scope == "api";
|
|
||||||
},
|
|
||||||
openSetting(data) {
|
openSetting(data) {
|
||||||
this.$refs.apiVariableSetting.open(data);
|
this.$refs.apiVariableSetting.open(data);
|
||||||
},
|
},
|
||||||
|
@ -519,15 +450,8 @@ export default {
|
||||||
this.sortParameters();
|
this.sortParameters();
|
||||||
},
|
},
|
||||||
exportJSON() {
|
exportJSON() {
|
||||||
let apiVariable = [];
|
if (this.$refs.variableTable.selectIds.length < 1) {
|
||||||
this.$refs.variableTable.selectRows.forEach((r) => {
|
this.$warning(this.$t("api_test.environment.select_variable"));
|
||||||
if (!r.scope || r.scope != "ui") {
|
|
||||||
apiVariable.push(r);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (apiVariable.length < 1) {
|
|
||||||
this.$warning(this.$t("api_test.environment.select_api_variable"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let variablesJson = [];
|
let variablesJson = [];
|
||||||
|
@ -537,7 +461,7 @@ export default {
|
||||||
if (row.type === "CSV") {
|
if (row.type === "CSV") {
|
||||||
messages = this.$t("variables.csv_download");
|
messages = this.$t("variables.csv_download");
|
||||||
}
|
}
|
||||||
if (row.name && (!row.scope || row.scope == "api")) {
|
if (row.name) {
|
||||||
variablesJson.push(row);
|
variablesJson.push(row);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -570,21 +494,10 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleExportCommand(command){
|
|
||||||
this.exportJSON();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.items.length === 0) {
|
if (this.items.length === 0) {
|
||||||
this.items.push(new KeyValue({enable: true, scope: "api"}));
|
this.items.push(new KeyValue({ enable: true }));
|
||||||
} else {
|
|
||||||
//历史数据默认是 api 应用场景
|
|
||||||
_.forEach(this.items, item => {
|
|
||||||
if (!item.scope) {
|
|
||||||
this.$set(item, "scope", "api");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.variables = this.items;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -136,8 +136,8 @@ import MsTableOperator from "metersphere-frontend/src/components/MsTableOperator
|
||||||
import MsTableOperatorButton from "metersphere-frontend/src/components/MsTableOperatorButton";
|
import MsTableOperatorButton from "metersphere-frontend/src/components/MsTableOperatorButton";
|
||||||
import MsTablePagination from "metersphere-frontend/src/components/pagination/TablePagination";
|
import MsTablePagination from "metersphere-frontend/src/components/pagination/TablePagination";
|
||||||
import ApiEnvironmentConfig from "metersphere-frontend/src/components/environment/ApiEnvironmentConfig";
|
import ApiEnvironmentConfig from "metersphere-frontend/src/components/environment/ApiEnvironmentConfig";
|
||||||
import {Environment, parseEnvironment, HttpConfig} from "metersphere-frontend/src/model/EnvironmentModel";
|
import {Environment, parseEnvironment} from "metersphere-frontend/src/model/EnvironmentModel";
|
||||||
import EnvironmentEdit from "./components/EnvironmentEdit";
|
import EnvironmentEdit from "metersphere-frontend/src/components/environment/EnvironmentEdit";
|
||||||
import MsAsideItem from "metersphere-frontend/src/components/MsAsideItem";
|
import MsAsideItem from "metersphere-frontend/src/components/MsAsideItem";
|
||||||
import MsAsideContainer from "metersphere-frontend/src/components/MsAsideContainer";
|
import MsAsideContainer from "metersphere-frontend/src/components/MsAsideContainer";
|
||||||
import ProjectSwitch from "metersphere-frontend/src/components/head/ProjectSwitch";
|
import ProjectSwitch from "metersphere-frontend/src/components/head/ProjectSwitch";
|
||||||
|
@ -174,7 +174,7 @@ export default {
|
||||||
projectList: [],
|
projectList: [],
|
||||||
condition: {}, //封装传递给后端的查询条件
|
condition: {}, //封装传递给后端的查询条件
|
||||||
environments: [],
|
environments: [],
|
||||||
currentEnvironment: new Environment({httpConfig: new HttpConfig()}),
|
currentEnvironment: new Environment(),
|
||||||
result: {},
|
result: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
@ -288,7 +288,7 @@ export default {
|
||||||
createEnv() {
|
createEnv() {
|
||||||
this.dialogTitle = this.$t('api_test.environment.create');
|
this.dialogTitle = this.$t('api_test.environment.create');
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.currentEnvironment = new Environment({httpConfig: new HttpConfig()});
|
this.currentEnvironment = new Environment();
|
||||||
this.currentEnvironment.projectId = this.currentProjectId;
|
this.currentEnvironment.projectId = this.currentProjectId;
|
||||||
this.currentEnvironment.currentProjectId = this.currentProjectId;
|
this.currentEnvironment.currentProjectId = this.currentProjectId;
|
||||||
this.ifCreate = true;
|
this.ifCreate = true;
|
||||||
|
|
|
@ -155,7 +155,7 @@ import {REQUEST_HEADERS} from "metersphere-frontend/src/utils/constants";
|
||||||
import {CommonConfig, Environment} from "metersphere-frontend/src/model/EnvironmentModel";
|
import {CommonConfig, Environment} from "metersphere-frontend/src/model/EnvironmentModel";
|
||||||
import MsApiHostTable from "metersphere-frontend/src/components/environment/commons/ApiHostTable";
|
import MsApiHostTable from "metersphere-frontend/src/components/environment/commons/ApiHostTable";
|
||||||
import MsDatabaseConfig from "metersphere-frontend/src/components/environment/database/DatabaseConfig";
|
import MsDatabaseConfig from "metersphere-frontend/src/components/environment/database/DatabaseConfig";
|
||||||
import MsEnvironmentHttpConfig from "./EnvironmentHttpConfig";
|
import MsEnvironmentHttpConfig from "metersphere-frontend/src/components/environment/EnvironmentHttpConfig";
|
||||||
import MsEnvironmentCommonConfig from "metersphere-frontend/src/components/environment/EnvironmentCommonConfig";
|
import MsEnvironmentCommonConfig from "metersphere-frontend/src/components/environment/EnvironmentCommonConfig";
|
||||||
import MsEnvironmentSSLConfig from "metersphere-frontend/src/components/environment/EnvironmentSSLConfig";
|
import MsEnvironmentSSLConfig from "metersphere-frontend/src/components/environment/EnvironmentSSLConfig";
|
||||||
import MsApiAuthConfig from "metersphere-frontend/src/components/environment/auth/ApiAuthConfig";
|
import MsApiAuthConfig from "metersphere-frontend/src/components/environment/auth/ApiAuthConfig";
|
||||||
|
|
|
@ -65,6 +65,8 @@ import org.springframework.kafka.core.KafkaTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
|
@ -1554,10 +1556,6 @@ public class TestPlanService {
|
||||||
envMap = planTestPlanApiCaseService.getApiCaseEnv(planId);
|
envMap = planTestPlanApiCaseService.getApiCaseEnv(planId);
|
||||||
Map<String, List<String>> scenarioEnv = planTestPlanScenarioCaseService.getApiScenarioEnv(planId);
|
Map<String, List<String>> scenarioEnv = planTestPlanScenarioCaseService.getApiScenarioEnv(planId);
|
||||||
|
|
||||||
if (DiscoveryUtil.hasService(MicroServiceName.UI_TEST)) {
|
|
||||||
scenarioEnv = mergeUiScenarioEnv(planId, scenarioEnv);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> projectIds = scenarioEnv.keySet();
|
Set<String> projectIds = scenarioEnv.keySet();
|
||||||
for (String projectId : projectIds) {
|
for (String projectId : projectIds) {
|
||||||
if (envMap.containsKey(projectId)) {
|
if (envMap.containsKey(projectId)) {
|
||||||
|
@ -1580,32 +1578,6 @@ public class TestPlanService {
|
||||||
return envMap;
|
return envMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 合并ui场景的环境信息
|
|
||||||
* @param planId
|
|
||||||
* @param scenarioEnv
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private Map<String, List<String>> mergeUiScenarioEnv(String planId, Map<String, List<String>> scenarioEnv) {
|
|
||||||
Map<String, List<String>> uiScenarioEnv = planTestPlanUiScenarioCaseService.getUiScenarioEnv(planId);
|
|
||||||
if (MapUtils.isEmpty(scenarioEnv)) {
|
|
||||||
return uiScenarioEnv;
|
|
||||||
}
|
|
||||||
if (MapUtils.isNotEmpty(uiScenarioEnv)) {
|
|
||||||
uiScenarioEnv.entrySet().forEach(entry -> {
|
|
||||||
if (scenarioEnv.containsKey(entry.getKey())) {
|
|
||||||
List<String> environmentIds = scenarioEnv.get(entry.getKey());
|
|
||||||
entry.getValue().forEach(eId -> {
|
|
||||||
if (!environmentIds.contains(eId)) {
|
|
||||||
environmentIds.add(eId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return scenarioEnv;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String runPlan(TestPlanRunRequest testplanRunRequest) {
|
public String runPlan(TestPlanRunRequest testplanRunRequest) {
|
||||||
//检查测试计划下有没有可以执行的用例;
|
//检查测试计划下有没有可以执行的用例;
|
||||||
if (!haveExecCase(testplanRunRequest.getTestPlanId(), false)) {
|
if (!haveExecCase(testplanRunRequest.getTestPlanId(), false)) {
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<env-group-popover
|
|
||||||
:env-map="projectEnvMap"
|
|
||||||
:project-ids="projectIds"
|
|
||||||
:show-env-group="false"
|
|
||||||
@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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
|
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
|
||||||
v-if="condition.components !== undefined && condition.components.length > 0"
|
v-if="condition.components !== undefined && condition.components.length > 0"
|
||||||
|
@ -115,9 +99,6 @@ import {
|
||||||
getCustomTableWidth
|
getCustomTableWidth
|
||||||
} from "metersphere-frontend/src/utils/tableUtils";
|
} from "metersphere-frontend/src/utils/tableUtils";
|
||||||
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
||||||
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
|
||||||
import {getApiScenarioEnvByProjectId} from "@/api/remote/api/api-automation";
|
|
||||||
import {getUiScenarioEnvByProjectId} from "@/api/remote/ui/ui-automation";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RelevanceUiScenarioList",
|
name: "RelevanceUiScenarioList",
|
||||||
|
@ -131,7 +112,6 @@ export default {
|
||||||
MsTag,
|
MsTag,
|
||||||
MsTableAdvSearchBar,
|
MsTableAdvSearchBar,
|
||||||
MsTableColumn,
|
MsTableColumn,
|
||||||
EnvGroupPopover,
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
referenced: {
|
referenced: {
|
||||||
|
@ -167,7 +147,6 @@ export default {
|
||||||
envGroupId: "",
|
envGroupId: "",
|
||||||
versionFilters: [],
|
versionFilters: [],
|
||||||
fieldsWidth: getCustomTableWidth('TEST_PLAN_UI_SCENARIO_CASE'),
|
fieldsWidth: getCustomTableWidth('TEST_PLAN_UI_SCENARIO_CASE'),
|
||||||
projectIds: new Set()
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -265,24 +244,9 @@ export default {
|
||||||
selectCountChange(data) {
|
selectCountChange(data) {
|
||||||
this.selectRows = this.$refs.scenarioTable.selectRows;
|
this.selectRows = this.$refs.scenarioTable.selectRows;
|
||||||
this.$emit("selectCountChange", data);
|
this.$emit("selectCountChange", data);
|
||||||
this.initProjectIds();
|
|
||||||
},
|
},
|
||||||
showReport() {
|
showReport() {
|
||||||
|
|
||||||
},
|
|
||||||
initProjectIds() {
|
|
||||||
this.projectIds.clear();
|
|
||||||
// this.map.clear();
|
|
||||||
this.selectRows.forEach((row) => {
|
|
||||||
getUiScenarioEnvByProjectId(row.id).then((res) => {
|
|
||||||
let data = res.data;
|
|
||||||
data.projectIds.forEach((d) => this.projectIds.add(d));
|
|
||||||
// this.map.set(row.id, data.projectIds);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
closeEnv(){
|
|
||||||
this.$refs.envPopover.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -150,10 +150,6 @@ export default {
|
||||||
let map = this.$refs.apiScenarioList.map;
|
let map = this.$refs.apiScenarioList.map;
|
||||||
let envGroupId = this.$refs.apiScenarioList.envGroupId;
|
let envGroupId = this.$refs.apiScenarioList.envGroupId;
|
||||||
|
|
||||||
if (!envMap || envMap.size == 0) {
|
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
selectRows.forEach(row => {
|
selectRows.forEach(row => {
|
||||||
selectIds.push(row.id);
|
selectIds.push(row.id);
|
||||||
})
|
})
|
||||||
|
@ -185,6 +181,8 @@ export default {
|
||||||
this.autoCheckStatus();
|
this.autoCheckStatus();
|
||||||
this.$refs.baseRelevance.close();
|
this.$refs.baseRelevance.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
autoCheckStatus() { // 检查执行结果,自动更新计划状态
|
autoCheckStatus() { // 检查执行结果,自动更新计划状态
|
||||||
if (!this.planId) {
|
if (!this.planId) {
|
||||||
|
|
|
@ -147,8 +147,7 @@
|
||||||
:filters="apiscenariofilters.RESULT_FILTERS"
|
:filters="apiscenariofilters.RESULT_FILTERS"
|
||||||
:label="$t('api_test.automation.last_result')">
|
:label="$t('api_test.automation.last_result')">
|
||||||
<template v-slot:default="{row}">
|
<template v-slot:default="{row}">
|
||||||
<el-link @click="showReport(row)"
|
<el-link @click="showReport(row)" :disabled="!row.lastResult || row.lastResult==='PENDING' || row.lastResult==='UnExecute'">
|
||||||
:disabled="!row.lastResult || row.lastResult==='PENDING' || row.lastResult==='UnExecute'">
|
|
||||||
<ms-test-plan-api-status :status="row.lastResult==='UnExecute' ? 'PENDING' : row.lastResult"/>
|
<ms-test-plan-api-status :status="row.lastResult==='UnExecute' ? 'PENDING' : row.lastResult"/>
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
|
@ -178,7 +177,7 @@
|
||||||
@batchEdit="batchEdit"/>
|
@batchEdit="batchEdit"/>
|
||||||
|
|
||||||
<ui-run-mode @handleRunBatch="handleRunBatch" ref="runMode" :custom-run-mode="true"
|
<ui-run-mode @handleRunBatch="handleRunBatch" ref="runMode" :custom-run-mode="true"
|
||||||
:custom-serial-on-sample-error="true" :request="conditionRequest"/>
|
:custom-serial-on-sample-error="true"/>
|
||||||
|
|
||||||
<ms-task-center ref="taskCenter" :show-menu="false"/>
|
<ms-task-center ref="taskCenter" :show-menu="false"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -328,8 +327,6 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
versionFilters: [],
|
versionFilters: [],
|
||||||
//
|
|
||||||
conditionRequest: {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -361,14 +358,14 @@ export default {
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
initCondition(this.condition, this.condition.selectAll);
|
initCondition(this.condition, this.condition.selectAll);
|
||||||
if (this.condition && this.condition.filters && this.condition.filters.last_result) {
|
if(this.condition && this.condition.filters && this.condition.filters.last_result){
|
||||||
if (this.condition.filters.last_result.length > 0) {
|
if(this.condition.filters.last_result.length > 0){
|
||||||
//校验是否含有PENDING
|
//校验是否含有PENDING
|
||||||
if (this.condition.filters.last_result.includes("PENDING")) {
|
if(this.condition.filters.last_result.includes("PENDING")){
|
||||||
this.condition.filters.last_result = [...this.condition.filters.last_result, "UnExecute"]
|
this.condition.filters.last_result = [...this.condition.filters.last_result, "UnExecute"]
|
||||||
}
|
}
|
||||||
//校验是否含有ERROR
|
//校验是否含有ERROR
|
||||||
if (this.condition.filters.last_result.includes("ERROR")) {
|
if(this.condition.filters.last_result.includes("ERROR")){
|
||||||
this.condition.filters.last_result = [...this.condition.filters.last_result, "FAIL"]
|
this.condition.filters.last_result = [...this.condition.filters.last_result, "FAIL"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,19 +437,12 @@ export default {
|
||||||
let rows = this.orderBySelectRows(this.$refs.table.selectRows);
|
let rows = this.orderBySelectRows(this.$refs.table.selectRows);
|
||||||
this.planCaseIds = [];
|
this.planCaseIds = [];
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
this.planCaseIds.push(row.caseId);
|
this.planCaseIds.push(row.id);
|
||||||
})
|
})
|
||||||
this.conditionRequest.id = getUUID();
|
|
||||||
this.conditionRequest.ids = this.planCaseIds;
|
|
||||||
this.conditionRequest.projectId = this.projectId;
|
|
||||||
this.conditionRequest.condition = this.condition;
|
|
||||||
this.$refs.runMode.open();
|
this.$refs.runMode.open();
|
||||||
},
|
},
|
||||||
orderBySelectRows(rows) {
|
orderBySelectRows(rows) {
|
||||||
let selectIds = this.$refs.table.selectIds;
|
let selectIds = Array.from(rows).map(row => row.id);
|
||||||
if (rows) {
|
|
||||||
selectIds = Array.from(rows).map(row => row.id);
|
|
||||||
}
|
|
||||||
let array = [];
|
let array = [];
|
||||||
for (let i in this.tableData) {
|
for (let i in this.tableData) {
|
||||||
if (selectIds.indexOf(this.tableData[i].id) !== -1) {
|
if (selectIds.indexOf(this.tableData[i].id) !== -1) {
|
||||||
|
|
|
@ -8,21 +8,6 @@
|
||||||
>
|
>
|
||||||
<div class="mode-container">
|
<div class="mode-container">
|
||||||
|
|
||||||
<div>
|
|
||||||
<div>{{ $t("commons.environment") }}:</div>
|
|
||||||
<env-select-popover :project-ids="projectIds"
|
|
||||||
:project-list="projectList"
|
|
||||||
:project-env-map="projectEnvListMap"
|
|
||||||
:environment-type="'JSON'"
|
|
||||||
:has-option-group="false"
|
|
||||||
:show-env-group="false"
|
|
||||||
:group-id="runConfig.environmentGroupId"
|
|
||||||
@setProjectEnvMap="setProjectEnvMap"
|
|
||||||
ref="envSelectPopover"
|
|
||||||
class="mode-row"
|
|
||||||
></env-select-popover>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 浏览器 -->
|
<!-- 浏览器 -->
|
||||||
<div class="browser-row wrap">
|
<div class="browser-row wrap">
|
||||||
<div class="title">{{ $t("ui.browser") }}:</div>
|
<div class="title">{{ $t("ui.browser") }}:</div>
|
||||||
|
@ -282,7 +267,6 @@ export default {
|
||||||
};
|
};
|
||||||
this.runModeVisible = true;
|
this.runModeVisible = true;
|
||||||
this.getWsProjects();
|
this.getWsProjects();
|
||||||
this.showPopover();
|
|
||||||
},
|
},
|
||||||
changeMode() {
|
changeMode() {
|
||||||
this.runConfig.runWithinResourcePool = false;
|
this.runConfig.runWithinResourcePool = false;
|
||||||
|
|
|
@ -88,7 +88,6 @@ const TRACK_HEADER = {
|
||||||
{id: 'name', key: '2', label: 'api_test.automation.scenario_name'},
|
{id: 'name', key: '2', label: 'api_test.automation.scenario_name'},
|
||||||
{id: 'versionId', key: 'd', label: 'commons.version'},
|
{id: 'versionId', key: 'd', label: 'commons.version'},
|
||||||
{id: 'level', key: '3', label: 'api_test.automation.case_level'},
|
{id: 'level', key: '3', label: 'api_test.automation.case_level'},
|
||||||
{id: 'envs', key: '8', label: 'commons.environment'},
|
|
||||||
{id: 'tagNames', key: '4', label: 'api_test.automation.tag'},
|
{id: 'tagNames', key: '4', label: 'api_test.automation.tag'},
|
||||||
{id: 'stepTotal', key: '7', label: 'api_test.automation.step'},
|
{id: 'stepTotal', key: '7', label: 'api_test.automation.step'},
|
||||||
{id: 'passRate', key: '9', label: 'api_test.automation.passing_rate'},
|
{id: 'passRate', key: '9', label: 'api_test.automation.passing_rate'},
|
||||||
|
|
Loading…
Reference in New Issue