Module: Frank::Cucumber::GestureHelper
- Included in:
- FrankHelper
- Defined in:
- lib/frank-cucumber/gesture_helper.rb
Instance Method Summary collapse
-
#double_tap(selector) ⇒ Array<Boolean>
Double tap the selector.
-
#double_tap_point(selector, x, y) ⇒ Array<Boolean>
Double tap the selector at a specific point.
-
#drag_thumb_in_slider(selector, value, duration) ⇒ Object
Drag the slider thumb to required value, taking the specified time.
-
#drag_thumb_in_slider_with_default_duration(selector, value) ⇒ Object
Drag the slider thumb to required value.
-
#tap_and_hold(selector, duration = 1) ⇒ Array<Boolean>
Touch and hold the selector for a given duration.
-
#tap_and_hold_point(selector, x, y, duration = 1) ⇒ Array<Boolean>
Touch and hold the selector at a specific point for a given duration.
Instance Method Details
#double_tap(selector) ⇒ Array<Boolean>
Double tap the selector
45 46 47 48 49 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 45 def double_tap( selector ) touch_successes = frankly_map( selector, "doubleTap" ) raise "Could not find anything matching [#{selector}] to double tap" if touch_successes.empty? raise "Some views could not be double tap (probably because they are not within the current viewport)" if touch_successes.include?(false) end |
#double_tap_point(selector, x, y) ⇒ Array<Boolean>
Double tap the selector at a specific point
61 62 63 64 65 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 61 def double_tap_point( selector, x, y ) touch_successes = frankly_map( selector, "doubleTapx:y:", x, y ) raise "Could not find anything matching [#{selector}] to double tap" if touch_successes.empty? raise "Some views could not be double tap (probably because they are not within the current viewport)" if touch_successes.include?(false) end |
#drag_thumb_in_slider(selector, value, duration) ⇒ Object
Drag the slider thumb to required value, taking the specified time
77 78 79 80 81 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 77 def ( selector, value, duration ) touch_successes = frankly_map( selector, "FEX_dragThumbToValue:withDuration:", value, duration) raise "Could not find anything matching [#{selector}] to have its thumb dragged" if touch_successes.empty? raise "Some views could not had their thumbs dragged (are they even UISLiders?)" if touch_successes.include?(false) end |
#drag_thumb_in_slider_with_default_duration(selector, value) ⇒ Object
Drag the slider thumb to required value
92 93 94 95 96 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 92 def ( selector, value ) touch_successes = frankly_map( selector, "FEX_dragThumbToValue:", value ) raise "Could not find anything matching [#{selector}] to have its thumb dragged" if touch_successes.empty? raise "Some views could not had their thumbs dragged (are they even UISLiders?)" if touch_successes.include?(false) end |
#tap_and_hold(selector, duration = 1) ⇒ Array<Boolean>
Touch and hold the selector for a given duration
14 15 16 17 18 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 14 def tap_and_hold( selector, duration = 1 ) touch_successes = frankly_map( selector, "touchAndHold:", duration ) raise "Could not find anything matching [#{selector}] to long touch" if touch_successes.empty? raise "Some views could not be long touched (probably because they are not within the current viewport)" if touch_successes.include?(false) end |
#tap_and_hold_point(selector, x, y, duration = 1) ⇒ Array<Boolean>
Touch and hold the selector at a specific point for a given duration
31 32 33 34 35 |
# File 'lib/frank-cucumber/gesture_helper.rb', line 31 def tap_and_hold_point( selector, x, y, duration = 1 ) touch_successes = frankly_map( selector, "touchAndHold:x:y:", duration, x, y ) raise "Could not find anything matching [#{selector}] to long touch" if touch_successes.empty? raise "Some views could not be long touched (probably because they are not within the current viewport)" if touch_successes.include?(false) end |