Sha256: 8524a9b891ad8b0153cbe33332f08246c68eaf21441ad80df71688df7059aa92

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

module Selenium
  module WebDriver
    class Options

      def initialize(driver)
        @bridge = driver.bridge
      end

      def add_cookie(opts = {})
        raise ArgumentError, "name is required" unless opts[:name]
        raise ArgumentError, "value is required" unless opts[:value]

        opts[:path] ||= "/"
        opts[:secure] ||= false

        @bridge.addCookie opts
      end

      def delete_cookie(name)
        @bridge.deleteCookie name
      end

      def delete_all_cookies
        @bridge.deleteAllCookies
      end

      def all_cookies
        @bridge.getAllCookies.map do |cookie|
          {
            :name    => cookie["name"],
            :value   => cookie["value"],
            :path    => cookie["path"],
            :domain  => cookie["domain"],
            :expires => cookie["expires"],
            :secure  => cookie["secure"]
          }
        end
      end

      def speed
        @bridge.getSpeed.downcase.to_sym
      end

      def speed=(speed)
        @bridge.setSpeed(speed.to_s.upcase)
      end

    end # Options
  end # WebDriver
end # Selenium

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rainux-selenium-webdriver-0.0.17 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.17 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.16 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.15 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.14 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.13 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.12 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.11 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.10 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.9 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.8 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.7 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.6 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.5 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.4 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.3 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.2 common/src/rb/lib/selenium/webdriver/options.rb
selenium-webdriver-0.0.1 common/src/rb/lib/selenium/webdriver/options.rb