Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion lib/generate-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ function generateReport(options) {
ambiguous: 0,
failed: 0,
passed: 0,
skipped: 0,
total: 0,
ambiguousPercentage: 0,
failedPercentage: 0,
skippedPercentage: 0,
passedPercentage: 0
},
reportName: reportName,
Expand All @@ -95,6 +97,7 @@ function generateReport(options) {
// Percentages
suite.featureCount.ambiguousPercentage = _calculatePercentage(suite.featureCount.ambiguous, suite.featureCount.total);
suite.featureCount.failedPercentage = _calculatePercentage(suite.featureCount.failed, suite.featureCount.total);
suite.featureCount.skippedPercentage = _calculatePercentage(suite.featureCount.skipped, suite.featureCount.total);
suite.featureCount.passedPercentage = _calculatePercentage(suite.featureCount.passed, suite.featureCount.total);

/**
Expand Down Expand Up @@ -151,6 +154,7 @@ function generateReport(options) {
feature.time = 0;
feature.isFailed = false;
feature.isAmbiguous = false;
feature.isSkipped = false;
suite.featureCount.total++;
feature.id = `${uuid()}.${feature.id}`.replace(/[^a-zA-Z0-9-_]/g, '-');
feature.app = 0;
Expand All @@ -168,6 +172,9 @@ function generateReport(options) {
} else if (feature.isAmbiguous) {
suite.featureCount.ambiguous++;
feature.ambiguous++;
} else if (feature.isSkipped) {
feature.skipped++;
suite.featureCount.skipped++;
} else {
feature.passed++;
suite.featureCount.passed++;
Expand Down Expand Up @@ -265,6 +272,8 @@ function generateReport(options) {
}
});

feature.isSkipped = feature.scenarios.total === feature.scenarios.skipped;

return feature;
}

Expand Down Expand Up @@ -325,7 +334,7 @@ function generateReport(options) {
if (step.result.status === RESULT_STATUS.ambiguous) {
return scenario.ambiguous++;
}

scenario.skipped++;
});

Expand Down
12 changes: 12 additions & 0 deletions templates/components/features-overview.chart.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
</td>
<td class="percentage"><%= suite.featureCount.failedPercentage %> %</td>
</tr>
<%if(suite.featureCount.skipped > 0){%>
<tr>
<td>
<p data-toggle="tooltip" data-placement="left"
title="Scenario skipped">
<i class="fa fa-arrow-circle-right skipped-color"></i>
Skipped
</p>
</td>
<td class="percentage"><%= suite.featureCount.skippedPercentage %> %</td>
</tr>
<%}%>
<%if(suite.featureCount.ambiguous > 0){%>
<tr>
<td>
Expand Down
3 changes: 3 additions & 0 deletions templates/components/features-overview.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
<% if (feature.isFailed) { %>
<% status = 'Failed'; %>
<% statusIcon = 'exclamation-circle failed-color'; %>
<% } else if (feature.isSkipped) { %>
<% status = 'Skipped'; %>
<% statusIcon = 'arrow-circle-right skipped-color'; %>
<% } else if (feature.isAmbiguous) { %>
<% status = 'Ambiguous'; %>
<% statusIcon = 'flash ambiguous-color'; %>
Expand Down
8 changes: 6 additions & 2 deletions templates/features-overview.index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,21 @@
labels: [
"Passed",
"Failed",
"Skipped",
"Ambiguous"
],
datasets: [{
data: [
<%= suite.featureCount.passedPercentage %>,
<%= suite.featureCount.failedPercentage %>,
<%= suite.featureCount.ambiguousPercentage %>],
<%= suite.featureCount.skippedPercentage %>,
<%= suite.featureCount.ambiguousPercentage %>
],
backgroundColor: [
"#26B99A",
"#E74C3C",
"#b73122"
"#3498DB",
"#b73122"
]
}]
},
Expand Down