Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
921fe7d212
|
@ -34,7 +34,7 @@
|
|||
|
||||
<el-tab-pane name="add">
|
||||
<template v-slot:label>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini"/>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-tester/>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
<ms-scenario-results :scenarios="content.scenarios" v-on:requestResult="requestResult"/>
|
||||
</div>
|
||||
<!--<el-collapse-transition>-->
|
||||
<!--<div v-show="isActive" style="width: 99%">-->
|
||||
<!--<ms-request-result-tail v-if="isRequestResult" :request-type="requestType" :request="request"-->
|
||||
<!--:scenario-name="scenarioName"/>-->
|
||||
<!--</div>-->
|
||||
<!--<div v-show="isActive" style="width: 99%">-->
|
||||
<!--<ms-request-result-tail v-if="isRequestResult" :request-type="requestType" :request="request"-->
|
||||
<!--:scenario-name="scenarioName"/>-->
|
||||
<!--</div>-->
|
||||
<!--</el-collapse-transition>-->
|
||||
<ms-api-report-export v-if="reportExportVisible" id="apiTestReport" :title="report.testName"
|
||||
:content="content" :total-time="totalTime"/>
|
||||
|
@ -38,7 +38,7 @@
|
|||
import MsApiReportExport from "./ApiReportExport";
|
||||
import MsApiReportViewHeader from "./ApiReportViewHeader";
|
||||
import {RequestFactory} from "../../definition/model/ApiTestModel";
|
||||
import {windowPrint} from "@/common/js/utils";
|
||||
import {windowPrint, getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsApiReport",
|
||||
|
@ -166,16 +166,9 @@
|
|||
this.$warning(this.$t('api_test.automation.report_name_info'));
|
||||
return;
|
||||
}
|
||||
if (!this.currentProjectId) {
|
||||
this.$warning(this.$t('api_test.select_project'));
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
this.report.projectId = this.currentProjectId;
|
||||
let url = "/api/scenario/report/add";
|
||||
if (this.infoDb === true) {
|
||||
url = "/api/scenario/report/update";
|
||||
}
|
||||
this.report.projectId = getCurrentProjectID();
|
||||
let url = "/api/scenario/report/update";
|
||||
this.result = this.$post(url, this.report, response => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.loading = false;
|
||||
|
|
|
@ -50,14 +50,14 @@
|
|||
<el-table-column :label="$t('commons.operating')" width="200px" v-if="!referenced">
|
||||
<template v-slot:default="{row}">
|
||||
<div v-if="trashEnable">
|
||||
<el-button type="text" @click="reductionApi(row)">{{$t('commons.reduction')}}</el-button>
|
||||
<el-button type="text" @click="remove(row)">{{ $t('api_test.automation.remove') }}</el-button>
|
||||
<el-button type="text" @click="reductionApi(row)" v-tester>{{$t('commons.reduction')}}</el-button>
|
||||
<el-button type="text" @click="remove(row)" v-tester>{{ $t('api_test.automation.remove') }}</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-button type="text" @click="edit(row)">{{ $t('api_test.automation.edit') }}</el-button>
|
||||
<el-button type="text" @click="execute(row)">{{ $t('api_test.automation.execute') }}</el-button>
|
||||
<el-button type="text" @click="copy(row)">{{ $t('api_test.automation.copy') }}</el-button>
|
||||
<el-button type="text" @click="remove(row)">{{ $t('api_test.automation.remove') }}</el-button>
|
||||
<el-button type="text" @click="edit(row)" v-tester>{{ $t('api_test.automation.edit') }}</el-button>
|
||||
<el-button type="text" @click="execute(row)" v-tester>{{ $t('api_test.automation.execute') }}</el-button>
|
||||
<el-button type="text" @click="copy(row)" v-tester>{{ $t('api_test.automation.copy') }}</el-button>
|
||||
<el-button type="text" @click="remove(row)" v-tester>{{ $t('api_test.automation.remove') }}</el-button>
|
||||
<ms-scenario-extend-buttons :row="row"/>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -161,7 +161,7 @@
|
|||
if (this.projectId != null) {
|
||||
this.condition.projectId = this.projectId;
|
||||
}
|
||||
|
||||
this.selection = [];
|
||||
let url = "/api/automation/list/" + this.currentPage + "/" + this.pageSize;
|
||||
this.$post(url, this.condition, response => {
|
||||
let data = response.data;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<el-input class="module-input" :placeholder="$t('test_track.module.search')" v-model="condition.filterText"
|
||||
size="small">
|
||||
<template v-slot:append>
|
||||
<el-button icon="el-icon-folder-add" @click="addScenario"/>
|
||||
<el-button icon="el-icon-folder-add" @click="addScenario" v-tester/>
|
||||
</template>
|
||||
</el-input>
|
||||
<module-trash-button v-if="!isReadOnly" :condition="condition" :exe="enableTrash"/>
|
||||
|
|
|
@ -337,94 +337,6 @@
|
|||
buttons() {
|
||||
let buttons = [
|
||||
{
|
||||
title: this.$t('api_test.automation.api_list_import'),
|
||||
show: this.showButton("HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler"),
|
||||
titleColor: "#F56C6C",
|
||||
titleBgColor: "#FCF1F1",
|
||||
icon: "api",
|
||||
click: this.apiListImport
|
||||
}, {
|
||||
title: this.$t('api_test.automation.external_import'),
|
||||
show: this.showButton("OT_IMPORT"),
|
||||
titleColor: "#409EFF",
|
||||
titleBgColor: "#EEF5FE",
|
||||
icon: "next_plan",
|
||||
click: () => {
|
||||
this.addComponent('OT_IMPORT')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.wait_controller'),
|
||||
show: this.showButton("ConstantTimer"),
|
||||
titleColor: "#67C23A",
|
||||
titleBgColor: "#F2F9EE",
|
||||
icon: "access_time",
|
||||
click: () => {
|
||||
this.addComponent('ConstantTimer')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.if_controller'),
|
||||
show: this.showButton("IfController"),
|
||||
titleColor: "#E6A23C",
|
||||
titleBgColor: "#FCF6EE",
|
||||
icon: "alt_route",
|
||||
click: () => {
|
||||
this.addComponent('IfController')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.scenario_import'),
|
||||
show: this.operatingElements.indexOf('scenario') === 0,
|
||||
titleColor: "#606266",
|
||||
titleBgColor: "#F4F4F5",
|
||||
icon: "movie",
|
||||
click: () => {
|
||||
this.addComponent('scenario')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.customize_script'),
|
||||
show: this.showButton("JSR223Processor"),
|
||||
titleColor: "#7B4D12",
|
||||
titleBgColor: "#F1EEE9",
|
||||
icon: "code",
|
||||
click: () => {
|
||||
this.addComponent('JSR223Processor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.customize_req'),
|
||||
show: this.showButton("CustomizeReq"),
|
||||
titleColor: "#008080",
|
||||
titleBgColor: "#EBF2F2",
|
||||
icon: "tune",
|
||||
click: () => {
|
||||
this.addComponent('CustomizeReq')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.pre_script'),
|
||||
show: this.showButton("JSR223PreProcessor"),
|
||||
titleColor: "#B8741A",
|
||||
titleBgColor: "#F9F1EA",
|
||||
icon: "skip_previous",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PreProcessor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.post_script'),
|
||||
show: this.showButton("JSR223PostProcessor"),
|
||||
titleColor: "#783887",
|
||||
titleBgColor: "#F2ECF3",
|
||||
icon: "skip_next",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PostProcessor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.assertions_rule'),
|
||||
show: this.showButton("Assertions"),
|
||||
titleColor: "#A30014",
|
||||
titleBgColor: "#F7E6E9",
|
||||
icon: "fact_check",
|
||||
click: () => {
|
||||
this.addComponent('Assertions')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.extract_param'),
|
||||
show: this.showButton("Extract"),
|
||||
titleColor: "#015478",
|
||||
|
@ -433,6 +345,94 @@
|
|||
click: () => {
|
||||
this.addComponent('Extract')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.definition.request.post_script'),
|
||||
show: this.showButton("JSR223PostProcessor"),
|
||||
titleColor: "#783887",
|
||||
titleBgColor: "#F2ECF3",
|
||||
icon: "skip_next",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PostProcessor')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.definition.request.pre_script'),
|
||||
show: this.showButton("JSR223PreProcessor"),
|
||||
titleColor: "#B8741A",
|
||||
titleBgColor: "#F9F1EA",
|
||||
icon: "skip_previous",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PreProcessor')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.automation.customize_script'),
|
||||
show: this.showButton("JSR223Processor"),
|
||||
titleColor: "#7B4D12",
|
||||
titleBgColor: "#F1EEE9",
|
||||
icon: "code",
|
||||
click: () => {
|
||||
this.addComponent('JSR223Processor')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.automation.if_controller'),
|
||||
show: this.showButton("IfController"),
|
||||
titleColor: "#E6A23C",
|
||||
titleBgColor: "#FCF6EE",
|
||||
icon: "alt_route",
|
||||
click: () => {
|
||||
this.addComponent('IfController')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.automation.wait_controller'),
|
||||
show: this.showButton("ConstantTimer"),
|
||||
titleColor: "#67C23A",
|
||||
titleBgColor: "#F2F9EE",
|
||||
icon: "access_time",
|
||||
click: () => {
|
||||
this.addComponent('ConstantTimer')
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: this.$t('api_test.automation.external_import'),
|
||||
// show: this.showButton("OT_IMPORT"),
|
||||
// titleColor: "#409EFF",
|
||||
// titleBgColor: "#EEF5FE",
|
||||
// icon: "next_plan",
|
||||
// click: () => {
|
||||
// this.addComponent('OT_IMPORT')
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: this.$t('api_test.automation.customize_req'),
|
||||
show: this.showButton("CustomizeReq"),
|
||||
titleColor: "#008080",
|
||||
titleBgColor: "#EBF2F2",
|
||||
icon: "tune",
|
||||
click: () => {
|
||||
this.addComponent('CustomizeReq')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.automation.scenario_import'),
|
||||
show: this.operatingElements.indexOf('scenario') === 0,
|
||||
titleColor: "#606266",
|
||||
titleBgColor: "#F4F4F5",
|
||||
icon: "movie",
|
||||
click: () => {
|
||||
this.addComponent('scenario')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.automation.api_list_import'),
|
||||
show: this.showButton("HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler"),
|
||||
titleColor: "#F56C6C",
|
||||
titleBgColor: "#FCF1F1",
|
||||
icon: "api",
|
||||
click: this.apiListImport
|
||||
}
|
||||
];
|
||||
return buttons.filter(btn => btn.show);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog class="api-relevance" :title="$t('test_track.plan_view.relevance_test_case')"
|
||||
<el-dialog class="api-relevance" :title="'接口导入'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="60%"
|
||||
:close-on-click-modal="false"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog class="api-relevance" :title="$t('test_track.plan_view.relevance_test_case')"
|
||||
<el-dialog class="api-relevance" :title="'场景导入'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="60%"
|
||||
:close-on-click-modal="false"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<ms-main-container>
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-buttion"
|
||||
@click="handleCommand('ADD')"
|
||||
@command="handleCommand">
|
||||
@command="handleCommand" v-tester>
|
||||
{{$t('commons.add')}}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="debug">{{$t('api_test.definition.request.fast_debug')}}</el-dropdown-item>
|
||||
|
@ -242,8 +242,12 @@
|
|||
this.showCasePage = true;
|
||||
},
|
||||
exportAPI() {
|
||||
if (!this.isApiListEnable) {
|
||||
this.$warning('用例列表暂不支持导出,请切换成接口列表');
|
||||
return;
|
||||
}
|
||||
let obj = {projectName: getCurrentProjectID(), protocol: this.currentProtocol}
|
||||
if (this.$refs.apiList[0].selectRows && this.$refs.apiList[0].selectRows.length > 0) {
|
||||
if (this.$refs.apiList[0].selectRows && this.$refs.apiList[0].selectRows.size > 0) {
|
||||
let arr = Array.from(this.$refs.apiList[0].selectRows);
|
||||
obj.data = arr;
|
||||
downloadFile("导出API.json", JSON.stringify(obj));
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</el-col>
|
||||
<el-col :span="2" v-if="!(isReadOnly || isCaseEdit)">
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-header-select" @click="addCase"
|
||||
@command="handleCommand">
|
||||
@command="handleCommand" v-tester>
|
||||
+{{$t('api_test.definition.request.case')}}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="run">{{$t('commons.test')}}</el-dropdown-item>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
@blur="saveTestCase(apiCase)" placeholder="请输入用例名称"/>
|
||||
<span v-else>
|
||||
{{apiCase.id ? apiCase.name:''}}
|
||||
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)"/>
|
||||
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)" v-tester/>
|
||||
</span>
|
||||
<div v-if="apiCase.id" style="color: #999999;font-size: 12px">
|
||||
<span>
|
||||
|
@ -35,12 +35,12 @@
|
|||
|
||||
<el-col :span="4">
|
||||
<ms-tip-button @click="singleRun(apiCase)" :tip="$t('api_test.run')" icon="el-icon-video-play"
|
||||
style="background-color: #409EFF;color: white" size="mini" :disabled="!apiCase.id" circle/>
|
||||
style="background-color: #409EFF;color: white" size="mini" :disabled="!apiCase.id" circle v-tester/>
|
||||
<ms-tip-button @click="copyCase(apiCase)" :tip="$t('commons.copy')" icon="el-icon-document-copy"
|
||||
size="mini" :disabled="!apiCase.id || isCaseEdit" circle/>
|
||||
size="mini" :disabled="!apiCase.id || isCaseEdit" circle v-tester/>
|
||||
<ms-tip-button @click="deleteCase(index,apiCase)" :tip="$t('commons.delete')" icon="el-icon-delete"
|
||||
size="mini" :disabled="!apiCase.id || isCaseEdit" circle/>
|
||||
<ms-api-extend-btns :is-case-edit="isCaseEdit" :row="apiCase"/>
|
||||
size="mini" :disabled="!apiCase.id || isCaseEdit" circle v-tester/>
|
||||
<ms-api-extend-btns :is-case-edit="isCaseEdit" :row="apiCase" v-tester/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="3">
|
||||
|
@ -64,7 +64,7 @@
|
|||
<ms-sql-basis-parameters :request="apiCase.request" v-if="api.protocol==='SQL'"/>
|
||||
<ms-dubbo-basis-parameters :request="apiCase.request" v-if="api.protocol==='DUBBO'"/>
|
||||
<!-- 保存操作 -->
|
||||
<el-button type="primary" size="small" style="margin: 20px; float: right" @click="saveTestCase(apiCase)">
|
||||
<el-button type="primary" size="small" style="margin: 20px; float: right" @click="saveTestCase(apiCase)" v-tester>
|
||||
{{$t('commons.save')}}
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
sortable="custom"
|
||||
prop="path"
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip/>
|
||||
|
|
|
@ -78,10 +78,10 @@
|
|||
|
||||
<el-table-column v-if="!isReadOnly && !isRelevance" :label="$t('commons.operating')" min-width="130" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<el-button type="text" @click="reductionApi(scope.row)" v-if="trashEnable">{{$t('commons.reduction')}}</el-button>
|
||||
<el-button type="text" @click="editApi(scope.row)" v-else>{{$t('commons.edit')}}</el-button>
|
||||
<el-button type="text" @click="reductionApi(scope.row)" v-if="trashEnable" v-tester>{{$t('commons.reduction')}}</el-button>
|
||||
<el-button type="text" @click="editApi(scope.row)" v-else v-tester>{{$t('commons.edit')}}</el-button>
|
||||
<el-button type="text" @click="handleTestCase(scope.row)">{{$t('api_test.definition.request.case')}}</el-button>
|
||||
<el-button type="text" @click="handleDelete(scope.row)" style="color: #F56C6C">{{$t('commons.delete')}}</el-button>
|
||||
<el-button type="text" @click="handleDelete(scope.row)" style="color: #F56C6C" v-tester>{{$t('commons.delete')}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182
|
||||
Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433
|
Loading…
Reference in New Issue