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

View File

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

View File

@ -161,6 +161,7 @@
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/>
</el-card>
<ms-task-center ref="taskCenter"/>
</div>
</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 MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTaskCenter from "../../../../../task/TaskCenter";
export default {
name: "TestPlanApiCaseList",
@ -228,7 +229,8 @@ export default {
MsBottomContainer,
ShowMoreBtn,
MsTableHeaderSelectPopover,
MsPlanRunMode
MsPlanRunMode,
MsTaskCenter
},
data() {
return {
@ -624,6 +626,7 @@ export default {
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => {
this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
});
} else {
testPlan.serializeThreadgroups = false;
@ -643,6 +646,7 @@ export default {
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => {
this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
});
}
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"
:select-row="selectRows" ref="batchEdit" @batchEdit="batchEdit"/>
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode"/>
<ms-task-center ref="taskCenter"/>
</div>
</template>
@ -164,6 +165,7 @@ import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
import MsTaskCenter from "../../../../../task/TaskCenter";
export default {
name: "MsTestPlanApiScenarioList",
@ -183,7 +185,8 @@ export default {
MsTestPlanList,
BatchEdit,
MsPlanRunMode,
MsTableHeaderSelectPopover
MsTableHeaderSelectPopover,
MsTaskCenter
},
props: {
referenced: {
@ -350,6 +353,7 @@ export default {
});
this.$post("/test/case/review/scenario/case/run", param, response => {
this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
});
}
if (this.planId) {
@ -362,6 +366,7 @@ export default {
param.triggerMode = "BATCH";
this.$post("/test/plan/scenario/case/run", param, response => {
this.$message('任务执行中,请稍后刷新查看结果');
this.$refs.taskCenter.open();
});
}
this.search();