Skip report generation using TestNG and sure-fire

2019-07-24 17:52发布

问题:

I am new to TestNG framework. I don't want to generate reports using sure-fire plugin, is there any option to disable this. I also prefer to stop report generation using TestNG framework. In current situation, same report is getting generated 2 times, once by sure-fire plugin (under target directory) and once by TestNG framework (under test-output directory). Also, like if you could suggest some good tutorial on customizing the reports. The current reports are just too verbose. This is how I have configured sure-fire plugin.

<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.17</version>
       <configuration>
         <suiteXmlFiles>
           <suiteXmlFile>testng.xml</suiteXmlFile>
         </suiteXmlFiles>                 
       </configuration>
</plugin>

This is how my testng.xml looks

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
  <test name="Test">
    <classes>
      <class name="SampleTest"/>
      <methods>
        <exclude name="testRun"></exclude>
      </methods>
    </classes>
  </test> <!-- Test-->
</suite> <!-- Suite-->

Edit:

I am able to skip report by setting below property for maven-surefire-plugin. But this has skipped both the reports. I wish to generate at-least 1 brief report.

     <properties>
       <property>
           <name>usedefaultlisteners</name>
           <key>false</key>
       </property>
     </properties>