Method: Appium::Capybara::Driver#swipe
- Defined in:
- lib/appium_capybara/driver/appium/driver.rb
#swipe(opts) ⇒ Object
new
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/appium_capybara/driver/appium/driver.rb', line 81 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 action_builder = browser.action input = action_builder.pointer_inputs[0] action_builder .move_to_location(start_x, start_y) .pointer_down(:left) .pause(device: input, duration: duration / 1000) .move_to_location(end_x, end_y) .pause(device: input, duration: 1) .release .perform end |