class Selenium::WebDriver::Interactions::Scroll

def assert_source(source)

def assert_source(source)
  raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? WheelInput
end

def encode

def encode
  {'type' => type.to_s,
   'duration' => @duration.to_i,
   'x' => @x_offset,
   'y' => @y_offset,
   'deltaX' => @delta_x,
   'deltaY' => @delta_y,
   'origin' => @origin.is_a?(Element) ? @origin : @origin.to_s}
end

def initialize(source:, origin: :viewport, duration: 0.25, **opts)

def initialize(source:, origin: :viewport, duration: 0.25, **opts)
  super(source)
  @type = :scroll
  @duration = duration * 1000
  @origin = origin
  @x_offset = opts.delete(:x) || 0
  @y_offset = opts.delete(:y) || 0
  @delta_x = opts.delete(:delta_x) || 0
  @delta_y = opts.delete(:delta_y) || 0
  raise ArgumentError, "Invalid arguments: #{opts.keys}" unless opts.empty?
end