class Selenium::WebDriver::Interactions::PointerMove

Action related to moving the pointer.

@api private

Constants

ORIGINS
POINTER
VIEWPORT

Public Class Methods

new(source, duration, x, y, **opts) click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_move.rb, line 36
def initialize(source, duration, x, y, **opts)
  super(source)
  @duration = duration * 1000
  @x_offset = x
  @y_offset = y
  @origin = opts.delete(:element) || opts.delete(:origin) || :viewport
  @type = :pointerMove
  @opts = opts
end

Public Instance Methods

assert_source(source) click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_move.rb, line 46
def assert_source(source)
  raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? PointerInput
end
encode() click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_move.rb, line 50
def encode
  process_opts.merge('type' => type.to_s,
                     'duration' => @duration.to_i,
                     'x' => @x_offset,
                     'y' => @y_offset,
                     'origin' => @origin)
end