@@ -110,6 +110,16 @@ private void mirror(FirefoxOptions that) {
110
110
this .legacy = that .legacy ;
111
111
}
112
112
113
+ /**
114
+ * Configures the following:
115
+ * <dl>
116
+ * <dt>Binary</dt>
117
+ * <dd>{@code webdriver.firefox.bin} - the path to the firefox binary</dd>
118
+ *
119
+ * <dt>Firefox profile</dt>
120
+ * <dd>{@code webdriver.firefox.profile} - a named firefox profile</dd>
121
+ * </dl>
122
+ */
113
123
public FirefoxOptions configureFromEnv () {
114
124
// Read system properties and use those if they are set, allowing users to override them later
115
125
// should they want to.
@@ -280,6 +290,31 @@ public FirefoxOptions setHeadless(boolean headless) {
280
290
return setFirefoxOption (Keys .ARGS , Collections .unmodifiableList (newArgs ));
281
291
}
282
292
293
+ public FirefoxOptions setAndroidPackage (String androidPackage ) {
294
+ Require .nonNull ("Android package" , androidPackage );
295
+ return setFirefoxOption ("androidPackage" , androidPackage );
296
+ }
297
+
298
+ public FirefoxOptions setAndroidActivity (String activity ) {
299
+ Require .nonNull ("Android activity" , activity );
300
+ return setFirefoxOption ("androidActivity" , activity );
301
+ }
302
+
303
+ public FirefoxOptions setAndroidDeviceSerialNumber (String serial ) {
304
+ Require .nonNull ("Android device serial number" , serial );
305
+ return setFirefoxOption ("androidDeviceSerial" , serial );
306
+ }
307
+
308
+ public FirefoxOptions setAndroidIntentArguments (String [] args ) {
309
+ Require .nonNull ("Android intent arguments" , args );
310
+ return setAndroidIntentArguments (Arrays .asList (args ));
311
+ }
312
+
313
+ public FirefoxOptions setAndroidIntentArguments (List <String > args ) {
314
+ Require .nonNull ("Android intent arguments" , args );
315
+ return setFirefoxOption ("androidIntentArguments" , args );
316
+ }
317
+
283
318
@ Override
284
319
public void setCapability (String key , Object value ) {
285
320
Require .nonNull ("Capability name" , key );
@@ -326,8 +361,15 @@ public void setCapability(String key, Object value) {
326
361
}
327
362
328
363
private FirefoxOptions setFirefoxOption (Keys key , Object value ) {
364
+ return setFirefoxOption (key .key (), value );
365
+ }
366
+
367
+ private FirefoxOptions setFirefoxOption (String key , Object value ) {
368
+ Require .nonNull ("Key" , key );
369
+ Require .nonNull ("Value" , value );
370
+
329
371
Map <String , Object > newOptions = new TreeMap <>(firefoxOptions );
330
- newOptions .put (key . key () , value );
372
+ newOptions .put (key , value );
331
373
firefoxOptions = Collections .unmodifiableMap (newOptions );
332
374
return this ;
333
375
}
@@ -374,6 +416,17 @@ public FirefoxOptions merge(Capabilities capabilities) {
374
416
}
375
417
376
418
private enum Keys {
419
+ ANDROID_PACKAGE ("androidPackage" ) {
420
+ @ Override
421
+ public void amend (Map <String , Object > sourceOptions , Map <String , Object > toAmend ) {
422
+
423
+ }
424
+
425
+ @ Override
426
+ public Object mirror (Map <String , Object > first , Map <String , Object > second ) {
427
+ return null ;
428
+ }
429
+ },
377
430
ARGS ("args" ) {
378
431
@ Override
379
432
public void amend (Map <String , Object > sourceOptions , Map <String , Object > toAmend ) {
0 commit comments