fix(测试跟踪): 修复测试跟踪报告导出的一些问题
--bug=1026212 --user=宋天阳 【测试跟踪】报告-导出-点击查看场景执行结果步骤-报错 https://www.tapd.cn/55049933/s/1372491;--bug=1026214 --user=宋天阳 【测试跟踪】报告-导出-事务控制器实际执行结果为Pending-导出后显示为Error https://www.tapd.cn/55049933/s/1372492;--bug=1026216 --user=宋天阳 【测试跟踪】报告-导出-未执行数量统计错误 https://www.tapd.cn/55049933/s/1372493;--bug=1026221 --user=宋天阳 【测试跟踪】测试计划-执行-选择并行-点击保存并执行-再次点击执行按钮-仍显示之前的配置 https://www.tapd.cn/55049933/s/1372494;--bug=1026262 --user=宋天阳 【测试跟踪】执行测试计划后端报错 https://www.tapd.cn/55049933/s/1372497;
This commit is contained in:
parent
1ec400068d
commit
d7a9828846
|
@ -54,8 +54,6 @@ public class TestPlanMessageService {
|
||||||
@Async
|
@Async
|
||||||
public void checkTestPlanStatusAndSendMessage(TestPlanReport report, TestPlanReportContentWithBLOBs testPlanReportContent, TestPlan testPlan, boolean sendMessage) {
|
public void checkTestPlanStatusAndSendMessage(TestPlanReport report, TestPlanReportContentWithBLOBs testPlanReportContent, TestPlan testPlan, boolean sendMessage) {
|
||||||
if (report != null && testPlanReportContent != null) {
|
if (report != null && testPlanReportContent != null) {
|
||||||
// 异步发送通知需要指定调用其他服务的user
|
|
||||||
HttpHeaderUtils.runAsUser(report.getCreator());
|
|
||||||
try {
|
try {
|
||||||
report = testPlanReportService.checkTestPlanReportHasErrorCase(report, testPlanReportContent);
|
report = testPlanReportService.checkTestPlanReportHasErrorCase(report, testPlanReportContent);
|
||||||
if (!report.getIsApiCaseExecuting() && !report.getIsPerformanceExecuting() && !report.getIsScenarioExecuting() && !report.getIsUiScenarioExecuting()) {
|
if (!report.getIsApiCaseExecuting() && !report.getIsPerformanceExecuting() && !report.getIsScenarioExecuting() && !report.getIsUiScenarioExecuting()) {
|
||||||
|
@ -70,8 +68,6 @@ public class TestPlanMessageService {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.error("检查测试计划状态出错", e);
|
LogUtil.error("检查测试计划状态出错", e);
|
||||||
} finally {
|
|
||||||
HttpHeaderUtils.clearUser();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,19 +90,16 @@ public class TestPlanMessageService {
|
||||||
} else {
|
} else {
|
||||||
subject = "任务通知";
|
subject = "任务通知";
|
||||||
}
|
}
|
||||||
|
String creator = testPlanReport.getCreator();
|
||||||
|
UserDTO userDTO = baseUserService.getUserDTO(creator);
|
||||||
|
HttpHeaderUtils.runAsUser(userDTO);
|
||||||
// 计算通过率
|
// 计算通过率
|
||||||
TestPlanDTOWithMetric testPlanDTOWithMetric = BeanUtils.copyBean(new TestPlanDTOWithMetric(), testPlan);
|
TestPlanDTOWithMetric testPlanDTOWithMetric = BeanUtils.copyBean(new TestPlanDTOWithMetric(), testPlan);
|
||||||
testPlanService.calcTestPlanRate(Collections.singletonList(testPlanDTOWithMetric));
|
testPlanService.calcTestPlanRate(Collections.singletonList(testPlanDTOWithMetric));
|
||||||
String creator = testPlanReport.getCreator();
|
|
||||||
UserDTO userDTO = baseUserService.getUserDTO(creator);
|
|
||||||
// 计算各种属性
|
// 计算各种属性
|
||||||
HttpHeaderUtils.runAsUser(userDTO);
|
|
||||||
TestPlanReportDataStruct report = testPlanReportService.getReport(testPlanReport.getId());
|
TestPlanReportDataStruct report = testPlanReportService.getReport(testPlanReport.getId());
|
||||||
HttpHeaderUtils.clearUser();
|
HttpHeaderUtils.clearUser();
|
||||||
|
|
||||||
Map<String, Long> caseCountMap = calculateCaseCount(report);
|
Map<String, Long> caseCountMap = calculateCaseCount(report);
|
||||||
|
|
||||||
|
|
||||||
Map paramMap = new HashMap();
|
Map paramMap = new HashMap();
|
||||||
paramMap.put("type", "testPlan");
|
paramMap.put("type", "testPlan");
|
||||||
paramMap.put("url", url);
|
paramMap.put("url", url);
|
||||||
|
|
|
@ -408,7 +408,6 @@ public class TestPlanService {
|
||||||
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
||||||
calcExecResultStatus(testPlan.getId(), testPlan, planTestPlanUiScenarioCaseService::getExecResultByPlanId);
|
calcExecResultStatus(testPlan.getId(), testPlan, planTestPlanUiScenarioCaseService::getExecResultByPlanId);
|
||||||
}
|
}
|
||||||
|
|
||||||
testPlan.setPassRate(MathUtils.getPercentWithDecimal(testPlan.getTested() == 0 ? 0 : testPlan.getPassed() * 1.0 / testPlan.getTotal()));
|
testPlan.setPassRate(MathUtils.getPercentWithDecimal(testPlan.getTested() == 0 ? 0 : testPlan.getPassed() * 1.0 / testPlan.getTotal()));
|
||||||
testPlan.setTestRate(MathUtils.getPercentWithDecimal(testPlan.getTotal() == 0 ? 0 : testPlan.getTested() * 1.0 / testPlan.getTotal()));
|
testPlan.setTestRate(MathUtils.getPercentWithDecimal(testPlan.getTotal() == 0 ? 0 : testPlan.getTested() * 1.0 / testPlan.getTotal()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1138,6 +1138,7 @@ export default {
|
||||||
this.cardLoading = true;
|
this.cardLoading = true;
|
||||||
testPlanRunSave(param).then(() => {
|
testPlanRunSave(param).then(() => {
|
||||||
this.cardLoading = false;
|
this.cardLoading = false;
|
||||||
|
this.initTableData();
|
||||||
this.$success(this.$t("commons.run_success"));
|
this.$success(this.$t("commons.run_success"));
|
||||||
});
|
});
|
||||||
} else if (config.executionWay === "save") {
|
} else if (config.executionWay === "save") {
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
:report="report"
|
:report="report"
|
||||||
:is-share="isShare"
|
:is-share="isShare"
|
||||||
:share-id="shareId"
|
:share-id="shareId"
|
||||||
|
:is-template="isTemplate"
|
||||||
v-on:requestResult="requestResult"
|
v-on:requestResult="requestResult"
|
||||||
ref="resultsTree"/>
|
ref="resultsTree"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -118,9 +119,9 @@ import MsApiReportViewHeader from "./ApiReportViewHeader";
|
||||||
import {RequestFactory} from "metersphere-frontend/src/model/ApiTestModel";
|
import {RequestFactory} from "metersphere-frontend/src/model/ApiTestModel";
|
||||||
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
||||||
import {getUUID, windowPrint} from "metersphere-frontend/src/utils";
|
import {getUUID, windowPrint} from "metersphere-frontend/src/utils";
|
||||||
import {hasLicense} from "metersphere-frontend/src/utils/permission";
|
|
||||||
import {STEP} from "metersphere-frontend/src/model/Setting";
|
import {STEP} from "metersphere-frontend/src/model/Setting";
|
||||||
import MsCodeEdit from "metersphere-frontend/src/components/MsCodeEdit";
|
import MsCodeEdit from "metersphere-frontend/src/components/MsCodeEdit";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiReport",
|
name: "MsApiReport",
|
||||||
components: {
|
components: {
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
<el-col>
|
<el-col>
|
||||||
<span v-if="!debug">
|
<span v-if="!debug">
|
||||||
<span>
|
<span>
|
||||||
<el-link v-if="isSingleScenario"
|
<span v-if="isTemplate">
|
||||||
|
{{ report.name }}
|
||||||
|
</span>
|
||||||
|
<el-link v-else-if="isSingleScenario"
|
||||||
type="primary"
|
type="primary"
|
||||||
class="report-name"
|
class="report-name"
|
||||||
@click="redirect">
|
@click="redirect">
|
||||||
|
|
|
@ -231,8 +231,8 @@
|
||||||
<div v-show="showUnExecuteReport && !isUi" class="metric-box">
|
<div v-show="showUnExecuteReport && !isUi" class="metric-box">
|
||||||
<div class="value">
|
<div class="value">
|
||||||
{{
|
{{
|
||||||
content.scenarioStepUnExecuteReport
|
content.scenarioStepPending
|
||||||
? content.scenarioStepUnExecuteReport
|
? content.scenarioStepPending
|
||||||
: 0
|
: 0
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -445,6 +445,7 @@ export default {
|
||||||
return (
|
return (
|
||||||
(this.content.scenarioStepUnExecuteReport &&
|
(this.content.scenarioStepUnExecuteReport &&
|
||||||
this.content.scenarioStepUnExecuteReport > 0) ||
|
this.content.scenarioStepUnExecuteReport > 0) ||
|
||||||
|
(this.content.scenarioStepPending && this.content.scenarioStepPending > 0) ||
|
||||||
(this.content.scenarioUnExecute &&
|
(this.content.scenarioUnExecute &&
|
||||||
this.content.scenarioUnExecute > 0) ||
|
this.content.scenarioUnExecute > 0) ||
|
||||||
(this.content.unExecute && this.content.unExecute > 0)
|
(this.content.unExecute && this.content.unExecute > 0)
|
||||||
|
|
|
@ -192,8 +192,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<div v-if="totalStatus">
|
<div v-if="totalStatus">
|
||||||
<el-tag size="mini" v-if="totalStatus === 'unexecute'"
|
<el-tag size="mini"
|
||||||
> Pending
|
v-if="totalStatus === 'unexecute' || totalStatus === 'Pending'|| totalStatus === 'PENDING'"
|
||||||
|
> Pending
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-else-if="
|
v-else-if="
|
||||||
|
@ -294,6 +295,7 @@ export default {
|
||||||
console: String,
|
console: String,
|
||||||
totalStatus: String,
|
totalStatus: String,
|
||||||
redirect: Boolean,
|
redirect: Boolean,
|
||||||
|
isTemplate: Boolean,
|
||||||
errorCode: {
|
errorCode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
|
@ -388,12 +390,14 @@ export default {
|
||||||
this.request.responseResult.body === null ||
|
this.request.responseResult.body === null ||
|
||||||
this.request.responseResult.body === undefined
|
this.request.responseResult.body === undefined
|
||||||
) {
|
) {
|
||||||
if (this.isShare) {
|
if (this.isTemplate) {
|
||||||
|
this.requestInfo.loading = false;
|
||||||
|
} else if (this.isShare) {
|
||||||
this.$get(
|
this.$get(
|
||||||
"/share/" +
|
"/share/" +
|
||||||
this.shareId +
|
this.shareId +
|
||||||
"/scenario/report/selectReportContent/" +
|
"/scenario/report/selectReportContent/" +
|
||||||
this.stepId
|
this.stepId
|
||||||
).then((response) => {
|
).then((response) => {
|
||||||
this.requestInfo = response.data;
|
this.requestInfo = response.data;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="url">
|
<div class="url">
|
||||||
{{ $t('api_report.start_time') }}:{{ request.startTime | timestampFormatDate(true) }}
|
{{ $t('api_report.start_time') }}:{{ request.startTime | datetimeFormat }}
|
||||||
{{ $t('report.test_end_time') }}:{{ request.endTime | timestampFormatDate(true) }}
|
{{ $t('report.test_end_time') }}:{{ request.endTime | datetimeFormat }}
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|| (node.type && this.stepFilter.get('AllSamplerProxy').indexOf(node.type) === -1)">
|
|| (node.type && this.stepFilter.get('AllSamplerProxy').indexOf(node.type) === -1)">
|
||||||
<el-card class="ms-card">
|
<el-card class="ms-card">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col span="23">
|
<el-col :span="22">
|
||||||
<div class="el-step__icon is-text ms-api-col">
|
<div class="el-step__icon is-text ms-api-col">
|
||||||
<div class="el-step__icon-inner">
|
<div class="el-step__icon-inner">
|
||||||
{{ node.index }}
|
{{ node.index }}
|
||||||
|
@ -17,8 +17,10 @@
|
||||||
<span v-else>{{ getLabel(node.label) }}</span>
|
<span v-else>{{ getLabel(node.label) }}</span>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1">
|
<el-col :span="2">
|
||||||
<ms-api-report-status :status="node.totalStatus" v-if="node.label !=='ConstantTimer'"/>
|
<div style="float: right">
|
||||||
|
<ms-api-report-status :status="node.totalStatus" v-if="node.label !=='ConstantTimer'"/>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -45,6 +47,7 @@
|
||||||
:total-status="node.totalStatus"
|
:total-status="node.totalStatus"
|
||||||
:console="console"
|
:console="console"
|
||||||
:isActive="isActive"
|
:isActive="isActive"
|
||||||
|
:is-template="isTemplate"
|
||||||
:is-share="isShare"
|
:is-share="isShare"
|
||||||
:share-id="shareId"
|
:share-id="shareId"
|
||||||
v-on:requestResult="requestResult"
|
v-on:requestResult="requestResult"
|
||||||
|
|
Loading…
Reference in New Issue