Module: WDA::Custome

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

Instance Method Summary collapse

Instance Method Details

#double_tap_homebuttonObject



37
38
39
# File 'lib/wda_lib/custom.rb', line 37

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 + '/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)
  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 '/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

#timeout(duration) ⇒ void

This method returns an undefined value.

Timeout(without Session)

Parameters:

  • duration (Float)

    the timeout in milliseconds



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)

Parameters:

  • duration (Float)

    the timeout in milliseconds



33
34
35
# File 'lib/wda_lib/custom.rb', line 33

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