Class: CapybaraSetup

Inherits:
Object
  • Object
show all
Defined in:
lib/frameworks/capybara.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCapybaraSetup

Returns a new instance of CapybaraSetup.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/frameworks/capybara.rb', line 7

def initialize
  #validate environment variables set using cucumber.yml or passed via command line
  validate_env_vars

  #Disable rack server
  Capybara.run_server = false

  case ENV['BROWSER']
  when 'headless' then
    @driver = register_celerity_driver(false,ENV['PROXY_URL'])
  when 'remote' then
    @driver = register_remote_driver(ENV['PROXY_URL'], ENV['REMOTE_BROWSER_PROXY'], ENV['PLATFORM'],ENV['REMOTE_BROWSER'], ENV['BROWSER_VERSION'], ENV['REMOTE_URL'], ENV['FIREFOX_PROFILE'])
  else
    @driver = register_selenium_driver(ENV['BROWSER'], ENV['FIREFOX_PROFILE'])
  end
end

Instance Attribute Details

#driverObject

Returns the value of attribute driver.



5
6
7
# File 'lib/frameworks/capybara.rb', line 5

def driver
  @driver
end