Class: Appium::Core::MultiTouch Deprecated
- Inherits:
-
Object
- Object
- Appium::Core::MultiTouch
- Defined in:
- lib/appium_lib_core/common/touch_action/multi_touch.rb
Overview
Use W3C actions instead
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.
Consider to use W3C spec touch action like the followings. www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html github.com/appium/ruby_lib_core/blob/master/test/functional/android/webdriver/w3c_actions_test.rb github.com/appium/ruby_lib_core/blob/master/test/functional/ios/webdriver/w3c_actions_test.rb
About W3C actions www.youtube.com/watch?v=oAJ7jwMNFVU appiumpro.com/editions/30-ios-specific-touch-action-methods appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
Functional test code in ruby_lib_core repository also helps.
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.
53 54 55 56 57 58 59 60 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 53 def initialize(driver) ::Appium::Logger.warn( '[DEPRECATION] Appium::Core::MultiTouch is deprecated in W3C spec. Use W3C actions instead' ) @actions = [] @driver = driver end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
51 52 53 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 51 def driver @driver end |
Instance Method Details
#add(chain) ⇒ Object
Add a touch_action to be performed
64 65 66 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 64 def add(chain) @actions << chain.actions end |
#perform ⇒ Object
Ask Appium to perform the actions
69 70 71 72 |
# File 'lib/appium_lib_core/common/touch_action/multi_touch.rb', line 69 def perform @driver.multi_touch @actions @actions.clear end |