parent
94eadaa43c
commit
ceba6c714d
|
@ -60,6 +60,7 @@
|
|||
</el-tabs>
|
||||
</div>
|
||||
<ms-api-report-export v-if="reportExportVisible" id="apiTestReport" :title="report.name"
|
||||
:report="report"
|
||||
:content="content" :total-time="totalTime"/>
|
||||
</main>
|
||||
</section>
|
||||
|
@ -159,7 +160,6 @@ export default {
|
|||
this.report = {};
|
||||
this.content = {};
|
||||
this.fails = [];
|
||||
this.report = {};
|
||||
this.fullTreeNodes = [];
|
||||
this.failsTreeNodes = [];
|
||||
this.isRequestResult = false;
|
||||
|
@ -342,7 +342,31 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
getReport(getAllReport) {
|
||||
getReportByExport() {
|
||||
if (this.exportReportIsOk) {
|
||||
this.startExport();
|
||||
} else {
|
||||
getScenarioReportAll(this.reportId, (data) => {
|
||||
if (data && data.content) {
|
||||
let report = JSON.parse(data.content);
|
||||
this.content = report;
|
||||
this.fullTreeNodes = report.steps;
|
||||
this.content.console = report.console;
|
||||
this.content.error = report.error;
|
||||
let successCount = (report.total - report.error - report.errorCode - report.unExecute);
|
||||
if (successCount >= report.unExecute) {
|
||||
// 测试用例的集合报告中如果含有未执行的步骤,则成功数量统计要把未执行的数量给去掉
|
||||
successCount = successCount - report.unExecute;
|
||||
}
|
||||
this.content.success = successCount;
|
||||
this.totalTime = report.totalTime;
|
||||
}
|
||||
this.exportReportIsOk = true;
|
||||
setTimeout(this.startExport, 500)
|
||||
});
|
||||
}
|
||||
},
|
||||
getReport() {
|
||||
this.init();
|
||||
if (this.isTemplate) {
|
||||
// 测试计划报告导出
|
||||
|
@ -357,17 +381,6 @@ export default {
|
|||
this.checkReport(data);
|
||||
this.handleGetScenarioReport(data);
|
||||
});
|
||||
} else if (getAllReport) {
|
||||
if (this.exportReportIsOk) {
|
||||
this.startExport();
|
||||
} else {
|
||||
getScenarioReportAll(this.reportId, (data) => {
|
||||
this.checkReport(data);
|
||||
this.handleGetScenarioReport(data);
|
||||
this.exportReportIsOk = true;
|
||||
this.startExport();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
getScenarioReport(this.reportId, (data) => {
|
||||
this.checkReport(data);
|
||||
|
@ -394,7 +407,12 @@ export default {
|
|||
this.fullTreeNodes = report.steps;
|
||||
this.content.console = report.console;
|
||||
this.content.error = report.error;
|
||||
this.content.success = (report.total - report.error - report.errorCode);
|
||||
let successCount = (report.total - report.error - report.errorCode - report.unExecute);
|
||||
if (successCount >= report.unExecute) {
|
||||
// 测试用例的集合报告中如果含有未执行的步骤,则成功数量统计要把未执行的数量给去掉
|
||||
successCount = successCount - report.unExecute;
|
||||
}
|
||||
this.content.success = successCount;
|
||||
this.totalTime = report.totalTime;
|
||||
}
|
||||
this.loading = false;
|
||||
|
@ -509,7 +527,7 @@ export default {
|
|||
},
|
||||
|
||||
handleExport() {
|
||||
this.getReport(true);
|
||||
this.getReportByExport();
|
||||
},
|
||||
startExport() {
|
||||
if (this.report.reportVersion && this.report.reportVersion > 1) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<ms-report-export-template :title="title" :type="$t('report.api_test_report')">
|
||||
<ms-metric-chart :content="content" :is-export="true" :totalTime="totalTime"/>
|
||||
<ms-metric-chart :content="content" :is-export="true" :totalTime="totalTime" :report="report"/>
|
||||
<div class="scenario-result" v-for="(scenario, index) in content.scenarios" :key="index" :scenario="scenario">
|
||||
<div>
|
||||
<el-card>
|
||||
|
@ -95,6 +95,7 @@
|
|||
MsReportTitle, MsMetricChart, ApiReportReqestHeaderItem, MsRequestResultTail, MsScenarioResult ,MsAssertionResults
|
||||
},
|
||||
props: {
|
||||
report:Object,
|
||||
content: Object,
|
||||
totalTime: Number,
|
||||
title: String
|
||||
|
|
Loading…
Reference in New Issue