fix(接口自动化): 修改执行步骤为 生成报告,自动生成测试报告。

This commit is contained in:
fit2-zhao 2021-06-30 15:02:20 +08:00 committed by fit2-zhao
parent 01cbbc99df
commit 69013f62ed
8 changed files with 16 additions and 6 deletions

View File

@ -160,6 +160,9 @@ public class ApiAutomationController {
public void runDebug(@RequestPart("request") RunDefinitionRequest request,
@RequestPart(value = "bodyFiles", required = false) List<MultipartFile> bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) {
request.setExecuteType(ExecuteType.Debug.name());
if (request.isSaved()) {
request.setExecuteType(ExecuteType.Saved.name());
}
apiAutomationService.debugRun(request, bodyFiles, scenarioFiles);
}
@ -245,6 +248,7 @@ public class ApiAutomationController {
public List<JmxInfoDTO> batchGenPerformanceTestJmx(@RequestBody ApiScenarioBatchRequest request) {
return apiAutomationService.batchGenPerformanceTestJmx(request);
}
@PostMapping("/batchCopy")
public void batchCopy(@RequestBody ApiScenarioBatchRequest request) {
apiAutomationService.batchCopy(request);

View File

@ -17,6 +17,8 @@ public class RunDefinitionRequest {
private String reportId;
private boolean saved;
private String requestId;
private String name;

View File

@ -14,6 +14,7 @@ import {saveScenario} from "@/business/components/api/automation/api-automation"
debug: Boolean,
reportId: String,
runData: Object,
saved: Boolean,
},
data() {
return {
@ -42,7 +43,7 @@ import {saveScenario} from "@/business/components/api/automation/api-automation"
this.runData.projectId = getCurrentProjectID();
threadGroup.hashTree.push(this.runData);
testPlan.hashTree.push(threadGroup);
let reqObj = {id: this.reportId, reportId: this.reportId, scenarioName: this.runData.name,
let reqObj = {id: this.reportId, reportId: this.reportId, scenarioName: this.runData.name,saved:this.saved,
scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map)};
saveScenario('/api/automation/run/debug', reqObj, this.runData.hashTree, (response) => {
this.runId = response.data;

View File

@ -146,7 +146,7 @@
<el-dropdown split-button type="primary" @click="runDebug" class="ms-message-right" size="mini" @command="handleCommand" v-if="!debugLoading">
{{ $t('api_test.request.debug') }}
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>{{ $t('test_track.case.steps') }}</el-dropdown-item>
<el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button icon="el-icon-loading" size="mini" type="primary" :disabled="debug" v-else>执行中</el-button>
@ -235,13 +235,13 @@
<api-environment-config v-if="type!=='detail'" ref="environmentConfig" @close="environmentConfigClose"/>
<!--执行组件-->
<ms-run :debug="true" v-if="type!=='detail'" :environment="projectEnvMap" :reportId="reportId"
<ms-run :debug="true" v-if="type!=='detail'" :environment="projectEnvMap" :reportId="reportId" :saved="!debug"
:run-data="debugData"
@runRefresh="runRefresh" ref="runTest"/>
<!-- 调试结果 -->
<el-drawer v-if="type!=='detail'" :visible.sync="debugVisible" :destroy-on-close="true" direction="ltr"
:withHeader="true" :modal="false" size="90%">
<ms-api-report-detail :report-id="reportId" :debug="debug" :currentProjectId="projectId" @refresh="detailRefresh"/>
<ms-api-report-detail :report-id="reportId" :debug="true" :currentProjectId="projectId" @refresh="detailRefresh"/>
</el-drawer>
<!--场景公共参数-->

View File

@ -19,7 +19,7 @@
</div>
<div class="ms-header-right">
<el-checkbox v-model="cookieShare" @change="setCookieShare">共享cookie</el-checkbox>
<el-checkbox v-model="sampleError" @change="setOnSampleError" style="margin-right: 10px">失败继续</el-checkbox>
<el-checkbox v-model="sampleError" @change="setOnSampleError" style="margin-right: 10px">{{$t('commons.failure_continues')}}</el-checkbox>
<env-popover :disabled="scenarioDefinition.length < 1" :isReadOnly="scenarioDefinition.length < 1"
:env-map="envMap" :project-ids="projectIds" @setProjectEnvMap="setProjectEnvMap"
@showPopover="showPopover" :project-list="projectList" ref="envPopover" class="ms-right"
@ -28,7 +28,7 @@
<el-dropdown split-button type="primary" @click="runDebug" style="margin-right: 10px" size="mini" @command="handleCommand" v-if="!debug">
{{ $t('api_test.request.debug') }}
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>{{ $t('test_track.case.steps') }}</el-dropdown-item>
<el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button icon="el-icon-loading" size="mini" type="primary" :disabled="debug" v-else>执行中</el-button>

View File

@ -930,6 +930,7 @@ export default {
request_total: "request",
request_success: "success",
request_error: "error",
generate_report: "Generate report",
},
environment: {
create: 'Create environment',

View File

@ -929,6 +929,7 @@ export default {
request_total: "请求",
request_success: "成功",
request_error: "失败",
generate_report: "生成报告",
},
environment: {
create: '创建环境',

View File

@ -930,6 +930,7 @@ export default {
request_total: "請求",
request_success: "成功",
request_error: "失敗",
generate_report: "生成報告",
},
environment: {
create: '創建環境',