fix(测试计划): 修复测试计划导出时资源池没展示、失败重跑按钮没隐藏的问题
--bug=1024375 --user=宋天阳 【测试跟踪】测试计划最终报告导出,不显示“失败重跑”按钮 https://www.tapd.cn/55049933/s/1349388
This commit is contained in:
parent
9d058155cb
commit
857bfefa9d
|
@ -78,16 +78,4 @@ public class ShareController {
|
||||||
HttpHeaderUtils.clearUser();
|
HttpHeaderUtils.clearUser();
|
||||||
return reportExtInfo;
|
return reportExtInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("test/plan/ext/plan/{shareId}/{planId}")
|
|
||||||
public ExecutionModeDTO getExtPlan(@PathVariable String shareId, @PathVariable String planId) throws JsonProcessingException {
|
|
||||||
shareInfoService.validate(shareId, planId);
|
|
||||||
if (SessionUtils.getUser() == null) {
|
|
||||||
HttpHeaderUtils.runAsUser("admin");
|
|
||||||
}
|
|
||||||
// testPlanService.getExtInfoByPlanId 这个方法逻辑有问题。分不清楚干嘛用的。方法删了,调用地方先注释了。
|
|
||||||
// TestPlanExtReportDTO reportExtInfo = testPlanService.getExtInfoByPlanId(planId);
|
|
||||||
HttpHeaderUtils.clearUser();
|
|
||||||
return new ExecutionModeDTO();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ import io.metersphere.dto.TestPlanRerunParametersDTO;
|
||||||
import io.metersphere.i18n.Translator;
|
import io.metersphere.i18n.Translator;
|
||||||
import io.metersphere.log.annotation.MsAuditLog;
|
import io.metersphere.log.annotation.MsAuditLog;
|
||||||
import io.metersphere.notice.annotation.SendNotice;
|
import io.metersphere.notice.annotation.SendNotice;
|
||||||
import io.metersphere.plan.dto.ExecutionModeDTO;
|
|
||||||
import io.metersphere.plan.dto.TestCaseReportStatusResultDTO;
|
import io.metersphere.plan.dto.TestCaseReportStatusResultDTO;
|
||||||
import io.metersphere.plan.dto.TestPlanDTO;
|
import io.metersphere.plan.dto.TestPlanDTO;
|
||||||
import io.metersphere.plan.dto.TestPlanReportDataStruct;
|
import io.metersphere.plan.dto.TestPlanReportDataStruct;
|
||||||
|
@ -380,14 +379,4 @@ public class TestPlanController {
|
||||||
public void resetStatus(@PathVariable String planId) {
|
public void resetStatus(@PathVariable String planId) {
|
||||||
testPlanService.resetStatus(planId);
|
testPlanService.resetStatus(planId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/ext/report/{reportId}")
|
|
||||||
public ExecutionModeDTO getExtReport(@PathVariable String reportId) throws JsonProcessingException {
|
|
||||||
return new ExecutionModeDTO();
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/ext/plan/{planId}")
|
|
||||||
public ExecutionModeDTO getExtPlan(@PathVariable String planId) throws JsonProcessingException {
|
|
||||||
return new ExecutionModeDTO();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1124,7 +1124,11 @@ public class TestPlanReportService {
|
||||||
});
|
});
|
||||||
String resourcePoolNames = StringUtils.join(resourcePoolName.toArray(), StringUtils.SPACE);
|
String resourcePoolNames = StringUtils.join(resourcePoolName.toArray(), StringUtils.SPACE);
|
||||||
report.setResourcePool(resourcePoolNames);
|
report.setResourcePool(resourcePoolNames);
|
||||||
|
} else {
|
||||||
|
report.setResourcePool("LOCAL");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
report.setResourcePool("LOCAL");
|
||||||
}
|
}
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
@ -1156,7 +1160,11 @@ public class TestPlanReportService {
|
||||||
});
|
});
|
||||||
String resourcePoolNames = StringUtils.join(resourcePoolName.toArray(), StringUtils.SPACE);
|
String resourcePoolNames = StringUtils.join(resourcePoolName.toArray(), StringUtils.SPACE);
|
||||||
testPlanReportDTO.setResourcePool(resourcePoolNames);
|
testPlanReportDTO.setResourcePool(resourcePoolNames);
|
||||||
|
} else {
|
||||||
|
testPlanReportDTO.setResourcePool("LOCAL");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
testPlanReportDTO.setResourcePool("LOCAL");
|
||||||
}
|
}
|
||||||
// 环境组/运行环境
|
// 环境组/运行环境
|
||||||
if (StringUtils.isNotEmpty(runInfoDTO.getEnvGroupId())) {
|
if (StringUtils.isNotEmpty(runInfoDTO.getEnvGroupId())) {
|
||||||
|
|
|
@ -390,23 +390,3 @@ export function reportSocket(reportId) {
|
||||||
export function testPlanLoadCaseEditStatus(planId) {
|
export function testPlanLoadCaseEditStatus(planId) {
|
||||||
return post(BASE_URL + `edit/status/${planId}`, new Promise(() => {}));
|
return post(BASE_URL + `edit/status/${planId}`, new Promise(() => {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTestPlanExtReport(planId, reportId) {
|
|
||||||
if (reportId) {
|
|
||||||
return get(BASE_URL + "ext/report/" + reportId);
|
|
||||||
} else if (planId) {
|
|
||||||
return get(BASE_URL + "ext/plan/" + planId);
|
|
||||||
} else {
|
|
||||||
return new Promise(() => {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getShareTestPlanExtReport(shareId, planId, reportId) {
|
|
||||||
if (reportId) {
|
|
||||||
return get("/share" + BASE_URL + `ext/report/${shareId}/${reportId}`);
|
|
||||||
} else if (planId) {
|
|
||||||
return get("/share" + BASE_URL + `ext/plan/${shareId}/${planId}`);
|
|
||||||
} else {
|
|
||||||
return new Promise(() => {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,56 +1,152 @@
|
||||||
<template>
|
<template>
|
||||||
<test-plan-report-container id="api" :title="$t('test_track.report.analysis_api')">
|
<test-plan-report-container
|
||||||
|
id="api"
|
||||||
|
:title="$t('test_track.report.analysis_api')"
|
||||||
|
>
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane v-if="resultEnable" :label="$t('test_track.report.test_result')" name="first">
|
<el-tab-pane
|
||||||
<api-result :api-result="report.apiResult"/>
|
v-if="resultEnable"
|
||||||
|
:label="$t('test_track.report.test_result')"
|
||||||
|
name="first"
|
||||||
|
>
|
||||||
|
<api-result :api-result="report.apiResult" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane v-if="failureEnable" name="second">
|
<el-tab-pane v-if="failureEnable" name="second">
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<tab-pane-count :title="$t('test_track.report.fail_case')" :count="failureSize"/>
|
<tab-pane-count
|
||||||
|
:title="$t('test_track.report.fail_case')"
|
||||||
|
:count="failureSize"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<api-cases :is-db="isDb" :share-id="shareId" :is-share="isShare" :report="report" :is-template="isTemplate"
|
<api-cases
|
||||||
:plan-id="planId" @setSize="setFailureSize"/>
|
:is-db="isDb"
|
||||||
<el-button class="rerun-button" plain size="mini"
|
:share-id="shareId"
|
||||||
v-if="showRerunBtn && (failureSize > 0 || unExecuteSize > 0) && isRerun" @click="rerun">
|
:is-share="isShare"
|
||||||
{{ $t('api_test.automation.rerun') }}
|
:report="report"
|
||||||
|
:is-template="isTemplate"
|
||||||
|
:plan-id="planId"
|
||||||
|
@setSize="setFailureSize"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="rerun-button"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
v-if="
|
||||||
|
!isTemplate &&
|
||||||
|
showRerunBtn &&
|
||||||
|
(failureSize > 0 || unExecuteSize > 0) &&
|
||||||
|
isRerun
|
||||||
|
"
|
||||||
|
@click="rerun"
|
||||||
|
>
|
||||||
|
{{ $t("api_test.automation.rerun") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane style="min-height: 500px" name="third" v-if="errorReportEnable">
|
<el-tab-pane
|
||||||
|
style="min-height: 500px"
|
||||||
|
name="third"
|
||||||
|
v-if="errorReportEnable"
|
||||||
|
>
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<tab-pane-count :title="$t('error_report_library.option.name')" :count="errorReportSize"/>
|
<tab-pane-count
|
||||||
|
:title="$t('error_report_library.option.name')"
|
||||||
|
:count="errorReportSize"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<api-cases :is-db="isDb" :is-error-report="true" :share-id="shareId" :is-share="isShare" :report="report"
|
<api-cases
|
||||||
:is-template="isTemplate" :plan-id="planId" @setSize="setErrorReportSize"/>
|
:is-db="isDb"
|
||||||
<el-button class="rerun-button" plain size="mini"
|
:is-error-report="true"
|
||||||
v-if="showRerunBtn && (failureSize > 0 || unExecuteSize > 0) && isRerun" @click="rerun">
|
:share-id="shareId"
|
||||||
{{ $t('api_test.automation.rerun') }}
|
:is-share="isShare"
|
||||||
|
:report="report"
|
||||||
|
:is-template="isTemplate"
|
||||||
|
:plan-id="planId"
|
||||||
|
@setSize="setErrorReportSize"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="rerun-button"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
v-if="
|
||||||
|
!isTemplate &&
|
||||||
|
showRerunBtn &&
|
||||||
|
(failureSize > 0 || unExecuteSize > 0) &&
|
||||||
|
isRerun
|
||||||
|
"
|
||||||
|
@click="rerun"
|
||||||
|
>
|
||||||
|
{{ $t("api_test.automation.rerun") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane style="min-height: 500px" name="fourth" v-if="unExecuteEnable">
|
<el-tab-pane
|
||||||
|
style="min-height: 500px"
|
||||||
|
name="fourth"
|
||||||
|
v-if="unExecuteEnable"
|
||||||
|
>
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<tab-pane-count :title="$t('api_test.home_page.detail_card.unexecute')" :count="unExecuteSize"/>
|
<tab-pane-count
|
||||||
|
:title="$t('api_test.home_page.detail_card.unexecute')"
|
||||||
|
:count="unExecuteSize"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<api-cases :is-db="isDb" :is-un-execute="true" :share-id="shareId" :is-share="isShare" :report="report"
|
<api-cases
|
||||||
:is-template="isTemplate" :plan-id="planId" @setSize="setUnExecuteSize"/>
|
:is-db="isDb"
|
||||||
|
:is-un-execute="true"
|
||||||
|
:share-id="shareId"
|
||||||
|
:is-share="isShare"
|
||||||
|
:report="report"
|
||||||
|
:is-template="isTemplate"
|
||||||
|
:plan-id="planId"
|
||||||
|
@setSize="setUnExecuteSize"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-button class="rerun-button" plain size="mini"
|
<el-button
|
||||||
v-if="showRerunBtn && (failureSize > 0 || unExecuteSize > 0) && isRerun" @click="rerun">
|
class="rerun-button"
|
||||||
{{ $t('api_test.automation.rerun') }}
|
plain
|
||||||
|
size="mini"
|
||||||
|
v-if="
|
||||||
|
!isTemplate &&
|
||||||
|
showRerunBtn &&
|
||||||
|
(failureSize > 0 || unExecuteSize > 0) &&
|
||||||
|
isRerun
|
||||||
|
"
|
||||||
|
@click="rerun"
|
||||||
|
>
|
||||||
|
{{ $t("api_test.automation.rerun") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane style="min-height: 500px" name="fifth" v-if="allEnable">
|
<el-tab-pane style="min-height: 500px" name="fifth" v-if="allEnable">
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<tab-pane-count :title="$t('test_track.report.all_case')" :count="allSize"/>
|
<tab-pane-count
|
||||||
|
:title="$t('test_track.report.all_case')"
|
||||||
|
:count="allSize"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<api-cases :is-db="isDb" :is-all="true" :share-id="shareId" :is-share="isShare" :report="report"
|
<api-cases
|
||||||
:is-template="isTemplate" :plan-id="planId" @setSize="setAllSize"/>
|
:is-db="isDb"
|
||||||
<el-button class="rerun-button" plain size="mini"
|
:is-all="true"
|
||||||
v-if="showRerunBtn && (failureSize > 0 || unExecuteSize > 0) && isRerun" @click="rerun">
|
:share-id="shareId"
|
||||||
{{ $t('api_test.automation.rerun') }}
|
:is-share="isShare"
|
||||||
|
:report="report"
|
||||||
|
:is-template="isTemplate"
|
||||||
|
:plan-id="planId"
|
||||||
|
@setSize="setAllSize"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="rerun-button"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
v-if="
|
||||||
|
!isTemplate &&
|
||||||
|
showRerunBtn &&
|
||||||
|
(failureSize > 0 || unExecuteSize > 0) &&
|
||||||
|
isRerun
|
||||||
|
"
|
||||||
|
@click="rerun"
|
||||||
|
>
|
||||||
|
{{ $t("api_test.automation.rerun") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</test-plan-report-container>
|
</test-plan-report-container>
|
||||||
|
@ -62,14 +158,20 @@ import ApiResult from "@/business/plan/view/comonents/report/detail/component/Ap
|
||||||
import TestPlanReportContainer from "@/business/plan/view/comonents/report/detail/TestPlanReportContainer";
|
import TestPlanReportContainer from "@/business/plan/view/comonents/report/detail/TestPlanReportContainer";
|
||||||
import ApiCases from "@/business/plan/view/comonents/report/detail/component/ApiCases";
|
import ApiCases from "@/business/plan/view/comonents/report/detail/component/ApiCases";
|
||||||
import TabPaneCount from "@/business/plan/view/comonents/report/detail/component/TabPaneCount";
|
import TabPaneCount from "@/business/plan/view/comonents/report/detail/component/TabPaneCount";
|
||||||
import {apiTestExecRerun} from "@/api/remote/ui/api-test";
|
import { apiTestExecRerun } from "@/api/remote/ui/api-test";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanApiReport",
|
name: "TestPlanApiReport",
|
||||||
components: {TabPaneCount, ApiCases, TestPlanReportContainer, ApiResult, MsFormDivider},
|
components: {
|
||||||
|
TabPaneCount,
|
||||||
|
ApiCases,
|
||||||
|
TestPlanReportContainer,
|
||||||
|
ApiResult,
|
||||||
|
MsFormDivider,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: 'first',
|
activeName: "first",
|
||||||
failureSize: 0,
|
failureSize: 0,
|
||||||
errorReportSize: 0,
|
errorReportSize: 0,
|
||||||
unExecuteSize: 0,
|
unExecuteSize: 0,
|
||||||
|
@ -80,40 +182,56 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.showRerunBtn = !this.isShare;
|
this.showRerunBtn = !this.isShare;
|
||||||
},
|
},
|
||||||
props: [
|
props: ["report", "planId", "isTemplate", "isShare", "shareId", "isDb"],
|
||||||
'report', 'planId', 'isTemplate', 'isShare', 'shareId', 'isDb'
|
|
||||||
],
|
|
||||||
computed: {
|
computed: {
|
||||||
resultEnable() {
|
resultEnable() {
|
||||||
let disable = this.report.config && this.report.config.api.children.result.enable === false;
|
let disable =
|
||||||
return !disable && this.report.apiResult && (
|
this.report.config &&
|
||||||
(this.report.apiResult.apiCaseData && this.report.apiResult.apiCaseData.length > 0)
|
this.report.config.api.children.result.enable === false;
|
||||||
|| (this.report.apiResult.apiScenarioData && this.report.apiResult.apiScenarioData.length > 0)
|
return (
|
||||||
|
!disable &&
|
||||||
|
this.report.apiResult &&
|
||||||
|
((this.report.apiResult.apiCaseData &&
|
||||||
|
this.report.apiResult.apiCaseData.length > 0) ||
|
||||||
|
(this.report.apiResult.apiScenarioData &&
|
||||||
|
this.report.apiResult.apiScenarioData.length > 0))
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
failureEnable() {
|
failureEnable() {
|
||||||
let disable = this.report.config && this.report.config.api.children.failure.enable === false;
|
let disable =
|
||||||
|
this.report.config &&
|
||||||
|
this.report.config.api.children.failure.enable === false;
|
||||||
return !disable;
|
return !disable;
|
||||||
},
|
},
|
||||||
errorReportEnable() {
|
errorReportEnable() {
|
||||||
let disable = this.report.config && this.report.config.api.children.errorReport && this.report.config.api.children.errorReport.enable === false;
|
let disable =
|
||||||
|
this.report.config &&
|
||||||
|
this.report.config.api.children.errorReport &&
|
||||||
|
this.report.config.api.children.errorReport.enable === false;
|
||||||
return !disable;
|
return !disable;
|
||||||
},
|
},
|
||||||
unExecuteEnable() {
|
unExecuteEnable() {
|
||||||
let disable = this.report.config && this.report.config.api.children.unExecute && this.report.config.api.children.unExecute.enable === false;
|
let disable =
|
||||||
|
this.report.config &&
|
||||||
|
this.report.config.api.children.unExecute &&
|
||||||
|
this.report.config.api.children.unExecute.enable === false;
|
||||||
return !disable;
|
return !disable;
|
||||||
},
|
},
|
||||||
allEnable() {
|
allEnable() {
|
||||||
let disable = this.report.config && this.report.config.api.children.all.enable === false;
|
let disable =
|
||||||
|
this.report.config &&
|
||||||
|
this.report.config.api.children.all.enable === false;
|
||||||
return !disable;
|
return !disable;
|
||||||
},
|
},
|
||||||
isRerun() {
|
isRerun() {
|
||||||
return ((this.report && this.report.apiFailureCases)
|
return (
|
||||||
|| (this.report && this.report.unExecuteCases)
|
(this.report && this.report.apiFailureCases) ||
|
||||||
|| (this.report && this.report.scenarioFailureCases)
|
(this.report && this.report.unExecuteCases) ||
|
||||||
|| (this.report && this.report.unExecuteScenarios)
|
(this.report && this.report.scenarioFailureCases) ||
|
||||||
|| (this.report && this.report.loadFailureCases));
|
(this.report && this.report.unExecuteScenarios) ||
|
||||||
}
|
(this.report && this.report.loadFailureCases)
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
resultEnable() {
|
resultEnable() {
|
||||||
|
@ -135,13 +253,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
initActiveName() {
|
initActiveName() {
|
||||||
if (this.resultEnable) {
|
if (this.resultEnable) {
|
||||||
this.activeName = 'first';
|
this.activeName = "first";
|
||||||
} else if (this.failureEnable) {
|
} else if (this.failureEnable) {
|
||||||
this.activeName = 'second';
|
this.activeName = "second";
|
||||||
} else if (this.errorReportEnable) {
|
} else if (this.errorReportEnable) {
|
||||||
this.activeName = 'third';
|
this.activeName = "third";
|
||||||
} else if (this.allEnable) {
|
} else if (this.allEnable) {
|
||||||
this.activeName = 'fourth';
|
this.activeName = "fourth";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setFailureSize(size) {
|
setFailureSize(size) {
|
||||||
|
@ -156,8 +274,7 @@ export default {
|
||||||
setAllSize(size) {
|
setAllSize(size) {
|
||||||
this.allSize = size;
|
this.allSize = size;
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {},
|
||||||
},
|
|
||||||
rerun() {
|
rerun() {
|
||||||
let type = "TEST_PLAN";
|
let type = "TEST_PLAN";
|
||||||
let scenarios = [];
|
let scenarios = [];
|
||||||
|
@ -168,8 +285,8 @@ export default {
|
||||||
reportId: this.report.id,
|
reportId: this.report.id,
|
||||||
scenarios: scenarios,
|
scenarios: scenarios,
|
||||||
cases: cases,
|
cases: cases,
|
||||||
performanceCases: performanceCases
|
performanceCases: performanceCases,
|
||||||
}
|
};
|
||||||
// 获取需要重跑的用例
|
// 获取需要重跑的用例
|
||||||
if (this.report && this.report.apiFailureCases) {
|
if (this.report && this.report.apiFailureCases) {
|
||||||
this.format(cases, this.report.apiFailureCases);
|
this.format(cases, this.report.apiFailureCases);
|
||||||
|
@ -188,27 +305,30 @@ export default {
|
||||||
if (this.report && this.report.loadFailureCases) {
|
if (this.report && this.report.loadFailureCases) {
|
||||||
this.format(performanceCases, this.report.loadFailureCases);
|
this.format(performanceCases, this.report.loadFailureCases);
|
||||||
}
|
}
|
||||||
apiTestExecRerun(rerunObj)
|
apiTestExecRerun(rerunObj).then((res) => {
|
||||||
.then(res => {
|
if (res.data !== "SUCCESS") {
|
||||||
if (res.data !== 'SUCCESS') {
|
this.$error(res.data);
|
||||||
this.$error(res.data);
|
} else {
|
||||||
} else {
|
this.$success(this.$t("api_test.automation.rerun_success"));
|
||||||
this.$success(this.$t('api_test.automation.rerun_success'));
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
format(cases, data) {
|
format(cases, data) {
|
||||||
if (this.report && data) {
|
if (this.report && data) {
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
if (item) {
|
if (item) {
|
||||||
let obj = {id: item.id, reportId: item.reportId, userId: item.createUser};
|
let obj = {
|
||||||
|
id: item.id,
|
||||||
|
reportId: item.reportId,
|
||||||
|
userId: item.createUser,
|
||||||
|
};
|
||||||
cases.push(obj);
|
cases.push(obj);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -218,7 +338,7 @@ export default {
|
||||||
right: 10px;
|
right: 10px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
z-index: 1100;
|
z-index: 1100;
|
||||||
background-color: #F2F9EF;
|
background-color: #f2f9ef;
|
||||||
color: #87C45D;
|
color: #87c45d;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -99,7 +99,6 @@ import TestPlanReportContainer from "@/business/plan/view/comonents/report/detai
|
||||||
import MsInstructionsIcon from "metersphere-frontend/src/components/MsInstructionsIcon";
|
import MsInstructionsIcon from "metersphere-frontend/src/components/MsInstructionsIcon";
|
||||||
import MsTag from "metersphere-frontend/src/components/MsTag";
|
import MsTag from "metersphere-frontend/src/components/MsTag";
|
||||||
import { datetimeFormat } from "fit2cloud-ui/src/filters/time";
|
import { datetimeFormat } from "fit2cloud-ui/src/filters/time";
|
||||||
import { getTestPlanExtReport } from "@/api/remote/plan/test-plan";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanOverviewReport",
|
name: "TestPlanOverviewReport",
|
||||||
|
|
|
@ -85,7 +85,6 @@
|
||||||
<script>
|
<script>
|
||||||
import TestPlanFunctionalReport from "@/business/plan/view/comonents/report/detail/TestPlanFunctionalReport";
|
import TestPlanFunctionalReport from "@/business/plan/view/comonents/report/detail/TestPlanFunctionalReport";
|
||||||
import {
|
import {
|
||||||
getShareTestPlanExtReport,
|
|
||||||
getShareTestPlanReport,
|
getShareTestPlanReport,
|
||||||
getShareTestPlanReportContent,
|
getShareTestPlanReportContent,
|
||||||
getTestPlanReport,
|
getTestPlanReport,
|
||||||
|
@ -254,6 +253,8 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.report = r.data;
|
this.report = r.data;
|
||||||
this.report.config = this.getDefaultConfig(this.report);
|
this.report.config = this.getDefaultConfig(this.report);
|
||||||
|
this.runMode = this.report.runMode;
|
||||||
|
this.resourcePool = this.report.resourcePool;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -268,20 +269,6 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.isTemplate) {
|
|
||||||
if (this.isShare) {
|
|
||||||
getShareTestPlanExtReport(
|
|
||||||
this.shareId,
|
|
||||||
this.planId,
|
|
||||||
this.reportId
|
|
||||||
).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.runMode = response.data.runMode;
|
|
||||||
this.resourcePool = response.data.resourcePool;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getDefaultConfig(report) {
|
getDefaultConfig(report) {
|
||||||
let dbConfig = null;
|
let dbConfig = null;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<test-case-relevance-base
|
<test-case-relevance-base
|
||||||
@setProject="setProject"
|
@setProject="setProject"
|
||||||
@save="saveCaseRelevance"
|
@save="saveCaseRelevance"
|
||||||
:plan-id="planId"
|
:plan-id="planId"
|
||||||
ref="baseRelevance">
|
:is-saving="isSaving"
|
||||||
|
ref="baseRelevance"
|
||||||
|
>
|
||||||
<template v-slot:aside>
|
<template v-slot:aside>
|
||||||
<ui-scenario-module
|
<ui-scenario-module
|
||||||
@nodeSelectEvent="nodeChange"
|
@nodeSelectEvent="nodeChange"
|
||||||
|
@ -14,7 +14,8 @@
|
||||||
:relevance-project-id="projectId"
|
:relevance-project-id="projectId"
|
||||||
:is-read-only="true"
|
:is-read-only="true"
|
||||||
:show-case-num="false"
|
:show-case-num="false"
|
||||||
ref="nodeTree"/>
|
ref="nodeTree"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<relevance-ui-scenario-list
|
<relevance-ui-scenario-list
|
||||||
|
@ -24,24 +25,20 @@
|
||||||
:plan-id="planId"
|
:plan-id="planId"
|
||||||
:project-id="projectId"
|
:project-id="projectId"
|
||||||
@selectCountChange="setSelectCounts"
|
@selectCountChange="setSelectCounts"
|
||||||
ref="apiScenarioList"/>
|
ref="apiScenarioList"
|
||||||
|
/>
|
||||||
</test-case-relevance-base>
|
</test-case-relevance-base>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
||||||
import {strMapToObj} from "metersphere-frontend/src/utils";
|
import { strMapToObj } from "metersphere-frontend/src/utils";
|
||||||
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
|
import { ENV_TYPE } from "metersphere-frontend/src/utils/constants";
|
||||||
import RelevanceUiScenarioList from "@/business/plan/view/comonents/ui/RelevanceUiScenarioList";
|
import RelevanceUiScenarioList from "@/business/plan/view/comonents/ui/RelevanceUiScenarioList";
|
||||||
import {testPlanAutoCheck} from "@/api/remote/plan/test-plan";
|
import { testPlanAutoCheck } from "@/api/remote/plan/test-plan";
|
||||||
import {
|
import { testPlanUiScenarioRelevanceListIds } from "@/api/remote/ui/test-plan-ui-scenario-case";
|
||||||
testPlanUiScenarioRelevanceListIds
|
|
||||||
} from "@/api/remote/ui/test-plan-ui-scenario-case";
|
|
||||||
import UiScenarioModule from "@/business/plan/view/comonents/ui/UiScenarioModule";
|
import UiScenarioModule from "@/business/plan/view/comonents/ui/UiScenarioModule";
|
||||||
import {uiAutomationRelevance} from "@/api/remote/ui/api-scenario";
|
import { uiAutomationRelevance } from "@/api/remote/ui/api-scenario";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseUiScenarioRelevance",
|
name: "TestCaseUiScenarioRelevance",
|
||||||
|
@ -60,17 +57,18 @@ export default {
|
||||||
trashEnable: false,
|
trashEnable: false,
|
||||||
condition: {},
|
condition: {},
|
||||||
currentRow: {},
|
currentRow: {},
|
||||||
projectId: ""
|
isSaving: false,
|
||||||
|
projectId: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
planId: {
|
planId: {
|
||||||
type: String
|
type: String,
|
||||||
},
|
},
|
||||||
versionEnable: {
|
versionEnable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
planId() {
|
planId() {
|
||||||
|
@ -125,41 +123,42 @@ export default {
|
||||||
param.environmentType = envType;
|
param.environmentType = envType;
|
||||||
param.envGroupId = envGroupId;
|
param.envGroupId = envGroupId;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
uiAutomationRelevance(param)
|
uiAutomationRelevance(param).then(() => {
|
||||||
.then(() => {
|
this.loading = false;
|
||||||
this.loading = false;
|
this.$success(this.$t("commons.save_success"));
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$emit("refresh");
|
||||||
this.$emit('refresh');
|
this.refresh();
|
||||||
this.refresh();
|
this.autoCheckStatus();
|
||||||
this.autoCheckStatus();
|
this.$refs.baseRelevance.close();
|
||||||
this.$refs.baseRelevance.close();
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
getAllId(param) {
|
getAllId(param) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
testPlanUiScenarioRelevanceListIds(param)
|
testPlanUiScenarioRelevanceListIds(param).then((r) => {
|
||||||
.then((r) => {
|
resolve(r.data);
|
||||||
resolve(r.data);
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async saveCaseRelevance() {
|
async saveCaseRelevance() {
|
||||||
|
this.isSaving = true;
|
||||||
let selectIds = [];
|
let selectIds = [];
|
||||||
let selectRows = this.$refs.apiScenarioList.selectRows;
|
let selectRows = this.$refs.apiScenarioList.selectRows;
|
||||||
const envMap = this.$refs.apiScenarioList.projectEnvMap;
|
const envMap = this.$refs.apiScenarioList.projectEnvMap;
|
||||||
let map = this.$refs.apiScenarioList.map;
|
let map = this.$refs.apiScenarioList.map;
|
||||||
let envGroupId = this.$refs.apiScenarioList.envGroupId;
|
let envGroupId = this.$refs.apiScenarioList.envGroupId;
|
||||||
|
|
||||||
selectRows.forEach(row => {
|
selectRows.forEach((row) => {
|
||||||
selectIds.push(row.id);
|
selectIds.push(row.id);
|
||||||
})
|
});
|
||||||
if (selectIds.length < 1) {
|
if (selectIds.length < 1) {
|
||||||
this.$warning(this.$t('test_track.plan_view.please_choose_test_case'));
|
this.isSaving = false;
|
||||||
|
this.$warning(this.$t("test_track.plan_view.please_choose_test_case"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!envMap || envMap.size == 0) {
|
if (!envMap || envMap.size == 0) {
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
this.isSaving = false;
|
||||||
|
this.$warning(this.$t("api_test.environment.select_environment"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,14 +179,19 @@ export default {
|
||||||
uiAutomationRelevance(param)
|
uiAutomationRelevance(param)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.isSaving = false;
|
||||||
this.$emit('refresh');
|
this.$success(this.$t("commons.save_success"));
|
||||||
|
this.$emit("refresh");
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.autoCheckStatus();
|
this.autoCheckStatus();
|
||||||
this.$refs.baseRelevance.close();
|
this.$refs.baseRelevance.close();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.isSaving = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
autoCheckStatus() { // 检查执行结果,自动更新计划状态
|
autoCheckStatus() {
|
||||||
|
// 检查执行结果,自动更新计划状态
|
||||||
if (!this.planId) {
|
if (!this.planId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -195,13 +199,12 @@ export default {
|
||||||
},
|
},
|
||||||
setSelectCounts(data) {
|
setSelectCounts(data) {
|
||||||
this.$refs.baseRelevance.selectCounts = data;
|
this.$refs.baseRelevance.selectCounts = data;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
:deep(.select-menu) {
|
:deep(.select-menu) {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
@ -222,5 +225,4 @@ export default {
|
||||||
left: -30px;
|
left: -30px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue