testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

Reporter.log() logs to old report, but not new report #244

Closed dhemery closed 12 years ago

dhemery commented 12 years ago

When I click Reporter output in a new-style report, the reporter output is empty. It does not include the information that my tests reported through Reporter.log().

The Reporter.log() output does appear in the old-style report, but not in the new-style reports.

cbeust commented 12 years ago

It seems to work for me: http://imgur.com/gvrzK

dhemery commented 12 years ago

The output in your image seems to be associated with a particular test method (or test result).

I call Reporter.log() during ISuiteListener.onFinish(ISuite), to write statistics about the entire test run.

Perhaps the difference between my results and yours is that we call Reporter.log() at different phases of the test run. When you call it, there's a current test result to associate the output with. When I call it, the test run is completed, so I suspect the log line is handled some way other than associating it with the current test result. Perhaps the two reporters (old and new style) treat the not-associated-with-a-test-result log differently.

dhemery commented 12 years ago

SuiteHtmlReporter writes all Reporter output to the report.

ReporterPanel writes only the output associated with test results, and ignores output not associated with a test result.

If ReporterPanel could include non-test-result Reporter output, that would fix my issue.

Please reopen and fix this issue.

cbeust commented 12 years ago

This is now fixed in master and the beta: http://testng.org/beta

dhemery commented 12 years ago

This fix will be a big help. Cheers!