Module: WDA::Custome

Included in:
WDA
Defined in:
lib/wda_lib/custom.rb

Instance Method Summary collapse

Instance Method Details

#dismiss_keyboardObject

Dismiss keyboard



31
32
33
# File 'lib/wda_lib/custom.rb', line 31

def dismiss_keyboard
  post '/wda/keyboard/dismiss'
end

#double_tap_homebuttonObject



35
36
37
# File 'lib/wda_lib/custom.rb', line 35

def double_tap_homebutton
  post(@base_url + '/doubleTapHomescreen')
end

#homescreenObject

Go to home screen



9
10
11
# File 'lib/wda_lib/custom.rb', line 9

def homescreen
  post(@base_url + '/wda/homescreen')
end

#kill_app(app_name) ⇒ Object



39
40
41
42
43
44
# File 'lib/wda_lib/custom.rb', line 39

def kill_app(app_name)
  double_tap_homebutton
  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 '/wda/deactivateApp', { duration: duration }
end

#springboardObject

Same as homescreen, go to home screen



14
15
16
# File 'lib/wda_lib/custom.rb', line 14

def springboard
  homescreen
end

#timeouts(duration) ⇒ void

This method returns an undefined value.

Timeouts

Parameters:

  • duration (Float)

    the timeout in milliseconds



26
27
28
# File 'lib/wda_lib/custom.rb', line 26

def timeouts(duration)
  post '/timeouts', { type: 'xctevent', ms: duration }
end