Skip to content
Socrates edited this page Apr 30, 2020 · 3 revisions

Use Skip Execution mode as Fail Fast

In your TestListener class upon TestFailure set system property "org.uncommons.reportng.skip.execution" true , like :

 public class TestListener extends TestListenerAdapter {

 @Override
 public void onTestFailure(ITestResult iTestResult) {
     System.setProperty("org.uncommons.reportng.skip.execution", "true");
 }
 }

In this case the skip execution mode is enabled upon first failure, so the rest of the testNG tests will be skipped.

Links under submenu External Links

You can add any local file generated from test execution as "External Link". This is going to be available at submenu "External Links". Example :

System.setProperty(HTMLReporter.EXTERNAL_LINKS, "{\"External Link to a local file\":\"../TestFile.log\"}");

System property "HTMLReporter.EXTERNAL_LINKS" stores 'key:value' pairs of external Links. Key is used as text for link url and the value as the absolute/relative file url.

Use reportNG title as description into current Jenkins job execution

Available after reportNG v2.4.7 the reportNG title , configured via system.property org.uncommons.reportng.title, can be used as input into Jenkin's description. There is a new file ' ${testNG_Output_Path}\title\reportNG.title ' that can now be used with the following jenkins groovy function to auto-update the current jenkins build description with the reportNG title :

def setDescription() {
echo "\u2756 Set Description"
try{
	def description = readFile('myReportPath\title\reportNG.title').trim()
	currentBuild.description = "${description}"
} catch (caughtError) {
            //Do nothing
}
}
return this