Class: Selenium::WebDriver::Interactions::PointerMove Private

Inherits:
Interaction
  • Object
show all
Includes:
PointerEventProperties
Defined in:
rb/lib/selenium/webdriver/common/interactions/pointer_move.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Action related to moving the pointer.

Constant Summary collapse

VIEWPORT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

:viewport
POINTER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

:pointer
ORIGINS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[VIEWPORT, POINTER].freeze

Constants included from PointerEventProperties

Selenium::WebDriver::Interactions::PointerEventProperties::VALID

Instance Attribute Summary

Attributes inherited from Interaction

#type

Instance Method Summary collapse

Methods included from PointerEventProperties

#process_opts

Constructor Details

#initialize(source, duration, x, y, **opts) ⇒ PointerMove

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PointerMove.



36
37
38
39
40
41
42
43
44
# File 'rb/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

Instance Method Details

#assert_source(source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (TypeError)


46
47
48
# File 'rb/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

#encodeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



50
51
52
53
54
55
56
# File 'rb/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