What options are available to me in driver.execute_script 'mobile: scroll' in the ruby bindings

I’ve searched high and low and can’t find the doc section about it.

execute_script 'mobile: scroll', direction: 'down'

is what I’m calling now but it scrolls far too long. how can I say set the duration of the scroll? Or scroll until I find an element. What are other interesting things possible with the execute script, and where can I find the documents on it?

Any help much appreciated.

@pmck91 How to ScrollToElement in appium v1.0.0-beta.5 - exactly you are looking for

Thanks! I’m looking for something in the ruby appium_lib though, but this points in the right direction

Here’s a ruby example of scrolling explicitly.

  size = appium_driver.driver.manage.window.size
  width = size.width
  start_x = end_x = (width / 2).to_int
  (start_y, end_y) = [(size.height * 0.8).to_int, (size.height * 0.2).to_int]
  Appium::TouchAction.new.swipe(start_x:  start_x,
                                start_y:  start_y,
                                end_x: end_x,
                                end_y: end_y,
                                duration: 1000)

This is perfect! thank you!