mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-17 16:15:20 +01:00
Removed deprecated code in SeleniumDriver
This commit is contained in:
parent
47cc92da00
commit
693f008942
@ -25,11 +25,12 @@ import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_JAVASCRIPT;
|
||||
|
||||
public class SeleniumDriver extends ExternalResource {
|
||||
|
||||
private WebDriver driver;
|
||||
@ -42,21 +43,15 @@ public class SeleniumDriver extends ExternalResource {
|
||||
|
||||
driver = getChromeWebDriver();
|
||||
}
|
||||
|
||||
|
||||
private WebDriver getChromeWebDriver() {
|
||||
if (System.getProperty("TRAVIS").equals("true")) {
|
||||
final ChromeOptions chromeOptions = new ChromeOptions();
|
||||
ChromeOptions chromeOptions = new ChromeOptions();
|
||||
chromeOptions.setBinary("/usr/bin/google-chrome-stable");
|
||||
chromeOptions.addArguments("--headless");
|
||||
chromeOptions.addArguments("--disable-gpu");
|
||||
chromeOptions.setHeadless(true);
|
||||
chromeOptions.setCapability(SUPPORTS_JAVASCRIPT, true);
|
||||
|
||||
final DesiredCapabilities dc = new DesiredCapabilities();
|
||||
dc.setJavascriptEnabled(true);
|
||||
dc.setCapability(
|
||||
ChromeOptions.CAPABILITY, chromeOptions
|
||||
);
|
||||
|
||||
return new ChromeDriver(dc);
|
||||
return new ChromeDriver(chromeOptions);
|
||||
} else {
|
||||
return new ChromeDriver();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user