51Testing软件测试论坛
标题:
maven配置reportNG未生效,生成的报告还是跟testNG的报告一样
[打印本页]
作者:
lihailing
时间:
2015-5-28 16:53
标题:
maven配置reportNG未生效,生成的报告还是跟testNG的报告一样
网上找了很多资料都找不出问题出来哪里,求大神指点。pom.xml配置如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd
">
<modelVersion>4.0.0</modelVersion>
<groupId>OA</groupId>
<artifactId>YF</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>YF</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<properpties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,
org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properpties>
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
<!-- <repositories> <repository> <id>java-net</id> <url>
http://download.java.net/maven/2</url>
</repository> </repositories> -->
</project>
testNG.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1">
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter"></listener>
<listener class-name="org.uncommons.reportng.JUnitXMLReporter"></listener>
</listeners>
<test name="test1" preserver-order="true">
<classes>
<class name="OA.YF.OpenBaiduTest">
</class>
</classes>
</test>
</suite>
生成的报告如下图所示:
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2