cbeust/testng — Issue #159: When running TestNG programmatically, child xml suites are not run (when added using setSuiteFIles())
Author: randomsync
Created: 2012-01-17 22:29:31+00:00
State: open

When running TestNG programmatically by creating and adding XmlSuite, if child suites are added using setSuiteFiles(), the child suites are not run.

If the same suite is run using testng.xml file (either directly or programmatically using setTestSuites()), the child suites are run correctly. Below is sample code:
------
// create a suite programmatically
XmlSuite suite = new XmlSuite();
suite.setName("Programmatic XmlSuite");

// create and add a test case for the suite

// add a suite-file to the suite
suite.setSuiteFiles(Arrays.asList("./Suite1.xml"));

//add suite to testng
testng.setXmlSuites(Arrays.asList(suite));

testng.run();