Considering Confluence Cloud?
Get the high-level details of Confluence Cloud and available features by plan.
This macro was intentionally excluded from the new editor and will be deprecated from the legacy editor soon. Read the announcement for more information
The JUnit Report macro displays a summary of JUnit test results from a directory accessible by the Confluence Cloud server. JUnit is a unit testing framework which allows programmers to ensure that individual units of Java source code are functioning correctly.The JUnit Report macro appears as shown in the screenshot below.
When generating reports from the JUnit Report macro, set the Apache Ant formatter to 'XML'.
To add the JUnit Report macro:
When editing, select from the toolbar
Find the macro by name and select it
Configure it as needed
You can also type / on the page to bring up the same list you'd see by selecting from the toolbar. Continue typing the name of the macro to filter the list.
To edit an existing macro
Select the macro placeholder.
Select the Edit icon to open the configuration panel.
Configure the parameters. Your changes are saved as you go.
Resume editing the page, and the panel closes.
You can also select the centered , medium-width , and full-width icons to adjust the width of some macros. Select the trashcan iconto remove the macro.
Parameters are options that you can set to control what and how content from the macro appears on the page.
If the parameter name used in Confluence Cloud storage format is different than the label used when inserting macros using the browser or the slash command, it will be listed below in brackets (example).
Parameter | Required | Default | Description |
---|---|---|---|
URL of the test result XML file | Must include either the directory or the url parameter | None | URL of a particular test result XML file. Is overridden by the Directory (URL) of your test result files parameter if you use both. Example, from a Confluence instance: http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml For Confluence installations without anonymous user access, you can specify logon credentials as part of this parameter in the form of URL parameters:
|
Directory (URL) of your test result files | Must include either the directory or the url parameter | None | URL of a directory containing your test result files. This must be a directory name and not the XML file itself. Overrides the URL of the test result XML file parameter if you use both. Example, file:///C:/TEMP/ Example, for a network drive: http://*host*/*path* |
Report Detail | No | all | Detail for the report. Can be all, fixture, summary or failuresonly. |
Debug | No | None | Shows the content of failures, as well as the error messages. |
Wiki markup is useful when you need to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.
Macro name: junitreport
Macro body: None.
Loading JUnit reports from a local drive:
1
2
3
4
{junitreport:directory=file:///C:/TEMP/}
Loading JUnit reports from a network drive:
1
2
3
4
{junitreport:url=http://*host*/*path*}
Loading JUnit reports from a Confluence instance:
1
2
3
4
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml}
Loading JUnit reports from a Confluence Cloud instance that requires authentication:
If your Confluence instance is not accessible by anonymous users, specify login credentials with the os_username and os_password URL parameters (as part of the macro's url parameter). In this case, we are specifying a username of 'admin' and a password of 'secret'.
1
2
3
4
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml?os_username=admin&os_password=secret}
Was this helpful?