Verbose TestNG report with Maven Surefire

Verbose TestNG report with Maven Surefire

Using TestNG console output can be very inconvenient if you have lots of test cases. The better solution is to create an HTML report containing detailed information about testing progress. You can use the Maven Surefire plugin for this. Surefire report is a part of the project maven website, so at first we need to find out what is it.

Maven  site

Since you use Java to write Selenium tests you are free to use Maven tool to run lifecycle phases. The “Site” phase includes creating a project’s website with whole information about it (e.g. dependencies, documentation, plugins, etc.). To  create your project’s website just run this command

mvn site

or run Maven phase in Intellij Idea interface

After the task will complete go to the target/site directory in the project base directory. Open index.html file in any browser you have.

Maven Surefire Report

To add Surefire report to the project website just add reporting section to the pom.xml file

<project xmlns="" xmlns:xsi=""

After that, run Maven site phase again and refresh the project website main page. You should see new “Project Reports” section.

There you can find detailed information about the last testing attempt.

Author: vlad