Class: Capybara::Selenium::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/cukeforker-webdriver/capybara/driver.rb

Instance Method Summary collapse

Instance Method Details

#browserObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cukeforker-webdriver/capybara/driver.rb', line 5

def browser
  unless @browser
    @port = ENV['web_driver_port']
    options[:port] = @port
    @browser = Selenium::WebDriver::Driver.new(CukeForker::WebDriver::NoLockFirefoxBridge.new(options.reject { |key,val| SPECIAL_OPTIONS.include?(key)}))

    main = Process.pid
    at_exit do
      quit if Process.pid == main
    end
  end
  @browser
end

#quitObject



19
20
21
22
23
24
25
# File 'lib/cukeforker-webdriver/capybara/driver.rb', line 19

def quit
  begin
    @browser.quit
  rescue Errno::ECONNREFUSED
  ensure
  end
end