Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aborted label #104

Merged
merged 14 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion legacy/src/css/jgivenreport.css
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ table.steps tr.steps:hover .nested-step .step-expand-icon {

.aborted {
color: #aaa;
font-size: 0.7rem;
}

.collapsed {
Expand Down
9 changes: 7 additions & 2 deletions legacy/src/js/controller/chartCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jgivenReportApp.controller('ChartCtrl', function ($scope, $timeout) {
pointBackgroundColor: "rgba(77,83,96,1)"
}

var gray = {
backgroundColor: "rgba(192,192,192,0.5)",
pointBackgroundColor: "rgba(192,192,192,1)"
}

var green = {
backgroundColor: 'rgba(0,150,0,0.5)',
pointBackgroundColor: "rgba(0,150,0,0.8)"
Expand All @@ -33,8 +38,8 @@ jgivenReportApp.controller('ChartCtrl', function ($scope, $timeout) {
}, 0)
}

$scope.labels = ['Successful', 'Failed', 'Pending'];
$scope.colors = [green, red, gray];
$scope.labels = ['Successful', 'Failed', 'Pending', 'Aborted'];
$scope.colors = [green, red, silver, gray];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are changing the 'Pending' state from gray to silver - is it on purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

$scope.options = {
cutoutPercentage: 60,
animationEasing: "easeInOutCubic",
Expand Down
21 changes: 20 additions & 1 deletion legacy/src/js/controller/reportCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do
$scope.showFailedScenarios(selectedOptions);
} else if (part[1] === 'pending') {
$scope.showPendingScenarios(selectedOptions);
} else if (part[1] === 'aborted') {
$scope.showAbortedScenarios(selectedOptions);
} else if (part[1] === 'search') {
$scope.search(part[2], selectedOptions);
}
Expand Down Expand Up @@ -288,6 +290,18 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do
$scope.applyOptions();
};

$scope.showAbortedScenarios = function (options) {
scenarios = dataService.getAbortedScenarios();
var description = getDescription(scenarios.length, "aborted");
$scope.currentPage = {
title: "Aborted Scenarios",
description: description,
breadcrumbs: ['ABORTED SCENARIOS'],
options: optionService.getOptions(scenarios, options)
};
$scope.applyOptions();
};

$scope.applyOptions = function applyOptions () {
var page = $scope.currentPage;
var selectedSortOption = getSelectedSortOption(page);
Expand Down Expand Up @@ -412,6 +426,7 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do
failed: 0,
pending: 0,
success: 0,
aborted: 0,
totalNanos: 0
};

Expand All @@ -421,13 +436,15 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do
statistics.success++;
} else if (x.executionStatus === 'FAILED') {
statistics.failed++;
} else if (x.executionStatus === 'ABORTED') {
statistics.aborted++;
} else {
statistics.pending++;
}
});

$timeout(function () {
statistics.chartData = [statistics.success, statistics.failed, statistics.pending];
statistics.chartData = [statistics.success, statistics.failed, statistics.pending,statistics.aborted];
}, 0);

return statistics;
Expand Down Expand Up @@ -593,6 +610,8 @@ jgivenReportApp.controller('JGivenReportCtrl', function ($scope, $rootScope, $do
return '';
case 'FAILED':
return 'failed';
case 'ABORTED':
return 'aborted';
default:
return 'pending';
}
Expand Down
9 changes: 8 additions & 1 deletion legacy/src/js/service/dataService.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function DataService () {

function getPendingScenarios () {
return getScenariosWhere(function (x) {
return x.executionStatus !== "FAILED" && x.executionStatus !== "SUCCESS";
return x.executionStatus === "PENDING"
});
}

Expand All @@ -34,6 +34,12 @@ export default function DataService () {
});
}

function getAbortedScenarios () {
return getScenariosWhere(function (x) {
return x.executionStatus === "ABORTED";
});
}

return {

getTagFile: function () {
Expand All @@ -55,6 +61,7 @@ export default function DataService () {
getAllScenarios: getAllScenarios,
getPendingScenarios: getPendingScenarios,
getFailedScenarios: getFailedScenarios,
getAbortedScenarios: getAbortedScenarios

};
}
2 changes: 1 addition & 1 deletion legacy/src/js/service/optionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export default function OptionService(dataService) {
_.forEach(scenarios, function (scenario) {
if (scenario.executionStatus === 'FAILED') {
counts.failed++;
} else if (scenario.executionStatus !== 'SUCCESS') {
} else if (scenario.executionStatus === 'PENDING') {
counts.pending++;
}
counts.durationInNanos += scenario.durationInNanos;
Expand Down
2 changes: 2 additions & 0 deletions legacy/src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ export function getReadableExecutionStatus (status) {
return 'Successful';
case 'FAILED':
return 'Failed';
case 'ABORTED':
return 'Aborted'
default:
return 'Pending';
}
Expand Down
19 changes: 11 additions & 8 deletions legacy/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@
<i ng-if="step.status === 'PASSED'" class="small-check fa fa-check-square"></i>
<i ng-if="step.status === 'FAILED'" class="failed-icon fa fa-exclamation-circle"></i>
<i ng-if="step.status === 'SKIPPED'" class="skipped fa fa-ban"></i>
<i ng-if="step.status === 'PENDING'" title="Pending"
class="skipped fa fa-ban"></i>
<i ng-if="step.status === 'ABORTED'" class="aborted fa fa-exclamation-circle"></i>
<i ng-if="step.status === 'PENDING'" title="Pending" class="skipped fa fa-ban"></i>
<i ng-if="step.status === 'ABORTED'" class="aborted fa fa-fa-ban"></i>
</span>
<span ng-if="step.durationInNanos > 10000000"
class="duration"> ({{ ::nanosToReadableUnit(step.durationInNanos) }})</span>
Expand Down Expand Up @@ -204,6 +203,7 @@ <h1 class="title">JGiven Report</h1>
<li class="off-canvas-close"><a href="#all">All Scenarios</a></li>
<li class="off-canvas-close"><a href="#failed">Failed Scenarios</a></li>
<li class="off-canvas-close"><a href="#pending">Pending Scenarios</a></li>
<li class="off-canvas-close"><a href="#aborted">Aborted Scenarios</a></li>

<li><label>Tags</label></li>
<li class="has-submenu" ng-repeat="node in rootTags" ng-include="'tree_mobile_template.html'">
Expand Down Expand Up @@ -257,6 +257,9 @@ <h1 class="title">JGiven Report</h1>
<li><a href="#pending">Pending Scenarios<span
class="label secondary round nav-count {{::getTotalStatistics().pending > 0 ? 'pending' : ''}}">{{::getTotalStatistics().pending}}</span></a>
</li>
<li><a href="#aborted">Aborted Scenarios<span
class="label secondary round nav-count {{::getTotalStatistics().aborted> 0 ? 'aborted' : ''}}">{{::getTotalStatistics().aborted}}</span></a>
</li>
</ul>
</li>

Expand Down Expand Up @@ -364,12 +367,12 @@ <h4 ng-hide="!currentPage.loading">Loading <i class="fa fa-circle-o-notch fa-spi

<div id="statistics" class="small-12 large-6 columns no-pad-left" ng-if="currentPage.statistics">
<span class="{{currentPage.statistics.success === 0 ? 'gray' : ''}} toggle" ng-click="showSuccessful()">
<i class="fa fa-check-square {{currentPage.statistics.failed + currentPage.statistics.pending === 0 && currentPage.statistics.success > 0 ? 'check' : 'gray'}}"></i> {{currentPage.statistics.success}} Successful</span>,
<i class="fa fa-check-square {{currentPage.statistics.aborted + currentPage.statistics.failed + currentPage.statistics.pending === 0 && currentPage.statistics.success > 0 ? 'check' : 'gray'}}"></i> {{currentPage.statistics.success}} Successful</span>,
<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.aborted > 0 ? 'bold' : 'gray'}} toggle" ng-click="showAborted()"><i class="fa fa-ban"></i> {{currentPage.statistics.aborted}} Aborted</span>
<span class="{{currentPage.statistics.pending > 0 ? 'bold' : 'silver'}} toggle" ng-click="showPending()"><i class="fa fa-ban"></i> {{currentPage.statistics.pending}} Pending</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 class="{{currentPage.statistics.count === 0 ? 'gray' : ''}}">{{currentPage.statistics.count}} Total ({{nanosToReadableUnit(currentPage.statistics.totalNanos)}})</span>
<span ng-if="currentPage.filtered > 0" class="bold toggle" ng-click="clearFilter()">({{ currentPage.filtered }} Filtered)</span>
</div>

Expand Down Expand Up @@ -491,7 +494,7 @@ <h4 ng-hide="!currentPage.loading">Loading <i class="fa fa-circle-o-notch fa-spi
<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>
class="aborted label radius secondary"><i class="fa fa-fa-ban"></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