@@ -14,8 +14,9 @@ module Device
14
14
toggle_airplane_mode : 'session/:session_id/appium/device/toggle_airplane_mode' ,
15
15
} ,
16
16
get : {
17
- current_activity : 'session/:session_id/appium/device/current_activity' ,
18
- current_context : 'session/:session_id/context' ,
17
+ current_activity : 'session/:session_id/appium/device/current_activity' ,
18
+ current_context : 'session/:session_id/context' ,
19
+ get_network_connection : 'session/:session_id/network_connection' ,
19
20
}
20
21
}
21
22
@@ -263,6 +264,27 @@ def update_settings(settings)
263
264
end
264
265
end
265
266
267
+ # @!method get_network_connection
268
+ # Get the device network connection current status
269
+ # See set_network_connection method for return value
270
+
271
+ # @!method set_network_connection
272
+ # Set the device network connection mode
273
+ # @param path (String) Bit mask that represent the network mode
274
+ # Value (Alias) | Data | Wifi | Airplane Mode
275
+ # -------------------------------------------------
276
+ # 1 (Airplane Mode) | 0 | 0 | 1
277
+ # 6 (All network on) | 1 | 1 | 0
278
+ # 4 (Data only) | 1 | 0 | 0
279
+ # 2 (Wifi only) | 0 | 1 | 0
280
+ # 0 (None) | 0 | 0 | 0
281
+ #
282
+ add_endpoint_method ( :set_network_connection , 'session/:session_id/network_connection' ) do
283
+ def set_network_connection ( mode )
284
+ execute :set_network_connection , { } , type : mode
285
+ end
286
+ end
287
+
266
288
add_touch_actions
267
289
extend_search_contexts
268
290
end
0 commit comments