@@ -147,7 +147,6 @@ SafariOptions setPort(int port) {
147
147
*/
148
148
public SafariOptions useCleanSession (boolean useCleanSession ) {
149
149
options .put (Option .CLEAN_SESSION , useCleanSession );
150
- setCapability (Option .CLEAN_SESSION , useCleanSession );
151
150
return this ;
152
151
}
153
152
@@ -165,15 +164,34 @@ public SafariOptions setUseCleanSession(boolean useCleanSession) {
165
164
*
166
165
* @param useTechnologyPreview If true, the SafariDriver will use the Safari Technology Preview,
167
166
* otherwise will use the release version of Safari.
168
- * @deprecated Create a {@link SafariDriverService} to specify what Safari flavour should be used
169
- * and pass the service instance to a {@link SafariDriver} constructor.
170
167
*/
171
- @ Deprecated
172
168
public SafariOptions setUseTechnologyPreview (boolean useTechnologyPreview ) {
173
169
options .put (Option .TECHNOLOGY_PREVIEW , useTechnologyPreview );
174
170
return this ;
175
171
}
176
172
173
+ @ Override
174
+ public void setCapability (String key , Object value ) {
175
+ if (Option .TECHNOLOGY_PREVIEW .equals (key )) {
176
+ setUseTechnologyPreview (Boolean .valueOf (value .toString ()));
177
+ } else if (Option .CLEAN_SESSION .equals (key )) {
178
+ useCleanSession (Boolean .valueOf (value .toString ()));
179
+ } else {
180
+ super .setCapability (key , value );
181
+ }
182
+ }
183
+
184
+ @ Override
185
+ public void setCapability (String key , boolean value ) {
186
+ if (Option .TECHNOLOGY_PREVIEW .equals (key )) {
187
+ setUseTechnologyPreview (value );
188
+ } else if (Option .CLEAN_SESSION .equals (key )) {
189
+ useCleanSession (value );
190
+ } else {
191
+ super .setCapability (key , value );
192
+ }
193
+ }
194
+
177
195
public SafariOptions setProxy (Proxy proxy ) {
178
196
setCapability (CapabilityType .PROXY , proxy );
179
197
return this ;
0 commit comments