Sha256: 8ee15429e20c3e6d6eb5ce6e71334cabea07a6430545446ec1605a7e414f50db

Contents?: true

Size: 694 Bytes

Versions: 4

Compression:

Stored size: 694 Bytes

Contents

module Webdriver
  class Window
    attr_reader :id
    def initialize(id, connection)
      @id = id
      @connection = Webdriver::PrefixConnection.new "window", connection
    end

    def maximize!
      @connection.post "maximize"
      self
    end

    def minimize!
      @connection.post "minimize"
      self
    end

    def rect! width: nil, height: nil, x: nil, y:nil
      @connection.post("rect", {}, {
        width: width,
        height: height,
        x: x,
        y: y
      })
      rect
    end

    def rect
      @connection.get "rect"
    end

    def fullscreen!
      @connection.post "fullscreen"
    end

    def close!
      @connection.delete
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
webdriver-0.5.0 lib/webdriver/window.rb
webdriver-0.4.0 lib/webdriver/window.rb
webdriver-0.3.0 lib/webdriver/window.rb
webdriver-0.2.0 lib/webdriver/window.rb