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

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

Overview

PointerPress

Constant Summary collapse

VIEWPORT =
:viewport
POINTER =
:pointer
ORIGINS =
[VIEWPORT, POINTER].freeze

Constants inherited from Interaction

Interaction::PAUSE

Instance Attribute Summary

Attributes inherited from Interaction

#source

Instance Method Summary collapse

Constructor Details

#initialize(source, duration, x, y, element: nil, origin: nil) ⇒ PointerMove

Returns a new instance of PointerMove.



104
105
106
107
108
109
110
# File 'lib/selenium/webdriver/common/interactions/pointer_input.rb', line 104

def initialize(source, duration, x, y, element: nil, origin: nil)
  super(source)
  @duration = duration * 1000
  @x_offset = x
  @y_offset = y
  @origin = element || origin
end

Instance Method Details

#encodeObject



116
117
118
119
120
# File 'lib/selenium/webdriver/common/interactions/pointer_input.rb', line 116

def encode
  output = {type: type, duration: @duration.to_i, x: @x_offset, y: @y_offset}
  output[:origin] = @origin
  output
end

#typeObject



112
113
114
# File 'lib/selenium/webdriver/common/interactions/pointer_input.rb', line 112

def type
  :pointerMove
end