Sunday, 15 March 2020

TestNG: surefire reports

TestNG framework allow us to generate test reports information in both XML and HTML format.

ReportDemo.java
package com.sample.app.tests;

import static org.testng.Assert.assertTrue;

import org.testng.annotations.Test;

public class ReportDemo {

 @Test
 public void A() {
  assertTrue(false);
 }

 @Test
 public void B() {
  assertTrue(true);
 }
}

Run ReportDemo.java as ‘TestNG Test’.

Refresh the project, you can observe there is a folder ‘test-output’.

Open emailable-report.html file, you can see the information about test cases.


Open index.html to get more detailed report information.
Previous                                                    Next                                                    Home

No comments:

Post a Comment