feat(接口自动化): 批量执行自动弹出任务中心

This commit is contained in:
fit2-zhao 2021-06-15 10:01:08 +08:00 committed by fit2-zhao
parent 61be97d3c5
commit 45478e153d
4 changed files with 20 additions and 4 deletions

View File

@ -175,6 +175,7 @@
:dialog-title="$t('test_track.case.batch_edit_case')"/> :dialog-title="$t('test_track.case.batch_edit_case')"/>
<batch-move @refresh="search" @moveSave="moveSave" ref="testBatchMove"/> <batch-move @refresh="search" @moveSave="moveSave" ref="testBatchMove"/>
<ms-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/> <ms-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/>
<ms-task-center ref="taskCenter"/>
</div> </div>
</template> </template>
@ -198,6 +199,7 @@ import {API_SCENARIO_LIST, PROJECT_NAME, WORKSPACE_ID} from "../../../../../comm
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect"; import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
import BatchMove from "../../../track/case/components/BatchMove"; import BatchMove from "../../../track/case/components/BatchMove";
import MsRunMode from "./common/RunMode"; import MsRunMode from "./common/RunMode";
import MsTaskCenter from "../../../task/TaskCenter";
import { import {
getCustomTableHeader, getCustomTableWidth, getCustomTableHeader, getCustomTableWidth,
@ -230,7 +232,8 @@ export default {
MsScenarioExtendButtons, MsScenarioExtendButtons,
MsTestPlanList, MsTestPlanList,
MsTableOperatorButton, MsTableOperatorButton,
MsRunMode MsRunMode,
MsTaskCenter
}, },
props: { props: {
referenced: { referenced: {
@ -619,6 +622,7 @@ export default {
if (this.batchReportId) { if (this.batchReportId) {
this.result.loading = false; this.result.loading = false;
this.$success("批量执行成功,请到报告页面查看详情!"); this.$success("批量执行成功,请到报告页面查看详情!");
this.$refs.taskCenter.open();
} }
}, },
buildBatchParam(param) { buildBatchParam(param) {

View File

@ -106,6 +106,9 @@ export default {
close() { close() {
this.visible = false; this.visible = false;
}, },
open(){
this.showTaskCenter();
},
getPercentage(status) { getPercentage(status) {
if (status === 'Saved' || status === 'Completed' || status === 'success' || status === 'error') { if (status === 'Saved' || status === 'Completed' || status === 'success' || status === 'error') {
return 100; return 100;

View File

@ -161,6 +161,7 @@
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/> <ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/>
</el-card> </el-card>
<ms-task-center ref="taskCenter"/>
</div> </div>
</template> </template>
@ -205,7 +206,7 @@ import {Test_Plan_Api_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import MsPlanRunMode from "../../../common/PlanRunMode"; import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTaskCenter from "../../../../../task/TaskCenter";
export default { export default {
name: "TestPlanApiCaseList", name: "TestPlanApiCaseList",
@ -228,7 +229,8 @@ export default {
MsBottomContainer, MsBottomContainer,
ShowMoreBtn, ShowMoreBtn,
MsTableHeaderSelectPopover, MsTableHeaderSelectPopover,
MsPlanRunMode MsPlanRunMode,
MsTaskCenter
}, },
data() { data() {
return { return {
@ -624,6 +626,7 @@ export default {
let bodyFiles = getBodyUploadFiles(reqObj, this.runData); let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => { this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => {
this.$message('任务执行中,请稍后刷新查看结果'); this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
}); });
} else { } else {
testPlan.serializeThreadgroups = false; testPlan.serializeThreadgroups = false;
@ -643,6 +646,7 @@ export default {
let bodyFiles = getBodyUploadFiles(reqObj, this.runData); let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => { this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => {
this.$message('任务执行中,请稍后刷新查看结果'); this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
}); });
} }
this.search(); this.search();

View File

@ -127,6 +127,7 @@
<batch-edit :dialog-title="$t('test_track.case.batch_edit_case')" :type-arr="typeArr" :value-arr="valueArr" <batch-edit :dialog-title="$t('test_track.case.batch_edit_case')" :type-arr="typeArr" :value-arr="valueArr"
:select-row="selectRows" ref="batchEdit" @batchEdit="batchEdit"/> :select-row="selectRows" ref="batchEdit" @batchEdit="batchEdit"/>
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/> <ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/>
<ms-task-center ref="taskCenter"/>
</div> </div>
</template> </template>
@ -164,6 +165,7 @@ import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants"; import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
import MsTaskCenter from "../../../../../task/TaskCenter";
export default { export default {
name: "MsTestPlanApiScenarioList", name: "MsTestPlanApiScenarioList",
@ -183,7 +185,8 @@ export default {
MsTestPlanList, MsTestPlanList,
BatchEdit, BatchEdit,
MsPlanRunMode, MsPlanRunMode,
MsTableHeaderSelectPopover MsTableHeaderSelectPopover,
MsTaskCenter
}, },
props: { props: {
referenced: { referenced: {
@ -350,6 +353,7 @@ export default {
}); });
this.$post("/test/case/review/scenario/case/run", param, response => { this.$post("/test/case/review/scenario/case/run", param, response => {
this.$message('任务执行中,请稍后刷新查看结果'); this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
}); });
} }
if (this.planId) { if (this.planId) {
@ -362,6 +366,7 @@ export default {
param.triggerMode = "BATCH"; param.triggerMode = "BATCH";
this.$post("/test/plan/scenario/case/run", param, response => { this.$post("/test/plan/scenario/case/run", param, response => {
this.$message('任务执行中,请稍后刷新查看结果'); this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
}); });
} }
this.search(); this.search();