The JUnit Report Macro displays a summary of JUnit test results from a directory accessible by the Confluence server.

JUnit is a unit testing framework which allows programmers to ensure that individual units of Java source code are functioning correctly.

When generating reports, set the Apache Ant formatter to 'XML'.

JUnit Report Macro

{junitreport:directory=file:///*directory*/}

For example:

{junitreport:directory=file:///C:/TEMP/}

(warning) Must be a directory name and not the xml file itself.

or

{junitreport:url=http://*host*/*path*}

For example:

{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml}

where:

directory : URL of a directory containing your test result files.
url : URL of a particular test result XML file.
reportdetail: Detail for report. Can be 'all', 'fixture', 'summary' or 'failuresonly'.
debug: Shows the content of failures, as well as the error messages.

(warning) If your Confluence instance is not accessible by anonymous users and you want to parse a XML file attached in a space, the macro might fail to render. To make this work you need to add this parameter: ?os_username=your_username&os_password=your_password in the url. For example:

{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml?os_username=admin&os_password=admin}

If you use both the directory and url parameters in the same macro, the directory will be used and the url parameter ignored.

RELATED TOPICS

Working with Macros

Take me back to Confluence User Guide

  • No labels