Sha256: 462d5c7b18bd2759821fb7381c1cb5f6712ee78ff9283c998dc055739df9defc

Contents?: true

Size: 1.31 KB

Versions: 39

Compression:

Stored size: 1.31 KB

Contents

module Selenium
  module WebDriver
    module Opera

      #
      # @api private
      #

      class Service
        MISSING_TEXT = 'Unable to find the Selenium server jar.  Please download the standalone server from http://code.google.com/p/selenium/downloads/list and set the SELENIUM_SERVER_JAR environmental variable to its location.  More info at http://code.google.com/p/selenium/wiki/OperaDriver.'

        def self.selenium_server_jar
          @selenium_server_jar ||= (
            ENV['SELENIUM_SERVER_JAR'] or raise Error::WebDriverError, MISSING_TEXT
          )
        end

        def self.selenium_server_jar=(path)
          Platform.assert_file path
          @selenium_server_jar = path
        end

        def self.default_service(opts = {})
          new selenium_server_jar, opts
        end

        def initialize(jar, opts = {})
          opts.merge! :background => true, :port => PortProber.random
          opts.merge! :log => !!$DEBUG if $DEBUG
          @server = Selenium::Server.new File.expand_path(jar), opts
        end

        def uri
          @server.webdriver_url
        end

        def start
          @server.start
          Platform.exit_hook { stop }  # make sure we don't leave the server running
        end

        def stop
          @server.stop
        end
      end

    end
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/opera/service.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/opera/service.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/opera/service.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/opera/service.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.22.0.rc1 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.21.2 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.21.2.rc1 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.21.1 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.21.0 lib/selenium/webdriver/opera/service.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/selenium-webdriver-2.20.0/lib/selenium/webdriver/opera/service.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/selenium-webdriver-2.20.0/lib/selenium/webdriver/opera/service.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/selenium-webdriver-2.20.0/lib/selenium/webdriver/opera/service.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/selenium-webdriver-2.20.0/lib/selenium/webdriver/opera/service.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/selenium-webdriver-2.20.0/lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.20.0 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.20.0.rc1 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.19.0 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.19.0.rc2 lib/selenium/webdriver/opera/service.rb
selenium-webdriver-2.19.0.rc1 lib/selenium/webdriver/opera/service.rb