Module: WDA::Custome
- Included in:
- WDA
- Defined in:
- lib/wda_lib/custom.rb
Instance Method Summary collapse
- #double_tap_homebutton ⇒ Object
-
#homescreen ⇒ Object
Go to home screen.
- #kill_app(app_name) ⇒ Object
-
#pause(duration) ⇒ Object
Deactivate application for given time.
-
#springboard ⇒ Object
Same as homescreen, go to home screen.
-
#timeout(duration) ⇒ void
Timeout(without Session).
-
#timeout_in_session(duration) ⇒ void
Timeout(with Session).
Instance Method Details
#double_tap_homebutton ⇒ Object
37 38 39 |
# File 'lib/wda_lib/custom.rb', line 37 def post(@base_url + '/doubleTapHomescreen') end |
#homescreen ⇒ Object
Go to home screen
9 10 11 |
# File 'lib/wda_lib/custom.rb', line 9 def homescreen post(@base_url + '/homescreen') end |
#kill_app(app_name) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/wda_lib/custom.rb', line 41 def kill_app(app_name) app_rect = xpath_search('Other', 'label', app_name).first.rect swipe(app_rect['x'] + 10, app_rect['x'] + 10, @win_y*4/5, @win_y/3) homescreen end |
#pause(duration) ⇒ Object
Deactivate application for given time
19 20 21 |
# File 'lib/wda_lib/custom.rb', line 19 def pause(duration) post '/deactivateApp', { duration: duration } end |
#springboard ⇒ Object
Same as homescreen, go to home screen
14 15 16 |
# File 'lib/wda_lib/custom.rb', line 14 def springboard homescreen end |
#timeout(duration) ⇒ void
This method returns an undefined value.
Timeout(without Session)
26 27 28 |
# File 'lib/wda_lib/custom.rb', line 26 def timeout(duration) post(@base_url + '/timeout', { type: 'xctevent', ms: duration }) end |
#timeout_in_session(duration) ⇒ void
This method returns an undefined value.
Timeout(with Session)
33 34 35 |
# File 'lib/wda_lib/custom.rb', line 33 def timeout_in_session(duration) post '/timeout', { type: 'xctevent', ms: duration } end |