Class: Appium::TouchAction
- Inherits:
-
Core::TouchAction
- Object
- Core::TouchAction
- Appium::TouchAction
- Defined in:
- lib/appium_lib/common/touch_actions.rb
Overview
Perform a series of gestures, one after another. Gestures are chained together and only performed when ‘perform()` is called. Default is conducted by global driver.
Each method returns the object itself, so calls can be chained.
Or each methods can call without TouchAction.new as the following. In this case, perform is called automatically.
If you’d like to perform the chain with an arbitrary driver:
Constant Summary collapse
- COMPLEX_ACTIONS =
::Appium::Core::TouchAction::COMPLEX_ACTIONS
Instance Method Summary collapse
-
#initialize(driver = $driver) ⇒ TouchAction
constructor
A new instance of TouchAction.
- #swipe(opts) ⇒ Object
Constructor Details
#initialize(driver = $driver) ⇒ TouchAction
Returns a new instance of TouchAction.
48 49 50 |
# File 'lib/appium_lib/common/touch_actions.rb', line 48 def initialize(driver = $driver) super driver end |
Instance Method Details
#swipe(opts) ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/appium_lib/common/touch_actions.rb', line 52 def swipe(opts) start_x = opts.fetch :start_x, 0 start_y = opts.fetch :start_y, 0 end_x = opts.fetch :end_x, 0 end_y = opts.fetch :end_y, 0 duration = opts.fetch :duration, 200 super(start_x: start_x, start_y: start_y, end_x: end_x, end_y: end_y, duration: duration) end |