class Selenium::WebDriver::Window
def full_screen
def full_screen @bridge.full_screen_window end
def initialize(bridge)
def initialize(bridge) @bridge = bridge end
def maximize
def maximize @bridge.maximize_window end
def minimize
def minimize @bridge.minimize_window end
def move_to(x, y)
def move_to(x, y) @bridge.reposition_window Integer(x), Integer(y) end
def position
def position @bridge.window_position end
def position=(point)
def position=(point) unless point.respond_to?(:x) && point.respond_to?(:y) raise ArgumentError, "expected #{point.inspect}:#{point.class} " \ 'to respond to #x and #y' end @bridge.reposition_window point.x, point.y end
def rect
def rect @bridge.window_rect end
def rect=(rectangle)
def rect=(rectangle) unless %w[x y width height].all? { |val| rectangle.respond_to? val } raise ArgumentError, "expected #{rectangle.inspect}:#{rectangle.class} " \ 'to respond to #x, #y, #width, and #height' end @bridge.set_window_rect(x: rectangle.x, y: rectangle.y, width: rectangle.width, height: rectangle.height) end
def resize_to(width, height)
def resize_to(width, height) @bridge.resize_window Integer(width), Integer(height) end
def size
def size @bridge.window_size end
def size=(dimension)
def size=(dimension) unless dimension.respond_to?(:width) && dimension.respond_to?(:height) raise ArgumentError, "expected #{dimension.inspect}:#{dimension.class} " \ 'to respond to #width and #height' end @bridge.resize_window dimension.width, dimension.height end