You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sending the TestRunFinished event to the event bus triggers TestNGReporter's runFinishHandler to close the System.out print stream, which affects other event handlers and code still wanting to write to sysout, e.g. runtime.printSummary() in the method above but also actual TestNG listeners.
Don't close the output stream in runFinishHandler or remove the whole handler because it does nothing else.
Steps to Reproduce (for bugs)
Run a Cucumber TestNG test using the cucumber-testng-2.0.0-SNAPSHOT.jar library.
The text was updated successfully, but these errors were encountered:
lvanderveekens
changed the title
cucumber-testng: tearDownClass() does not print summary
cucumber-testng: tearDownClass() does not print run summary
Jul 8, 2017
The TestNGReporter does not know (and should not know) if it is System.out it is printing to, so it should call close(). It is the NiceAppendable that should avoid to close System.out.
Summary
The
@AfterClass
step AbstractTestNGCucumberTests#tearDownClass fails to print the cucumber run summary despite whether all tests are green or not.In AbstractTestNGCucumberTests there's the following failing snippet:
and TestNGCucumberRunner#finish looks like this:
Sending the
TestRunFinished
event to the event bus triggersTestNGReporter
'srunFinishHandler
to close theSystem.out
print stream, which affects other event handlers and code still wanting to write to sysout, e.g.runtime.printSummary()
in the method above but also actual TestNG listeners.Possible Solution
Don't close the output stream in
runFinishHandler
or remove the whole handler because it does nothing else.Steps to Reproduce (for bugs)
Run a Cucumber TestNG test using the
cucumber-testng-2.0.0-SNAPSHOT.jar
library.The text was updated successfully, but these errors were encountered: