TestNG.xml suite to include all packages all files

sibidiba picture sibidiba · Sep 18, 2012 · Viewed 33k times · Source

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

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.

Answer

luis picture luis · Nov 4, 2013

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