@@ -18,31 +18,74 @@ public class SauceMobileOptions extends SauceOptions {
18
18
private SaucePlatform platformName = SaucePlatform .ANDROID ;
19
19
20
20
// Defined in Appium
21
+ // These are the only values that are handled by Sauce Labs by default
22
+ // Additional values will be populated by Appium's IOSOptions & AndroidOptions class instances
21
23
private String app ;
22
24
private String deviceName ;
23
25
private String deviceOrientation = "portrait" ;
24
26
private String platformVersion = "9" ;
27
+ private String automationName ;
25
28
26
29
// Supported by Sauce
27
30
private String appiumVersion = "1.15.0" ;
31
+ private String deviceType ; // "table" or "phone"
32
+
33
+ // Supported by Sauce for Real Devices
34
+ private String testobject_app_id ;
35
+ private String privateDeviceOnly ;
36
+ private String tabletOnly ;
37
+ private String phoneOnly ;
38
+ private String carrierConnectivityOnly ;
39
+ private String recordDeviceVitals ;
40
+ private String cacheId ;
41
+ private String testobject_test_live_view_url ;
42
+ private String testobject_test_report_url ;
43
+ private String testobject_test_report_api_url ;
44
+ private String testobject_session_creation_timeout ;
45
+ private String commandTimeouts ;
46
+ private String crosswalkApplication ;
47
+ private String autoGrantPermissions ;
48
+ private String enableAnimations ;
49
+ private String name ;
28
50
29
51
public static final List <String > mobileW3COptions = List .of (
30
52
"browserName" ,
31
53
"platformName" );
32
54
33
55
public static final List <String > mobileSauceDefinedOptions = List .of (
34
- "appiumVersion" );
56
+ "appiumVersion" ,
57
+ "deviceType" );
35
58
36
59
public static final List <String > appiumDefinedOptions = List .of (
37
60
"app" ,
61
+ "automationName" ,
38
62
"deviceName" ,
39
63
"platformVersion" ,
40
64
"deviceOrientation" );
41
65
66
+ public static final List <String > realDeviceSauceDefinedOptions = List .of (
67
+ "testobject_app_id" ,
68
+ "privateDeviceOnly" ,
69
+ "tabletOnly" ,
70
+ "phoneOnly" ,
71
+ "carrierConnectivityOnly" ,
72
+ "recordDeviceVitals" ,
73
+ "cacheId" ,
74
+ "testobject_test_live_view_url" ,
75
+ "testobject_test_report_url" ,
76
+ "testobject_test_report_api_url" ,
77
+ "testobject_session_creation_timeout" ,
78
+ "commandTimeouts" ,
79
+ "crosswalkApplication" ,
80
+ "autoGrantPermissions" ,
81
+ "enableAnimations" ,
82
+ "name" );
83
+
42
84
public SauceMobileOptions () {
43
85
this (new MutableCapabilities ());
44
86
}
45
87
88
+ // TODO: require users to work with Appium's MobileOptions class similar to Selenium
46
89
public SauceMobileOptions (MutableCapabilities options ) {
47
90
appiumCapabilities = new MutableCapabilities (options .asMap ());
48
91
}
@@ -76,6 +119,10 @@ private void useW3cCapabilities() {
76
119
addCapabilityIfDefined (sauceCapabilities , capability );
77
120
});
78
121
122
+ sauceDefinedOptions .forEach ((capability ) -> {
123
+ addCapabilityIfDefined (appiumCapabilities , capability );
124
+ });
125
+
79
126
appiumCapabilities .setCapability ("sauce:options" , sauceCapabilities );
80
127
}
81
128
@@ -96,6 +143,10 @@ private void useJwpCapabilities(boolean to) {
96
143
mobileSauceDefinedOptions .forEach ((capability ) -> {
97
144
addCapabilityIfDefined (appiumCapabilities , capability );
98
145
});
146
+
147
+ realDeviceSauceDefinedOptions .forEach ((capability ) -> {
148
+ addCapabilityIfDefined (appiumCapabilities , capability );
149
+ });
99
150
}
100
151
101
152
private void useSaucePlatform (MutableCapabilities capabilities ) {
0 commit comments