persistent_selenium/lib/persistent_selenium.rb

39 lines
607 B
Ruby
Raw Normal View History

2012-11-26 16:36:43 +00:00
require "persistent_selenium/version"
2013-04-09 15:37:14 +00:00
require 'selenium-webdriver'
2012-11-26 16:36:43 +00:00
module PersistentSelenium
class << self
attr_writer :port, :browser, :timeout, :chrome_extensions
2012-11-26 16:36:43 +00:00
def port
@port ||= 9854
end
def browser
@browser ||= :firefox
end
2013-05-14 14:57:55 +00:00
def timeout
@timeout ||= 120
end
def chrome_extensions
@chrome_extensions ||= []
end
2012-11-26 16:36:43 +00:00
def url
"druby://localhost:#{port}"
end
def configure
yield self
end
def load_dotfile(file = '.persistent_selenium')
if File.file?(file)
load file
end
end
2012-11-26 16:36:43 +00:00
end
end