} else {
capabilities = getDesiredCapabilities();
- WebDriver dr = TestBench.createDriver(new RemoteWebDriver(new URL(
- getHubURL()), capabilities));
- setDriver(dr);
+ if (System.getProperty("useLocalWebDriver") != null) {
+ setupLocalDriver(capabilities);
+ } else {
+ WebDriver dr = TestBench.createDriver(new RemoteWebDriver(
+ new URL(getHubURL()), capabilities));
+ setDriver(dr);
+ }
}
int w = SCREENSHOT_WIDTH;
import java.util.Enumeration;
import java.util.Properties;
-import org.apache.commons.io.IOUtils;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.safari.SafariDriver;
driver = new ChromeDriver();
} else if (BrowserUtil.isSafari(desiredCapabilities)) {
driver = new SafariDriver();
+ } else if (BrowserUtil.isPhantomJS(desiredCapabilities)) {
+ driver = new PhantomJSDriver();
} else {
throw new RuntimeException(
"Not implemented support for running locally on "
/**
* This is the total limit of actual JUnit test instances run in parallel
*/
- private static final int MAX_CONCURRENT_TESTS = 50;
+ private static final int MAX_CONCURRENT_TESTS;
/**
* This is static so it is shared by all tests running concurrently on the
* same machine and thus can limit the number of threads in use.
*/
- private static final ExecutorService service = Executors
- .newFixedThreadPool(MAX_CONCURRENT_TESTS);
+ private static final ExecutorService service;
+
+ static {
+ if (System.getProperty("useLocalWebDriver") != null) {
+ MAX_CONCURRENT_TESTS = 10;
+ } else {
+ MAX_CONCURRENT_TESTS = 50;
+ }
+ service = Executors.newFixedThreadPool(MAX_CONCURRENT_TESTS);
+ }
public TB3Runner(Class<?> klass) throws InitializationError {
super(klass);