class Selenium::WebDriver::Manager
Constants
- SECONDS_PER_DAY
Public Class Methods
new(bridge)
click to toggle source
@api private
# File lib/selenium/webdriver/common/manager.rb, line 26 def initialize(bridge) @bridge = bridge end
Public Instance Methods
logs()
click to toggle source
@api beta This API may be changed or removed in a future release.
# File lib/selenium/webdriver/common/manager.rb, line 103 def logs @logs ||= Logs.new(@bridge) end
new_window(type = :tab)
click to toggle source
Create a new top-level browsing context w3c.github.io/webdriver/#new-window @param type [Symbol] Supports two values: :tab and :window.
Use :tab if you'd like the new window to share an OS-level window with the current browsing context. Use :window otherwise
@return [String] The value of the window handle
# File lib/selenium/webdriver/common/manager.rb, line 116 def new_window(type = :tab) case type when :tab, :window result = @bridge.new_window(type) unless result.key?('handle') raise UnknownError, "the driver did not return a handle. " \ "The returned result: #{result.inspect}" end result['handle'] else raise ArgumentError, "invalid argument for type. Got: '#{type.inspect}'. " \ "Try :tab or :window" end end
timeouts()
click to toggle source
# File lib/selenium/webdriver/common/manager.rb, line 95 def timeouts @timeouts ||= Timeouts.new(@bridge) end
window()
click to toggle source
@api beta This API may be changed or removed in a future release.
# File lib/selenium/webdriver/common/manager.rb, line 135 def window @window ||= Window.new(@bridge) end
Private Instance Methods
datetime_at(int)
click to toggle source
# File lib/selenium/webdriver/common/manager.rb, line 143 def datetime_at(int) DateTime.civil(1970) + (int / SECONDS_PER_DAY) end
seconds_from(obj)
click to toggle source
# File lib/selenium/webdriver/common/manager.rb, line 147 def seconds_from(obj) case obj when Time obj.to_f when DateTime (obj - DateTime.civil(1970)) * SECONDS_PER_DAY when Numeric obj else raise ArgumentError, "invalid value for expiration date: #{obj.inspect}" end end
strip_port(str)
click to toggle source
# File lib/selenium/webdriver/common/manager.rb, line 160 def strip_port(str) str.split(':', 2).first end