【问题标题】:How to specify test and suite names in maven-surefire-plugin如何在 maven-surefire-plugin 中指定测试和套件名称
【发布时间】:2015-01-18 20:01:21
【问题描述】:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >  
<suite name="SuiteName" verbose="1" >
  <test name="TestName1" >
    <classes>
       <class name="NoPackageTest" />
    </classes>
  </test>

  <test name="TestName2">
    <classes>
      <class name="test.sample.ParameterSample"/>
      <class name="test.sample.ParameterTest"/>
    </classes>
  </test>
</suite>

有人可以告诉我如何在 maven-surefire-plugin 中指定 SuiteName、TestName1 和 TestName2。

提前致谢

【问题讨论】:

    标签: maven testng


    【解决方案1】:

    设置surefire来运行你的套件就足够了,它会依次运行所属的测试类,你可以通过如下配置来做到这一点

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</version>
                <configuration>
                    <includes>
                        <include>**/SuiteName.java</include>
                    </includes>
                </configuration>
            </plugin>
    

    【讨论】:

    • 是的,我一直在通过 pom.xml 做同样的事情,我想在报告中看到套件和测试的名称,所以我正在寻找它。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-27
    • 2013-06-27
    • 2012-02-11
    • 2022-01-14
    • 1970-01-01
    • 1970-01-01
    • 2019-07-14
    相关资源
    最近更新 更多