Skip to content

Commit

Permalink
Add aborted handling
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Oertel <[email protected]>
  • Loading branch information
fudler committed Jun 28, 2024
1 parent ea8b819 commit 10ddfd8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
5 changes: 4 additions & 1 deletion legacy/src/js/controller/chartCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 29 additions & 0 deletions legacy/src/js/controller/reportCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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() === '') {
Expand Down
7 changes: 6 additions & 1 deletion legacy/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ <h4 ng-hide="!currentPage.loading">Loading <i class="fa fa-circle-o-notch fa-spi
<span class="{{currentPage.statistics.failed > 0 ? 'red' : 'gray'}} toggle" ng-click="showFailed()"><i
class=" fa fa-exclamation-circle"></i> {{currentPage.statistics.failed}} Failed</span>,
<span class="{{currentPage.statistics.pending > 0 ? 'bold' : 'gray'}} toggle" ng-click="showPending()"><i class="fa fa-ban"></i> {{currentPage.statistics.pending}} Pending</span>,
<span class="{{currentPage.statistics.count === 0 ? 'gray' : ''}}">{{currentPage.statistics.count}} Total ({{nanosToReadableUnit(currentPage.statistics.totalNanos)}})</span>
<span class="{{currentPage.statistics.count === 0 ? 'gray' : ''}}">{{currentPage.statistics.count}} Total ({{nanosToReadableUnit(currentPage.statistics.totalNanos)}})</span>,
<span class="{{currentPage.statistics.aborted > 0 ? 'bold' : 'gray'}} toggle" ng-click="showAborted()"><i class="fa fa-ban"></i> {{currentPage.statistics.aborted}} Aborted</span>
<span ng-if="currentPage.filtered > 0" class="bold toggle" ng-click="clearFilter()">({{ currentPage.filtered }} Filtered)</span>
</div>

Expand Down Expand Up @@ -451,6 +452,8 @@ <h4 ng-hide="!currentPage.loading">Loading <i class="fa fa-circle-o-notch fa-spi
<span class="secondary radius label group-count total">{{::scenarioGroup.values.length}}</span>
<span class="radius label group-count alert failed" ng-if="scenarioGroup.counts.failed > 0"><i
class="fa fa-exclamation-circle"></i> {{::scenarioGroup.counts.failed}} FAILED</span>
<span class="radius label group-count alert aborted" ng-if="scenarioGroup.counts.aborted > 0"><i
class="fa fa-exclamation-circle"></i> {{::scenarioGroup.counts.aborted}} ABORTED</span>
<span class="secondary radius label group-count pending" ng-if="scenarioGroup.counts.pending > 0">
<i class="fa fa-ban"></i> {{::scenarioGroup.counts.pending}} PENDING</span>
<span class="duration"> ({{ ::nanosToReadableUnit(scenarioGroup.counts.durationInNanos) }})</span>
Expand Down Expand Up @@ -488,6 +491,8 @@ <h4 ng-hide="!currentPage.loading">Loading <i class="fa fa-circle-o-notch fa-spi
class="check fa fa-check-square"></i>
<span ng-if="scenario.executionStatus === 'FAILED'"
class="failed label radius alert"><i class="fa fa-exclamation-circle"></i>{{getNumberOfFailedCases(scenario)}} FAILED</span>
<span ng-if="scenario.executionStatus === 'ABORTED'"
class="failed label radius alert"><i class="fa fa-exclamation-circle"></i>{{getNumberOfAbortedCases(scenario)}} ABORTED</span>
<span
ng-if="scenario.executionStatus === 'SCENARIO_PENDING' || scenario.executionStatus === 'SOME_STEPS_PENDING'"
class="pending label radius secondary"><i class="fa fa-ban"></i> PENDING</span>
Expand Down

0 comments on commit 10ddfd8

Please sign in to comment.