File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed
cucumber-formatter/src/test
java/at/porscheinformatik/cucumber/formatter
resources/at/porscheinformatik/cucumber/formatter
cucumber-report-web/src/main/resources/static/js Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ public void before()
56
56
System .out .println ("Runs before scenarios *not* tagged with @foo" );
57
57
}
58
58
59
+ @ Before ("@ExceptionOnBefore" )
60
+ public void beforeWithException () {
61
+ throw new RuntimeException ("Exception in @Before" );
62
+ }
63
+
59
64
@ After
60
65
public void after (Scenario scenario )
61
66
{
Original file line number Diff line number Diff line change
1
+ @ExceptionOnBefore
2
+ Feature : Check whether an exception in the before-hook doesn't mess up the report
3
+
4
+ Scenario : Simple Addition
5
+ Given a calculator I just turned on
6
+ When I add 4 and 5
7
+ Then the result is 9
Original file line number Diff line number Diff line change 26
26
function getFailedScenarioCount ( feature ) {
27
27
var failedScenarios = 0 ;
28
28
feature . scenarios . forEach ( function ( scenario ) {
29
- if ( scenario . result . failedStepCount ) {
29
+ if ( scenario . result . failedStepCount || scenario . result . stepCount === scenario . result . skippedStepCount ) {
30
30
failedScenarios ++ ;
31
31
}
32
32
} ) ;
78
78
step . result . searchKeyword = ":" + step . result . status + "Step" ;
79
79
} ) ;
80
80
81
- scenario . status = scenario . result . failedStepCount ? "failed" : ( scenario . result . unknownStepCount ? 'unknown' : 'passed' ) ;
81
+ if ( scenario . result . failedStepCount || scenario . result . stepCount === scenario . result . skippedStepCount ) {
82
+ scenario . status = "failed" ;
83
+ } else if ( scenario . result . unknownStepCount ) {
84
+ scenario . status = 'unknown' ;
85
+ } else {
86
+ scenario . status = 'passed' ;
87
+ }
82
88
scenario . result . searchKeyword = ":" + scenario . status + "Scenario" ;
83
89
} ) ;
84
90
94
100
data . duration = function ( feature ) {
95
101
var value = 0 ;
96
102
97
- if ( isNaN ( feature ) )
98
- {
99
- value = feature . result . duration ;
100
- }
101
- else
102
- {
103
+ if ( ! isNaN ( feature ) ) {
103
104
value = feature ;
105
+ } else if ( feature . result . duration ) {
106
+ value = feature . result . duration ;
104
107
}
105
108
106
109
if ( value < 1000000000 )
You can’t perform that action at this time.
0 commit comments