fix(测试跟踪): 测试计划-场景列表-批量执行-操作按钮显示不全
--bug=1029019 --user=白奇 【测试跟踪】测试计划-场景列表-批量执行-操作按钮显示不全 https://www.tapd.cn/55049933/s/1408465
This commit is contained in:
parent
907d2e0a35
commit
998281bb61
|
@ -1,45 +1,43 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
:title="$t('load_test.runtime_config')"
|
:title="$t('load_test.runtime_config')"
|
||||||
width="550px"
|
width="550px"
|
||||||
style="margin-top: -8.65vh; max-height: 87.3vh"
|
@close="close"
|
||||||
@close="close"
|
:visible.sync="runModeVisible"
|
||||||
:visible.sync="runModeVisible"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="env-container">
|
<div class="env-container">
|
||||||
<div>
|
<div>
|
||||||
<div>{{ $t("commons.environment") }}:</div>
|
<div>{{ $t("commons.environment") }}:</div>
|
||||||
<env-select-popover
|
<env-select-popover
|
||||||
:project-ids="projectIds"
|
:project-ids="projectIds"
|
||||||
:project-list="projectList"
|
:project-list="projectList"
|
||||||
:project-env-map="projectEnvListMap"
|
:project-env-map="projectEnvListMap"
|
||||||
:environment-type.sync="runConfig.environmentType"
|
:environment-type.sync="runConfig.environmentType"
|
||||||
:has-option-group="true"
|
:has-option-group="true"
|
||||||
:is-env-saved="isEnvSaved"
|
:is-env-saved="isEnvSaved"
|
||||||
:group-id="runConfig.environmentGroupId"
|
:group-id="runConfig.environmentGroupId"
|
||||||
@setProjectEnvMap="setProjectEnvMap"
|
@setProjectEnvMap="setProjectEnvMap"
|
||||||
@setDefaultEnv="setDefaultEnv"
|
@setDefaultEnv="setDefaultEnv"
|
||||||
@setEnvGroup="setEnvGroup"
|
@setEnvGroup="setEnvGroup"
|
||||||
ref="envSelectPopover"
|
ref="envSelectPopover"
|
||||||
class="mode-row"
|
class="mode-row"
|
||||||
></env-select-popover>
|
></env-select-popover>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="haveUICase">
|
<div v-if="haveUICase">
|
||||||
<div>{{ $t("ui.browser") }}:</div>
|
<div>{{ $t("ui.browser") }}:</div>
|
||||||
<div>
|
<div>
|
||||||
<el-select
|
<el-select
|
||||||
size="mini"
|
size="mini"
|
||||||
v-model="runConfig.browser"
|
v-model="runConfig.browser"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
class="mode-row"
|
class="mode-row"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="b in browsers"
|
v-for="b in browsers"
|
||||||
:key="b.value"
|
:key="b.value"
|
||||||
:value="b.value"
|
:value="b.value"
|
||||||
:label="b.label"
|
:label="b.label"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,10 +46,10 @@
|
||||||
<div class="mode-row">{{ $t("run_mode.title") }}:</div>
|
<div class="mode-row">{{ $t("run_mode.title") }}:</div>
|
||||||
<div>
|
<div>
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="runConfig.mode"
|
v-model="runConfig.mode"
|
||||||
@change="changeMode"
|
@change="changeMode"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
class="radio-change mode-row"
|
class="radio-change mode-row"
|
||||||
>
|
>
|
||||||
<el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio>
|
<el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio>
|
||||||
<el-radio label="parallel">{{ $t("run_mode.parallel") }}</el-radio>
|
<el-radio label="parallel">{{ $t("run_mode.parallel") }}</el-radio>
|
||||||
|
@ -62,24 +60,18 @@
|
||||||
<div class="mode-row">{{ $t("run_mode.other_config") }}:</div>
|
<div class="mode-row">{{ $t("run_mode.other_config") }}:</div>
|
||||||
<div>
|
<div>
|
||||||
<!-- 资源池 -->
|
<!-- 资源池 -->
|
||||||
<div
|
<div class="mode-row" v-if="testType === 'API' && haveOtherExecCase">
|
||||||
class="mode-row"
|
|
||||||
v-if="
|
|
||||||
testType === 'API' &&
|
|
||||||
(haveOtherExecCase)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<span>{{ $t("run_mode.run_with_resource_pool") }}: </span>
|
<span>{{ $t("run_mode.run_with_resource_pool") }}: </span>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="runConfig.resourcePoolId"
|
v-model="runConfig.resourcePoolId"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="width: 100%; margin-top: 8px"
|
style="width: 100%; margin-top: 8px"
|
||||||
>
|
>
|
||||||
<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"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -88,8 +80,8 @@
|
||||||
<!-- 失败重试 -->
|
<!-- 失败重试 -->
|
||||||
<div class="mode-row">
|
<div class="mode-row">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-model="runConfig.retryEnable"
|
v-model="runConfig.retryEnable"
|
||||||
class="radio-change ms-failure-div-right"
|
class="radio-change ms-failure-div-right"
|
||||||
>
|
>
|
||||||
{{ $t("run_mode.retry_on_failure") }}
|
{{ $t("run_mode.retry_on_failure") }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
|
@ -97,19 +89,19 @@
|
||||||
<el-tooltip placement="top" style="margin: 0 4px 0 2px">
|
<el-tooltip placement="top" style="margin: 0 4px 0 2px">
|
||||||
<div slot="content">{{ $t("run_mode.retry_message") }}</div>
|
<div slot="content">{{ $t("run_mode.retry_message") }}</div>
|
||||||
<i
|
<i
|
||||||
class="el-icon-question"
|
class="el-icon-question"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
/> </el-tooltip
|
/> </el-tooltip
|
||||||
><br/>
|
><br />
|
||||||
<span>
|
<span>
|
||||||
{{ $t("run_mode.retry") }}
|
{{ $t("run_mode.retry") }}
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:value="runConfig.retryNum"
|
:value="runConfig.retryNum"
|
||||||
v-model="runConfig.retryNum"
|
v-model="runConfig.retryNum"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="10000000"
|
:max="10000000"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="width: 103px; margin-top: 8px"
|
style="width: 103px; margin-top: 8px"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{ $t("run_mode.retry_frequency") }}
|
{{ $t("run_mode.retry_frequency") }}
|
||||||
|
@ -119,14 +111,14 @@
|
||||||
|
|
||||||
<div class="mode-row" v-if="runConfig.mode === 'serial'">
|
<div class="mode-row" v-if="runConfig.mode === 'serial'">
|
||||||
<el-checkbox v-model="runConfig.onSampleError" class="radio-change"
|
<el-checkbox v-model="runConfig.onSampleError" class="radio-change"
|
||||||
>{{ $t("api_test.fail_to_stop") }}
|
>{{ $t("api_test.fail_to_stop") }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mode-row" v-if="haveUICase">
|
<div class="mode-row" v-if="haveUICase">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-model="runConfig.headlessEnabled"
|
v-model="runConfig.headlessEnabled"
|
||||||
class="radio-change"
|
class="radio-change"
|
||||||
>
|
>
|
||||||
{{ $t("ui.performance_mode") }}
|
{{ $t("ui.performance_mode") }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
|
@ -140,42 +132,48 @@
|
||||||
<el-button @click="close">{{ $t("commons.cancel") }}</el-button>
|
<el-button @click="close">{{ $t("commons.cancel") }}</el-button>
|
||||||
<el-dropdown @command="handleCommand" style="margin-left: 5px">
|
<el-dropdown @command="handleCommand" style="margin-left: 5px">
|
||||||
<el-button type="primary">
|
<el-button type="primary">
|
||||||
{{
|
{{ $t("api_test.run")
|
||||||
$t("api_test.run")
|
|
||||||
}}<i class="el-icon-arrow-down el-icon--right"></i>
|
}}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="run"
|
<el-dropdown-item command="run"
|
||||||
>{{ $t("api_test.run") }}
|
>{{ $t("api_test.run") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item command="runAndSave"
|
<el-dropdown-item command="runAndSave"
|
||||||
>{{ $t("load_test.save_and_run") }}
|
>{{ $t("load_test.save_and_run") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item command="save"
|
<el-dropdown-item command="save"
|
||||||
>{{ $t("commons.save") }}
|
>{{ $t("commons.save") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<ms-dialog-footer v-else @cancel="close" @confirm="handleRunBatch"/>
|
<ms-dialog-footer v-else @cancel="close" @confirm="handleRunBatch" />
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
||||||
import {strMapToObj} from "metersphere-frontend/src/utils";
|
import { strMapToObj } from "metersphere-frontend/src/utils";
|
||||||
import MsTag from "metersphere-frontend/src/components/MsTag";
|
import MsTag from "metersphere-frontend/src/components/MsTag";
|
||||||
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
|
import { ENV_TYPE } from "metersphere-frontend/src/utils/constants";
|
||||||
import {getCurrentProjectID, getOwnerProjects,} from "@/business/utils/sdk-utils";
|
import {
|
||||||
import {getQuotaValidResourcePools} from "@/api/remote/resource-pool";
|
getCurrentProjectID,
|
||||||
|
getOwnerProjects,
|
||||||
|
} from "@/business/utils/sdk-utils";
|
||||||
|
import { getQuotaValidResourcePools } from "@/api/remote/resource-pool";
|
||||||
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
||||||
import {getApiCaseEnv} from "@/api/remote/plan/test-plan-api-case";
|
import { getApiCaseEnv } from "@/api/remote/plan/test-plan-api-case";
|
||||||
import {getApiScenarioEnv, getPlanCaseEnv, getPlanCaseProjectIds,} from "@/api/remote/plan/test-plan";
|
import {
|
||||||
|
getApiScenarioEnv,
|
||||||
|
getPlanCaseEnv,
|
||||||
|
getPlanCaseProjectIds,
|
||||||
|
} from "@/api/remote/plan/test-plan";
|
||||||
import EnvGroupWithOption from "../env/EnvGroupWithOption";
|
import EnvGroupWithOption from "../env/EnvGroupWithOption";
|
||||||
import EnvironmentGroup from "@/business/plan/env/EnvironmentGroupList";
|
import EnvironmentGroup from "@/business/plan/env/EnvironmentGroupList";
|
||||||
import EnvSelectPopover from "@/business/plan/env/EnvSelectPopover";
|
import EnvSelectPopover from "@/business/plan/env/EnvSelectPopover";
|
||||||
import {getProjectConfig} from "@/api/project";
|
import { getProjectConfig } from "@/api/project";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsTestPlanRunModeWithEnv",
|
name: "MsTestPlanRunModeWithEnv",
|
||||||
|
@ -197,7 +195,7 @@ export default {
|
||||||
btnStyle: {
|
btnStyle: {
|
||||||
width: "260px",
|
width: "260px",
|
||||||
},
|
},
|
||||||
result: {loading: false},
|
result: { loading: false },
|
||||||
runModeVisible: false,
|
runModeVisible: false,
|
||||||
testType: null,
|
testType: null,
|
||||||
resourcePools: [],
|
resourcePools: [],
|
||||||
|
@ -267,10 +265,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
open(testType, runModeConfig) {
|
open(testType, runModeConfig) {
|
||||||
this.defaultEnvMap = {};
|
this.defaultEnvMap = {};
|
||||||
if (this.type === 'plan') {
|
if (this.type === "plan") {
|
||||||
if (runModeConfig) {
|
if (runModeConfig) {
|
||||||
this.runConfig = JSON.parse(runModeConfig);
|
this.runConfig = JSON.parse(runModeConfig);
|
||||||
if (!this.runConfig.envMap || JSON.stringify(this.runConfig.envMap) === "{}") {
|
if (
|
||||||
|
!this.runConfig.envMap ||
|
||||||
|
JSON.stringify(this.runConfig.envMap) === "{}"
|
||||||
|
) {
|
||||||
this.isEnvSaved = false;
|
this.isEnvSaved = false;
|
||||||
} else {
|
} else {
|
||||||
this.isEnvSaved = true;
|
this.isEnvSaved = true;
|
||||||
|
@ -278,8 +279,8 @@ export default {
|
||||||
this.runConfig.envMap = new Map();
|
this.runConfig.envMap = new Map();
|
||||||
this.runConfig.testPlanDefaultEnvMap = {};
|
this.runConfig.testPlanDefaultEnvMap = {};
|
||||||
this.runConfig.onSampleError =
|
this.runConfig.onSampleError =
|
||||||
this.runConfig.onSampleError === "true" ||
|
this.runConfig.onSampleError === "true" ||
|
||||||
this.runConfig.onSampleError === true;
|
this.runConfig.onSampleError === true;
|
||||||
} else {
|
} else {
|
||||||
this.isEnvSaved = false;
|
this.isEnvSaved = false;
|
||||||
}
|
}
|
||||||
|
@ -338,7 +339,8 @@ export default {
|
||||||
handleRunBatch() {
|
handleRunBatch() {
|
||||||
if (this.runConfig.resourcePoolId == null && this.haveOtherExecCase) {
|
if (this.runConfig.resourcePoolId == null && this.haveOtherExecCase) {
|
||||||
this.$warning(
|
this.$warning(
|
||||||
this.$t("workspace.env_group.please_select_run_within_resource_pool"));
|
this.$t("workspace.env_group.please_select_run_within_resource_pool")
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.runConfig.testPlanDefaultEnvMap = this.defaultEnvMap;
|
this.runConfig.testPlanDefaultEnvMap = this.defaultEnvMap;
|
||||||
|
@ -398,13 +400,13 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (this.type === "plan") {
|
} else if (this.type === "plan") {
|
||||||
param = {id: this.planId};
|
param = { id: this.planId };
|
||||||
getPlanCaseEnv(param).then((res) => {
|
getPlanCaseEnv(param).then((res) => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.projectEnvListMap = data;
|
this.projectEnvListMap = data;
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
@ -418,12 +420,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCommand(command) {
|
handleCommand(command) {
|
||||||
if (
|
if (this.runConfig.resourcePoolId == null && this.haveOtherExecCase) {
|
||||||
this.runConfig.resourcePoolId == null &&
|
|
||||||
this.haveOtherExecCase
|
|
||||||
) {
|
|
||||||
this.$warning(
|
this.$warning(
|
||||||
this.$t("workspace.env_group.please_select_run_within_resource_pool")
|
this.$t("workspace.env_group.please_select_run_within_resource_pool")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -442,6 +441,10 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
:deep(.el-dialog__body) {
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: 350px;
|
||||||
|
}
|
||||||
.env-container {
|
.env-container {
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
Loading…
Reference in New Issue