TestNG.xml 套件包含所有包的所有文件

2022-01-14 00:00:00 automated-tests java testng maven

即将用 Maven+TestNG+Selenium 实现一个测试框架.

Just about to implement a test framework with Maven+TestNG+Selenium.

你如何声明一个告诉 TestNG 运行 ALL 测试的 suite.xml?我已经尝试了所有这些都无济于事:

How do you declare a suite.xml that tells TestNG to run ALL tests? I've tried all these to no avail:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Toplevel TestNG configuration" verbose="10">
  <test name="all">
    <classes>
      <class name="*" />
    </classes>
  </test>
</suite>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Toplevel TestNG configuration" verbose="10">
  <test name="all">
    <groups>
      <run>
        <include name="*" />
        <exclude name="disabled" />
      </run>
    </groups>
  </test>
</suite>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Toplevel TestNG configuration" verbose="10">
  <test name="all">
    <packages>
      <package name="*" />
    </packages>
  </test>
</suite>

我需要使用不同的参数指定不同的套件配置,但都运行所有测试.我可以挖掘的每个示例都明确列出了对我来说意义小于零的每个类或包.

I need to specify different suite configurations with different paramers but all running all tests. Every example I could dig up explicitely lists each class or package which makes less than zero sense to me.

推荐答案

据我所知,应该使用 .* 来匹配它们.

Should use .* to match them all as far as I know.

相关文章