File tree Expand file tree Collapse file tree
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 Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ public void before()
5656 System .out .println ("Runs before scenarios *not* tagged with @foo" );
5757 }
5858
59+ @ Before ("@ExceptionOnBefore" )
60+ public void beforeWithException () {
61+ throw new RuntimeException ("Exception in @Before" );
62+ }
63+
5964 @ After
6065 public void after (Scenario scenario )
6166 {
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 2626 function getFailedScenarioCount ( feature ) {
2727 var failedScenarios = 0 ;
2828 feature . scenarios . forEach ( function ( scenario ) {
29- if ( scenario . result . failedStepCount ) {
29+ if ( scenario . result . failedStepCount || scenario . result . stepCount === scenario . result . skippedStepCount ) {
3030 failedScenarios ++ ;
3131 }
3232 } ) ;
7878 step . result . searchKeyword = ":" + step . result . status + "Step" ;
7979 } ) ;
8080
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+ }
8288 scenario . result . searchKeyword = ":" + scenario . status + "Scenario" ;
8389 } ) ;
8490
94100 data . duration = function ( feature ) {
95101 var value = 0 ;
96102
97- if ( isNaN ( feature ) )
98- {
99- value = feature . result . duration ;
100- }
101- else
102- {
103+ if ( ! isNaN ( feature ) ) {
103104 value = feature ;
105+ } else if ( feature . result . duration ) {
106+ value = feature . result . duration ;
104107 }
105108
106109 if ( value < 1000000000 )
You can’t perform that action at this time.
0 commit comments