123456789_123456789_123456789_123456789_123456789_

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

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Interaction
Instance Chain:
self, Interaction
Inherits: Selenium::WebDriver::Interactions::Interaction
Defined in: rb/lib/selenium/webdriver/common/interactions/pause.rb

Overview

Action to create a waiting period between actions Also used for synchronizing actions across devices

Class Method Summary

Interaction - Inherited

Instance Attribute Summary

Interaction - Inherited

Instance Method Summary

Interaction - Inherited

Constructor Details

.new(source, duration = nil) ⇒ Pause

[ GitHub ]

  
# File 'rb/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)

Raises:

  • (TypeError)
[ GitHub ]

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

#encode

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pause.rb', line 41

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