Sha256: 9c78ec602c5e719b76ad9733db1999f39e1c1b6eaca000895e453bd996d893bc
Contents?: true
Size: 1.22 KB
Versions: 1
Compression:
Stored size: 1.22 KB
Contents
require 'watir-webdriver' require 'selenium-webdriver' module PowerSchool module Configuration VALID_OPTION_KEYS = %w(host username password browser).freeze HOST = nil USERNAME = nil PASSWORD = nil attr_accessor *VALID_OPTION_KEYS def self.extend(base) base.reset end def reset self.host = HOST self.username = USERNAME self.password = PASSWORD end def configure yield self download_directory = "#{Dir.pwd}/downloads" profile = Selenium::WebDriver::Firefox::Profile.new profile["browser.download.useDownloadDir"] = true profile['browser.download.dir'] = download_directory profile['browser.helperApps.neverAsk.saveToDisk'] = "Document, text/plain" profile['browser.helperApps.neverAsk.openFile'] = "Document, text/plain" puts profile.inspect driver = Selenium::WebDriver.for :firefox, :profile => profile self.browser ||= Watir::Browser.new(driver) #self.browser ||= Watir::Browser.new :firefox, :profile => profile end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
power_school-0.0.1 | lib/power_school/configuration.rb |