Class: Appium::Core::MultiTouch
- Inherits:
-
Object
- Object
- Appium::Core::MultiTouch
- Defined in:
- lib/appium_lib_core/common/touch_action/multi_touch.rb
Overview
MultiTouch actions allow for multiple touches to happen at the same time, for instance, to simulate multiple finger swipes.
Create a series of touch actions by themselves (without a prepare()), then add to a new MultiTouch action. When ready, call prepare() and all actions will be executed simultaneously.
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
Instance Method Summary collapse
-
#add(chain) ⇒ Object
Add a touch_action to be performed.
-
#initialize(driver) ⇒ MultiTouch
constructor
A new instance of MultiTouch.
-
#perform ⇒ Object
Ask Appium to perform the actions.
Constructor Details
#initialize(driver) ⇒ MultiTouch
Returns a new instance of MultiTouch.
38 39 40 41 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 38 def initialize(driver) @actions = [] @driver = driver end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
36 37 38 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 36 def driver @driver end |
Instance Method Details
#add(chain) ⇒ Object
Add a touch_action to be performed
45 46 47 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 45 def add(chain) @actions << chain.actions end |
#perform ⇒ Object
Ask Appium to perform the actions
50 51 52 53 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 50 def perform @driver.multi_touch @actions @actions.clear end |