2016-08-11 23 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> 
相關問題