diff --git a/frontend/src/business/components/api/report/ApiReportView.vue b/frontend/src/business/components/api/report/ApiReportView.vue index d2f8361e5e..2ef10831d0 100644 --- a/frontend/src/business/components/api/report/ApiReportView.vue +++ b/frontend/src/business/components/api/report/ApiReportView.vue @@ -5,34 +5,22 @@
{{report.projectName}} / - {{report.testName}} [{{report.createTime | timestampFormatDate}}] + {{report.testName}} + {{report.createTime | timestampFormatDate}}
-
- -
- -
- - - {{$t('api_report.scenario_name')}} - - - {{$t('api_report.response_time')}} - - - {{$t('api_report.error')}} - - - {{$t('api_report.assertions')}} - - - {{$t('api_report.result')}} - - -
- -
+ + + + + + + + + +
@@ -45,23 +33,30 @@ import MsRequestResult from "./components/RequestResult"; import MsScenarioResult from "./components/ScenarioResult"; import MsMetricChart from "./components/MetricChart"; + import MsScenarioResults from "./components/ScenarioResults"; export default { name: "MsApiReportView", - components: {MsMetricChart, MsScenarioResult, MsRequestResult}, + components: {MsScenarioResults, MsMetricChart, MsScenarioResult, MsRequestResult}, data() { return { + activeName: "total", content: {}, report: {}, - loading: true + loading: true, + fails: [] } }, methods: { - getReport() { + init() { this.loading = true; this.report = {}; this.content = {}; + this.fails = []; + }, + getReport() { + this.init(); if (this.reportId) { let url = "/api/report/get/" + this.reportId; @@ -69,12 +64,32 @@ this.report = response.data || {}; if (this.isCompleted) { this.content = JSON.parse(this.report.content); + this.getFails(); this.loading = false; } else { setTimeout(this.getReport, 2000) } }); } + }, + getFails() { + if (this.isCompleted) { + this.fails = []; + this.content.scenarios.forEach((scenario) => { + let failScenario = Object.assign({}, scenario); + if (scenario.error > 0) { + this.fails.push(failScenario); + failScenario.requestResults = []; + scenario.requestResults.forEach((request) => { + if (!request.success) { + let failRequest = Object.assign({}, request); + failScenario.requestResults.push(failRequest); + } + }) + + } + }) + } } }, @@ -99,6 +114,11 @@ } } + diff --git a/frontend/src/business/components/api/report/components/AssertionResults.vue b/frontend/src/business/components/api/report/components/AssertionResults.vue index c00bcf6457..f33a998781 100644 --- a/frontend/src/business/components/api/report/components/AssertionResults.vue +++ b/frontend/src/business/components/api/report/components/AssertionResults.vue @@ -1,9 +1,7 @@