From 10ddfd8a858ea93eb8a8d76e636586ecfc5920aa Mon Sep 17 00:00:00 2001 From: Christian Oertel Date: Fri, 28 Jun 2024 08:42:55 +0200 Subject: [PATCH] Add aborted handling Signed-off-by: Christian Oertel --- legacy/src/js/controller/chartCtrl.js | 5 ++++- legacy/src/js/controller/reportCtrl.js | 29 ++++++++++++++++++++++++++ legacy/src/public/index.html | 7 ++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/legacy/src/js/controller/chartCtrl.js b/legacy/src/js/controller/chartCtrl.js index 5f85101b..6e9f234b 100644 --- a/legacy/src/js/controller/chartCtrl.js +++ b/legacy/src/js/controller/chartCtrl.js @@ -24,7 +24,10 @@ jgivenReportApp.controller('ChartCtrl', function ($scope, $timeout) { $scope.showFailed(); } else if (label === 'Pending') { $scope.showPending(); - } else { + } else if (label === 'Aborted') { + $scope.showAborted(); + } + else { $scope.showSuccessful(); } }, 0) diff --git a/legacy/src/js/controller/reportCtrl.js b/legacy/src/js/controller/reportCtrl.js index 761b6fb3..3a05787c 100644 --- a/legacy/src/js/controller/reportCtrl.js +++ b/legacy/src/js/controller/reportCtrl.js @@ -598,6 +598,27 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do } }; + $scope.getNumberOfAbortedCases = function (scenario) { + var nCases = scenario.scenarioCases.length; + if (nCases === 1) { + return ''; + } + + var abortedCases = 0; + + _.forEach(scenario.scenarioCases, function (aCase) { + if (aCase.status === 'ABORTED') { + abortedCases++; + } + }); + + if (abortedCases < nCases) { + return " " + abortedCases + " OF " + nCases + " CASES "; + } else { + return " ALL CASES"; + } + } + $scope.getNumberOfFailedCases = function (scenario) { var nCases = scenario.scenarioCases.length; if (nCases === 1) { @@ -663,6 +684,14 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do } }; + $scope.showAborted = function () { + if (isRootPath($location)) { + $location.path('/aborted'); + } else { + $location.search('status', 'aborted'); + } + } + $scope.showSuccessful = function () { $scope.updatingLocation = true; if ($location.path() === '/' || $location.path() === '') { diff --git a/legacy/src/public/index.html b/legacy/src/public/index.html index cca670f3..4b7a261f 100644 --- a/legacy/src/public/index.html +++ b/legacy/src/public/index.html @@ -369,7 +369,8 @@

Loading 0 ? 'red' : 'gray'}} toggle" ng-click="showFailed()"> {{currentPage.statistics.failed}} Failed, {{currentPage.statistics.pending}} Pending, - {{currentPage.statistics.count}} Total ({{nanosToReadableUnit(currentPage.statistics.totalNanos)}}) + {{currentPage.statistics.count}} Total ({{nanosToReadableUnit(currentPage.statistics.totalNanos)}}), + {{currentPage.statistics.aborted}} Aborted ({{ currentPage.filtered }} Filtered) @@ -451,6 +452,8 @@

Loading {{::scenarioGroup.values.length}} {{::scenarioGroup.counts.failed}} FAILED + {{::scenarioGroup.counts.aborted}} ABORTED {{::scenarioGroup.counts.pending}} PENDING ({{ ::nanosToReadableUnit(scenarioGroup.counts.durationInNanos) }}) @@ -488,6 +491,8 @@

Loading {{getNumberOfFailedCases(scenario)}} FAILED + {{getNumberOfAbortedCases(scenario)}} ABORTED PENDING