Sha256: c55e16248ff7ecbc75cb984f9a43e6af13995a8c734a5b8ec9af1d32a505844a

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

require 'selenium-webdriver'
require 'selenium-connect/configuration'
require 'selenium-connect/runner'
require 'selenium-connect/server'

module SeleniumConnect

  extend self
  attr_reader :config, :config_file, :location, :server, :driver

  def configure
    yield configuration
  end

  def configuration
    @config = Configuration.new
  end

  def localhost?
    config.host == 'localhost'
  end

  def debug_config
    config
  end

  def run
    if localhost?
      @server = Server.new(config)
      server.start
    end
    @driver = Runner.new(config).driver
  end

  def finish
    begin
      driver.quit
    rescue Selenium::WebDriver::Error::WebDriverError
      #no-op
    end
    if localhost? then server.stop end
  end

  alias :start :run
  alias :stop :finish
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-connect-2.0.0 lib/selenium-connect.rb