require 'ie/version' require 'ie/ie_common' module IE def self.init_envs setup_ie9_env setup_ie10_env end def self.setup_ie9_env puts "cheching for ie9 vm environment variable" if ENV[IE9_VM_NAME].present? and ( ENV[IE9_VM_NAME].size > 0 ) setup_ie_env(IE9_VM_NAME) end end def self.setup_ie10_env puts "cheching for ie9 vm environment variable" if ENV[IE10_VM_NAME].present? and ( ENV[IE10_VM_NAME].size > 0 ) setup_ie_env(IE10_VM_NAME) end end private def self.setup_ie_env(ie_vm_name) puts "configuring selenium driver to point to #{ie_vm_name} VM at #{ENV[ie_vm_name]}" ie_vm_ip = get_ie_vm_ip(ie_vm_name) selenium_server_url = "http://#{ie_vm_ip}:4444/wd/hub" Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :remote, :url => selenium_server_url, :desired_capabilities => :internet_explorer ) end end end