This commit is contained in:
fit2-zhao 2020-12-24 17:36:14 +08:00
commit ea5ff734b6
9 changed files with 102 additions and 95 deletions

View File

@ -37,8 +37,8 @@
SELECT testCase.testCaseName AS caseName,testCase.testPlanName AS testPlan ,caseErrorCountData.dataCountNumber AS failureTimes,'apiCase' AS caseType
FROM (
SELECT apiCase.id AS testCaseID,apiCase.`name` AS testCaseName,group_concat(testPlan.`name`) AS testPlanName FROM api_test_case apiCase
LEFT JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id
LEFT JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id
INNER JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id
INNER JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id
GROUP BY apiCase.id
ORDER BY apiCase.create_time DESC
)testCase
@ -54,7 +54,7 @@
FROM api_scenario_report report
INNER JOIN api_scenario_report_detail reportDetail ON report.id = reportDetail.report_id
INNER JOIN api_scenario scene ON report.scenario_id = scene.id
LEFT JOIN
INNER JOIN
(
SELECT
apiScene.api_scenario_id,

View File

@ -192,5 +192,6 @@
SELECT acitem.`name`,acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
) ac on ar.scenario_id = ac.id
WHERE acr.project_id = #{projectId}
GROUP BY groupField;
</select>
</mapper>

View File

@ -160,6 +160,7 @@
WHERE sch.resource_id IN (
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR}
)
GROUP BY groupField;
</select>
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">

View File

@ -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);

View File

@ -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"

View File

@ -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"

View File

@ -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));

View File

@ -48,6 +48,7 @@
</el-table-column>
<el-table-column
sortable="custom"
prop="path"
:label="$t('api_test.definition.api_path')"
show-overflow-tooltip/>

@ -1 +1 @@
Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182
Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433