Adam Matan
Adam Matan

Reputation: 136499

Junit HTML report builder

Consider the following XML results of a JUnit test:

<?xml version="1.0" ?>
<testsuite errors="0" failures="1" name="TheTest-20130618162859" 
           tests="3" time="0.000">
        <testcase classname="TheTest" name="testOne" time="0.000"/>
        <testcase classname="TheTest" name="testTwo" time="0.000"/>
        <testcase classname="TheTest" name="testThree" time="0.000">
                <failure message="3 != 4" type="AssertionError">
<![CDATA[Traceback (most recent call last):
  File "blah.py", line 11, in testThree
    self.assertEquals(3, 4)
AssertionError: 3 != 4
]]>             </failure>
        </testcase>
        <system-out>
<![CDATA[]]>    </system-out>
        <system-err>
<![CDATA[]]>    </system-err>
</testsuite>

How do I create a HTML report from these results?

Addendum: Each execution of the test suite creates a new file:

TEST-TheTest-20130618162859.xml
TEST-TheTest-20130618163459.xml
TEST-TheTest-20130618163600.xml

I'd prefer a report builder that can view the history of each test.

Upvotes: 1

Views: 1371

Answers (1)

Mukul Joshi
Mukul Joshi

Reputation: 324

If you could use Ant then you would just use the JUnitReport task as detailed here

If you are using Maven then use Surefire plugin

Or if you want to run XSLT transform yourself here is the XSLT file used by ANT

Upvotes: 1

Related Questions