Skip to content

Commit 67b6e30

Browse files
committed
Fix up safari options to match w3c requirements
The `safari:` prefix is the one picked by Apple. Apparently the current safaridriver and the future releases will correctly understand how they work.
1 parent 3497882 commit 67b6e30

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

java/client/src/org/openqa/selenium/safari/SafariOptions.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ private interface Option {
6060
@Deprecated
6161
String TECHNOLOGY_PREVIEW = "technologyPreview";
6262

63-
String AUTOMATIC_INSPECTION = "automaticInspection";
64-
String AUTOMATIC_PROFILING = "automaticProfiling";
63+
// Defined by Apple
64+
String AUTOMATIC_INSPECTION = "safari:automaticInspection";
65+
String AUTOMATIC_PROFILING = "safari:automaticProfiling";
6566

67+
// Defined by us
6668
String TECH_PREVIEW = "se:safari:techPreview";
6769
}
6870

6971
private Map<String, Object> options = new TreeMap<>();
7072

7173
public SafariOptions() {
7274
setUseTechnologyPreview(false);
73-
setAutomaticInspection(false);
74-
setAutomaticProfiling(false);
7575
setCapability(BROWSER_NAME, "safari");
7676
}
7777

@@ -129,7 +129,7 @@ public static SafariOptions fromCapabilities(Capabilities capabilities)
129129
* otherwise will disable.
130130
*/
131131
public SafariOptions setAutomaticInspection(boolean automaticInspection) {
132-
options.put(Option.AUTOMATIC_INSPECTION, automaticInspection);
132+
setCapability(Option.AUTOMATIC_INSPECTION, automaticInspection);
133133
return this;
134134
}
135135

@@ -141,7 +141,7 @@ public SafariOptions setAutomaticInspection(boolean automaticInspection) {
141141
* otherwise will disable.
142142
*/
143143
public SafariOptions setAutomaticProfiling(boolean automaticProfiling) {
144-
options.put(Option.AUTOMATIC_PROFILING, automaticProfiling);
144+
setCapability(Option.AUTOMATIC_PROFILING, automaticProfiling);
145145
return this;
146146
}
147147

@@ -186,11 +186,11 @@ public SafariOptions setProxy(Proxy proxy) {
186186
// Getters
187187

188188
public boolean getAutomaticInspection() {
189-
return (boolean) options.getOrDefault(Option.AUTOMATIC_INSPECTION, false);
189+
return Boolean.TRUE.equals(getCapability(Option.AUTOMATIC_INSPECTION));
190190
}
191191

192192
public boolean getAutomaticProfiling() {
193-
return (boolean) options.getOrDefault(Option.AUTOMATIC_PROFILING, false);
193+
return Boolean.TRUE.equals(is(Option.AUTOMATIC_PROFILING));
194194
}
195195

196196
public boolean getUseTechnologyPreview() {

0 commit comments

Comments
 (0)