Class: Selenium::WebDriver::Interactions::Pause Private

Inherits:
Interaction
  • Object
show all
Defined in:
lib/selenium/webdriver/common/interactions/pause.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 to create a waiting period between actions Also used for synchronizing actions across devices

Instance Attribute Summary

Attributes inherited from Interaction

#type

Instance Method Summary collapse

Constructor Details

#initialize(source, duration = nil) ⇒ Pause

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 Pause.



31
32
33
34
35
# File 'lib/selenium/webdriver/common/interactions/pause.rb', line 31

def initialize(source, duration = nil)
  super(source)
  @duration = duration
  @type = :pause
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)


37
38
39
# File 'lib/selenium/webdriver/common/interactions/pause.rb', line 37

def assert_source(source)
  raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? InputDevice
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.



41
42
43
44
45
# File 'lib/selenium/webdriver/common/interactions/pause.rb', line 41

def encode
  output = {type: type}
  output[:duration] = (@duration * 1000).to_i if @duration
  output
end