refactor(接口测试): 接口批量执行后刷新列表

This commit is contained in:
chenjianxing 2022-03-01 11:42:16 +08:00 committed by 刘瑞斌
parent 58a688b0e5
commit ede0559f5e
7 changed files with 35 additions and 6 deletions

View File

@ -286,11 +286,19 @@
<batch-edit ref="batchEdit" @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr" <batch-edit ref="batchEdit" @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr"
: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" :request="runRequest" ref="runMode"/> <ms-run-mode
<ms-run :debug="true" :environment="projectEnvMap" @runRefresh="runRefresh" :reportId="reportId" :saved="true" :request="runRequest"
@close="search"
@handleRunBatch="handleRunBatch"
ref="runMode"/>
<ms-run :debug="true" :environment="projectEnvMap"
:reportId="reportId"
:saved="true"
:executeType="'Saved'" :executeType="'Saved'"
:environment-type="environmentType" :environment-group-id="envGroupId" :environment-type="environmentType" :environment-group-id="envGroupId"
:run-data="debugData" ref="runTest"/> :run-data="debugData"
@runRefresh="runRefresh"
ref="runTest"/>
<ms-task-center ref="taskCenter" :show-menu="false"/> <ms-task-center ref="taskCenter" :show-menu="false"/>
<relationship-graph-drawer :graph-data="graphData" ref="relationshipGraph"/> <relationship-graph-drawer :graph-data="graphData" ref="relationshipGraph"/>
<!-- 删除接口提示 --> <!-- 删除接口提示 -->

View File

@ -3,6 +3,7 @@
destroy-on-close destroy-on-close
:title="$t('load_test.runtime_config')" :title="$t('load_test.runtime_config')"
width="550px" width="550px"
@close="close"
:visible.sync="runModeVisible" :visible.sync="runModeVisible"
> >
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
@ -145,6 +146,7 @@ export default {
resourcePoolId: null, resourcePoolId: null,
}; };
this.runModeVisible = false; this.runModeVisible = false;
this.$emit('close');
}, },
getWsProjects() { getWsProjects() {
this.$get("/project/listAll", res => { this.$get("/project/listAll", res => {

View File

@ -3,6 +3,7 @@
destroy-on-close destroy-on-close
:title="$t('load_test.runtime_config')" :title="$t('load_test.runtime_config')"
width="550px" width="550px"
@close="close"
:visible.sync="runModeVisible" :visible.sync="runModeVisible"
> >
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
@ -129,6 +130,7 @@ export default {
environmentType: ENV_TYPE.JSON environmentType: ENV_TYPE.JSON
}; };
this.runModeVisible = false; this.runModeVisible = false;
this.$emit('close');
}, },
handleRunBatch() { handleRunBatch() {
this.$emit("handleRunBatch", this.runConfig); this.$emit("handleRunBatch", this.runConfig);

View File

@ -227,7 +227,11 @@
<ms-task-center ref="taskCenter" :show-menu="false"/> <ms-task-center ref="taskCenter" :show-menu="false"/>
<ms-api-case-run-mode-with-env @handleRunBatch="runBatch" ref="batchRun" :project-id="projectId"/> <ms-api-case-run-mode-with-env
:project-id="projectId"
@handleRunBatch="runBatch"
@close="initTable"
ref="batchRun"/>
<el-dialog :close-on-click-modal="false" :title="$t('test_track.plan_view.test_result')" width="60%" <el-dialog :close-on-click-modal="false" :title="$t('test_track.plan_view.test_result')" width="60%"
:visible.sync="resVisible" class="api-import" destroy-on-close @close="resVisible=false"> :visible.sync="resVisible" class="api-import" destroy-on-close @close="resVisible=false">

View File

@ -3,6 +3,7 @@
destroy-on-close destroy-on-close
:title="$t('load_test.runtime_config')" :title="$t('load_test.runtime_config')"
width="550px" width="550px"
@close="close"
:visible.sync="runModeVisible" :visible.sync="runModeVisible"
> >
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
@ -133,6 +134,7 @@ export default {
environmentType: ENV_TYPE.JSON environmentType: ENV_TYPE.JSON
}; };
this.runModeVisible = false; this.runModeVisible = false;
this.$emit('close');
}, },
handleRunBatch() { handleRunBatch() {
this.$emit("handleRunBatch", this.runConfig); this.$emit("handleRunBatch", this.runConfig);

View File

@ -163,7 +163,12 @@
<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="$refs.table ? $refs.table.selectRows : new Set()" ref="batchEdit" @batchEdit="batchEdit"/> :select-row="$refs.table ? $refs.table.selectRows : new Set()" ref="batchEdit" @batchEdit="batchEdit"/>
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode" :plan-case-ids="testPlanCaseIds" :type="'apiCase'"/> <ms-plan-run-mode
:type="'apiCase'"
:plan-case-ids="testPlanCaseIds"
@close="search"
@handleRunBatch="handleRunBatch"
ref="runMode"/>
</el-card> </el-card>
<ms-task-center ref="taskCenter" :show-menu="false"/> <ms-task-center ref="taskCenter" :show-menu="false"/>
</div> </div>

View File

@ -184,7 +184,13 @@
<!-- 批量编辑 --> <!-- 批量编辑 -->
<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="this.$refs.table ? this.$refs.table.selectRows : new Set()" ref="batchEdit" @batchEdit="batchEdit"/> :select-row="this.$refs.table ? this.$refs.table.selectRows : new Set()" ref="batchEdit" @batchEdit="batchEdit"/>
<ms-plan-run-mode @handleRunBatch="handleRunBatch" ref="runMode" :plan-case-ids="planCaseIds" :type="'apiScenario'"/> <ms-plan-run-mode
:type="'apiScenario'"
:plan-case-ids="planCaseIds"
@close="search"
@handleRunBatch="handleRunBatch"
ref="runMode"/>
<ms-task-center ref="taskCenter" :show-menu="false"/> <ms-task-center ref="taskCenter" :show-menu="false"/>
</div> </div>
</template> </template>