zoukankan      html  css  js  c++  java
  • selenium+testng+reportng使用maven运行testng.xml不能生成测试reportng测试报告

    testng使用reportng     pom.xml配置

    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.14.3</version>
    <scope>test</scope>
    </dependency>
    <!-- 添加reportNG依赖 -->
    <dependency>
    <groupId>org.uncommons</groupId>
    <artifactId>reportng</artifactId>
    <version>1.1.4</version>
    <scope>test</scope>
    <!-- 排除testNG依赖 -->
    <exclusions>
    <exclusion>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>3.0</version>
    <scope>test</scope>
    </dependency>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20</version>
    <configuration>
    <forkMode>once</forkMode>
    <argLine>-Dfile.encoding=UTF-8</argLine>
    <suiteXmlFiles>
    <suiteXmlFile>testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20</version>
    <configuration>
    <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>
    <!-- <workingDirectory>target/</workingDirectory>-->
    <forkMode>always</forkMode>

    testng.xml配置
    <listener class-name="org.uncommons.reportng.HTMLReporter"/>
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>

    ======================================================================

    idea中调试右击运行testng.xml可以正常生成reportng的报告,生成目录在test-output目录中,但是执行mvn clean test用例正常按照testng配置的执行,但是在test-output目录中就是找不到生产的reportng报告。最后发现不是没有生成reportng报告,而是生成在其他地方,target-surefire-reports-html下

  • 相关阅读:
    试算平衡
    对账服务
    会计科目与账户
    支付系统难点全面梳理剖析:核算对账核心
    支付系统设计——你不可不知的会计核心(转发整理)
    支付系统设计之查漏补缺的一环:差错账处理
    支付清算业务总结
    财务对账系统v1.0立项到结项的整体回顾
    DNS视图及压力测试(四)
    一个快速检测系统CPU负载的小程序
  • 原文地址:https://www.cnblogs.com/cjy-blog/p/14242832.html
Copyright © 2011-2022 走看看