2016-08-11 47 views
0

我想使用系统支持的ReportNG属性here但我不使用testng.xml文件来运行测试。通过在maven命令行上指定TestNG组来执行测试。我指定ReportNG系统性能上的pom.xml文件 -使用支持的系统属性而不使用testng.xml

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>default-test</id> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      <configuration> 
       <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine> 
       <properties> 
        <property> 
         <name>usedefaultlisteners</name> 
         <value>false</value> 
        </property> 
        <property> 
         <name>listener</name> 
         <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
        </property> 
       </properties> 
       <systemProperties> 
        <systemProperty> 
         <name>org.uncommons.reportng.frames</name> 
         <value>false</value> 
        </systemProperty> 
        <systemProperty> 
         <name>org.uncommons.reportng.title</name> 
         <value>OBS Test Report</value> 
        </systemProperty> 
       </systemProperties> 
       <systemPropertyVariables> 
        <target.host>${target_host}</target.host> 
        <target.port>22</target.port> 
       </systemPropertyVariables> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

但性能org.uncommons.reportng.framesorg.uncommons.reportng.title没有生成reportng报告中的任何影响。我应该在哪里指定这些属性?

+0

你是如何执行的Maven?你能发布你使用的命令吗? – Tunaki

+0

这里是maven命令用来运行测试 - '''$ MAVEN_HOME/bin/mvn -DskipTests = false -Dgroups = Temp test -e''' – Tarun

回答

0

我发现使用的pom.xml如下的解决方案 -

<plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>default-test</id> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine> 
           <properties> 
            <property> 
             <name>listener</name> 
             <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
            </property> 
           </properties> 
           <systemPropertyVariables> 
            <org.uncommons.reportng.title>OBS Test Suite</org.uncommons.reportng.title> 
            <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output> 
           </systemPropertyVariables> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
相关问题