mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-18 19:59:09 +00:00
in a local test environment, use an adapter CustomChromeDriver to work also in dockerized dev environments
This commit is contained in:
@@ -91,9 +91,13 @@
|
||||
<driver-definition class="org.openqa.selenium.firefox.FirefoxDriver">
|
||||
</driver-definition>
|
||||
-->
|
||||
<!-- -->
|
||||
<!--
|
||||
<driver-definition class="org.openqa.selenium.chrome.ChromeDriver">
|
||||
</driver-definition>
|
||||
-->
|
||||
<!-- -->
|
||||
<driver-definition class="com.sap.sailing.selenium.core.CustomChromeDriver">
|
||||
</driver-definition>
|
||||
<!-- -->
|
||||
<!--
|
||||
<driver-definition class="org.openqa.selenium.ie.InternetExplorerDriver">
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.sap.sailing.selenium.core;
|
||||
|
||||
import org.openqa.selenium.Capabilities;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriverService;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
|
||||
public class CustomChromeDriver extends ChromeDriver {
|
||||
public CustomChromeDriver(Capabilities capabilities) {
|
||||
super(ChromeDriverService.createDefaultService(), buildOptions());
|
||||
}
|
||||
|
||||
private static ChromeOptions buildOptions() {
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("--no-sandbox");
|
||||
options.addArguments("--disable-dev-shm-usage");
|
||||
options.addArguments("--disable-gpu");
|
||||
options.addArguments("--remote-debugging-port=9222");
|
||||
return options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user