Skip to content

Commit

Permalink
Remove obsolete property setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardesco committed May 25, 2015
1 parent fe4baca commit b87f506
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
20 changes: 0 additions & 20 deletions src/test/java/com/lazerycode/selenium/DriverFactory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lazerycode.selenium;

import com.lazerycode.selenium.config.DriverType;
import com.lazerycode.selenium.config.WebDriverThread;
import com.lazerycode.selenium.listeners.ScreenshotListener;
import org.openqa.selenium.WebDriver;
Expand All @@ -19,25 +18,6 @@ public class DriverFactory {
private static List<WebDriverThread> webDriverThreadPool = Collections.synchronizedList(new ArrayList<WebDriverThread>());
private static ThreadLocal<WebDriverThread> driverThread;

public DriverFactory() {
setBinaryVariables();
}

private void setBinaryVariables() {
for (DriverType driverType : DriverType.values()) {
String variable = driverType.getWebDriverSystemPropertyKey();
if (null != variable) {
String systemProperty = System.getProperty(variable);
if (null == systemProperty || systemProperty.isEmpty()) {
String environmentalVariable = System.getenv(variable);
if (null != environmentalVariable && !environmentalVariable.isEmpty()) {
System.setProperty(variable, environmentalVariable);
}
}
}
}
}

@BeforeSuite
public static void instantiateDriverObject() {
driverThread = new ThreadLocal<WebDriverThread>() {
Expand Down
25 changes: 0 additions & 25 deletions src/test/java/com/lazerycode/selenium/config/DriverType.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
public WebDriver getWebDriverObject(DesiredCapabilities capabilities) {
return new ChromeDriver(capabilities);
}

@Override
public String getWebDriverSystemPropertyKey() {
return "webdriver.chrome.driver";
}
},
IE {
public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
Expand All @@ -61,11 +56,6 @@ public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
public WebDriver getWebDriverObject(DesiredCapabilities capabilities) {
return new InternetExplorerDriver(capabilities);
}

@Override
public String getWebDriverSystemPropertyKey() {
return "webdriver.ie.driver";
}
},
SAFARI {
public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
Expand All @@ -87,11 +77,6 @@ public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
public WebDriver getWebDriverObject(DesiredCapabilities capabilities) {
return new OperaDriver(capabilities);
}

@Override
public String getWebDriverSystemPropertyKey() {
return "webdriver.opera.driver";
}
},
PHANTOMJS {
public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
Expand All @@ -109,18 +94,8 @@ public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
public WebDriver getWebDriverObject(DesiredCapabilities capabilities) {
return new PhantomJSDriver(capabilities);
}

@Override
public String getWebDriverSystemPropertyKey() {
return "phantomjs.binary.path";
}
};


public String getWebDriverSystemPropertyKey() {
return null;
}

protected DesiredCapabilities addProxySettings(DesiredCapabilities capabilities, Proxy proxySettings) {
if (null != proxySettings) {
capabilities.setCapability(PROXY, proxySettings);
Expand Down

0 comments on commit b87f506

Please sign in to comment.