@@ -9,7 +9,8 @@ module Device
9
9
shake : 'session/:session_id/appium/device/shake' ,
10
10
launch : 'session/:session_id/appium/app/launch' ,
11
11
close_app : 'session/:session_id/appium/app/close' ,
12
- reset : 'session/:session_id/appium/app/reset'
12
+ reset : 'session/:session_id/appium/app/reset' ,
13
+ toggle_airplane_mode : 'session/:session_id/appium/device/toggle_airplane_mode'
13
14
} ,
14
15
get : {
15
16
current_activity : 'session/:session_id/appium/device/current_activity' ,
@@ -41,6 +42,9 @@ module Device
41
42
# @!method shake
42
43
# Cause the device to shake
43
44
45
+ # @!method toggle_flight_mode
46
+ # toggle flight mode on or off
47
+
44
48
#@!method complex_find
45
49
# Find an element by a complex array of criteria. Available criteria
46
50
# are listed in [link here]. Criteria are formed by creating an array
@@ -81,6 +85,11 @@ module Device
81
85
# pull_file '/local/data/some/path' #=> Get the file at that path
82
86
# pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
83
87
# ```
88
+
89
+ # @!method end_coverage
90
+ # Android only; Ends the test coverage and writes the results to the given path on device.
91
+ # @param path (String) Path on the device to write too.
92
+ # @param intent (String) Intent to broadcast when ending coverage.
84
93
class << self
85
94
def extended ( mod )
86
95
extend_webdriver_with_forwardable
@@ -139,6 +148,13 @@ def key_event(key, metastate=nil)
139
148
end
140
149
end
141
150
151
+ # TODO TEST ME
152
+ add_endpoint_method ( :set_immediate_value , 'session/:session_id/appium/element/:id/value' ) do
153
+ def set_immediate_value ( element , value )
154
+ execute :set_immediate_value , { :id => element . ref } , value
155
+ end
156
+ end
157
+
142
158
add_endpoint_method ( :complex_find , 'session/:session_id/appium/app/complex_find' ) do
143
159
def complex_find ( opts )
144
160
mode = opts . fetch :mode , false
@@ -170,6 +186,13 @@ def pull_file(path)
170
186
end
171
187
end
172
188
189
+ # TODO TEST ME
190
+ add_endpoint_method ( :end_coverage , 'session/:session_id/appium/app/end_test_coverage' ) do
191
+ def end_coverage ( path , intent )
192
+ execute :end_coverage , { } , path : path , intent : intent
193
+ end
194
+ end
195
+
173
196
add_touch_actions
174
197
extend_search_contexts
175
198
end
0 commit comments