Need some help thinking in TestNG terms. I have a large third party test suite written in TestNG and I'd like to be able to compose tests from it and run them from Intellij or Maven
Is it possible to compose tests together programmatically and still leverage the runners built into these other frameworks. In JUnit you could do this:
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class ExampleTest extends TestCase {
public static Test suite() {
final TestSuite suite = new TestSuite("suite");
suite.addTestSuite(org.thirdparty.tests.FooTest.class);
suite.addTestSuite(org.thirdparty.tests.BarTest.class);
suite.addTestSuite(org.thirdparty.tests.BazTest.class);
return suite;
}
}
Can't seem to find an equivalent TestNG concept. I see there's an XmlSuite class that allows a suite to be programmatically created, but I see no way to hand this off to a test runner like Maven Surefire or Intellij.
Is it possible to do the simple and direct and create a Test which hands over the XmlSuite object or otherwise programmatically compose tests without also having to control the test runner?