Skip to content

Commit 50a4874

Browse files
committed
Include config key for Safari version (for WebKit version)
1 parent 2f116fd commit 50a4874

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

src/doc/asciidoc/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ The remainder of this section describes all the possible Java methods in the Web
620620
|`cachePath(String)`|`wdm.cachePath`|`~/.cache/selenium`|Folder to store drivers locally
621621
|`resolutionCachePath(String)`|`wdm.resolutionCachePath`|`~/.cache/selenium`|Folder to store the resolution cache
622622
|`driverVersion(String)`|`wdm.chromeDriverVersion`, `wdm.operaDriverVersion`, `wdm.iExplorerDriverVersion`, `wdm.edgeDriverVersion`, `wdm.geckoDriverVersion`, `wdm.chromiumDriverVersion`|`""` (automatic driver version discovery through the <<resolution-algorithm,resolution algorithm>>)|Custom driver version
623-
|`browserVersion(String)`|`wdm.chromeVersion`, `wdm.operaVersion`, `wdm.edgeVersion`, `wdm.firefoxVersion`, `wdm.chromiumVersion`|`""` (automatic browser version detection using the https://github.com/bonigarcia/webdrivermanager/blob/master/src/main/resources/commands.properties[commands database])|Custom browser version (major)
623+
|`browserVersion(String)`|`wdm.chromeVersion`, `wdm.operaVersion`, `wdm.edgeVersion`, `wdm.firefoxVersion`, `wdm.chromiumVersion`, `wdm.safariVersion`|`""` (automatic browser version detection using the https://github.com/bonigarcia/webdrivermanager/blob/master/src/main/resources/commands.properties[commands database])|Custom browser version (major)
624624
|`forceDownload()`|`wdm.forceDownload=true`|`false` (drivers in cache are reused if available)|Force downloading driver (even if it is already in the cache)
625625
|`useBetaVersions()`|`wdm.useBetaVersions=true`|`false` (driver versions are skipped)|Allow the use beta versions (if possible)
626626
|`architecture(Architecture)`|`wdm.architecture`|`""` (automatic architecture discovery)|Force a given architecture for a driver

src/main/java/io/github/bonigarcia/wdm/config/Config.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ public class Config {
177177
ConfigKey<Boolean> useChromiumDriverSnap = new ConfigKey<>(
178178
"wdm.useChromiumDriverSnap", Boolean.class);
179179

180+
ConfigKey<String> safariVersion = new ConfigKey<>("wdm.safariVersion",
181+
String.class);
182+
180183
ConfigKey<Integer> ttl = new ConfigKey<>("wdm.ttl", Integer.class);
181184
ConfigKey<Integer> ttlForBrowsers = new ConfigKey<>("wdm.ttlForBrowsers",
182185
Integer.class);
@@ -1003,6 +1006,15 @@ public Config setChromiumDriverVersion(String value) {
10031006
return this;
10041007
}
10051008

1009+
public String getSafariVersion() {
1010+
return resolve(safariVersion);
1011+
}
1012+
1013+
public Config setSafariVersion(String value) {
1014+
this.safariVersion.setValue(value);
1015+
return this;
1016+
}
1017+
10061018
public String getChromiumVersion() {
10071019
return resolve(chromiumVersion);
10081020
}

src/main/java/io/github/bonigarcia/wdm/managers/SafariDriverManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,14 @@ protected Capabilities getCapabilities() {
5757
return new SafariOptions();
5858
}
5959

60+
@Override
61+
protected String getBrowserVersion() {
62+
return config().getSafariVersion();
63+
}
64+
65+
@Override
66+
protected void setBrowserVersion(String browserVersion) {
67+
config().setSafariVersion(browserVersion);
68+
}
69+
6070
}

0 commit comments

Comments
 (0)