org.testng.TestRunner Java Examples

The following examples show how to use org.testng.TestRunner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestRunnerFactory.java    From qaf with MIT License 5 votes vote down vote up
@Override
public TestRunner newTestRunner(ISuite suite, XmlTest test, Collection<IInvokedMethodListener> listeners,
		List<IClassListener> classListeners) {
	TestRunner runner = null!=testRunnerFactory?testRunnerFactory.newTestRunner(suite, test, listeners, classListeners):
              new TestRunner(configuration, suite, test,
	                  false /*skipFailedInvocationCounts */,
	                  listeners,classListeners);;
	init(runner);
	return runner;
}
 
Example #2
Source File: TestRunnerFactory.java    From qaf with MIT License 5 votes vote down vote up
private void init(TestRunner runner){
	convert(runner.getAllTestMethods());
	convert(runner.getAfterSuiteMethods());
	convert(runner.getAfterTestConfigurationMethods());
	convert(runner.getBeforeSuiteMethods());
	convert(runner.getBeforeTestConfigurationMethods());
}
 
Example #3
Source File: SeleneseTestNgHelper.java    From selenium with Apache License 2.0 5 votes vote down vote up
@BeforeSuite
@Parameters({"selenium.host", "selenium.port"})
public void attachScreenshotListener(@Optional("localhost") String host,
    @Optional("4444") String port, ITestContext context) {
  if (!"localhost".equals(host)) {
    return;
  }
  Selenium screenshotTaker = new DefaultSelenium(host, Integer.parseInt(port),
      "", "");
  TestRunner tr = (TestRunner) context;
  File outputDirectory = new File(context.getOutputDirectory());
  tr.addListener((IResultListener) new ScreenshotListener(outputDirectory,
      screenshotTaker));
}