Details
Description
Problem Statement:
When running the JBehave tests, the ReportsCount that is output to the JUnit console is counting non-story Reports.
Example:
This is what the code currently returns:
org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: ReportsCount[stories=9,storiesNotAllowed=0,storiesPending=0,scenarios=1,scenariosFailed=1,scenariosNotAllowed=0,scenariosPending=0,stepsFailed=1]
Proposed change:
Change line 121 of the TemplateViewGenerator to use a method that filters out Reports that don't have any scenarios.
current : int stories = reports.size();
proposed: int stories = storyCount();
private int storyCount(){
int storyCount = 0;
for (Report report : reports){
if (report.getStats().containsKey("scenarios"))
}
return storyCount;
}
Results after change:
org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: ReportsCount[stories=1,storiesNotAllowed=0,storiesPending=0,scenarios=1,scenariosFailed=1,scenariosNotAllowed=0,scenariosPending=0,stepsFailed=1]
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 3.6 [ 17721 ] | |
Affects Version/s | 3.5.4 [ 18081 ] | |
Affects Version/s | web-3.4.3 [ 18124 ] |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Applied patch with thanks.