views:

35

answers:

1

Hi,

I have Java project built with Maven2. There is used JUnit framework for testing ( and Selenium but it is irrelevant ). I would like to add screenshot ( I have it ) into result of tests. Here, on SO, I found similar question which solves it but with Ant. I would like to know if there is any option how to manage it with Maven2 instead of Ant or if there is other solution how to add screenshot into test results.

For testing in Maven I am using Maven surefire plugin and Maven surefire report plugin

Thanks a lot.

A: 

Unfortunately I don't think it is easily feasible without patching the maven surefire report plugin. The report plugin takes the surefire XML report and generates the maven HTML report using the Doxia library.

The class generating the report is here:

http://maven.apache.org/plugins/maven-surefire-report-plugin/xref/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.html

Patching this class to alter to report output is almost straightforward; however it requires maintaining a custom version of the surefire report plugin.

Jcs