Skip to content

Commit 4b6989a

Browse files
Merge pull request #172 from DylanLacey/flight
Airline mode.
2 parents 7935fc0 + 0824188 commit 4b6989a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

lib/appium_lib/device/device.rb

+24-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module Device
99
shake: 'session/:session_id/appium/device/shake',
1010
launch: 'session/:session_id/appium/app/launch',
1111
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'
1314
},
1415
get: {
1516
current_activity: 'session/:session_id/appium/device/current_activity',
@@ -41,6 +42,9 @@ module Device
4142
# @!method shake
4243
# Cause the device to shake
4344

45+
# @!method toggle_flight_mode
46+
# toggle flight mode on or off
47+
4448
#@!method complex_find
4549
# Find an element by a complex array of criteria. Available criteria
4650
# are listed in [link here]. Criteria are formed by creating an array
@@ -81,6 +85,11 @@ module Device
8185
# pull_file '/local/data/some/path' #=> Get the file at that path
8286
# pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
8387
# ```
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.
8493
class << self
8594
def extended(mod)
8695
extend_webdriver_with_forwardable
@@ -139,6 +148,13 @@ def key_event(key, metastate=nil)
139148
end
140149
end
141150

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+
142158
add_endpoint_method(:complex_find, 'session/:session_id/appium/app/complex_find') do
143159
def complex_find(opts)
144160
mode = opts.fetch :mode, false
@@ -170,6 +186,13 @@ def pull_file(path)
170186
end
171187
end
172188

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+
173196
add_touch_actions
174197
extend_search_contexts
175198
end

0 commit comments

Comments
 (0)