• 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下

  • 相关阅读:
    FS配置文件
    FS 目录结构
    FreeSWITCH 架构
    FreeSWITCH API 与APP
    呼入电话处理
    FS 分机呼出
    PartyUs 待添加内容(不定期更新)
    PHP-Codeigniter:实习笔记5
    PHP-Codeigniter:实习笔记4
    PHP-Codeigniter:实习笔记3
  • 原文地址:https://www.cnblogs.com/cjy-blog/p/14242832.html
Copyright © 2020-2023  润新知