-
-
Notifications
You must be signed in to change notification settings - Fork 762
Expand file tree
/
Copy pathChromeDriverPathUtil.java
More file actions
30 lines (24 loc) · 1017 Bytes
/
ChromeDriverPathUtil.java
File metadata and controls
30 lines (24 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package io.appium.java_client;
import static java.nio.file.FileSystems.getDefault;
import static org.openqa.selenium.Platform.MAC;
import static org.openqa.selenium.Platform.WINDOWS;
import static org.openqa.selenium.Platform.getCurrent;
import org.openqa.selenium.Platform;
import java.io.File;
import java.nio.file.Path;
public final class ChromeDriverPathUtil {
private static final Path ROOT_TEST_PATH = getDefault().getPath("src")
.resolve("test").resolve("java").resolve("io").resolve("appium").resolve("java_client");
/**
* @return the choromedriver file which depends on platform.
*/
public static File getChromeDriver() {
Platform current = getCurrent();
if (current.is(WINDOWS)) {
return ROOT_TEST_PATH.resolve("chromedriver.exe").toFile();
} else if (current.is(MAC)) {
return ROOT_TEST_PATH.resolve("chromedriver_mac").toFile();
}
return ROOT_TEST_PATH.resolve("chromedriver_linux").toFile();
}
}