Class: TestingBot::Capybara::CustomDriver

Inherits:
Capybara::Selenium::Driver
  • Object
show all
Defined in:
lib/testingbot/capybara.rb

Instance Method Summary collapse

Instance Method Details

#browserObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/testingbot/capybara.rb', line 25

def browser
  unless @browser
    if TestingBot.get_config[:require_tunnel]
      TestingBot::Capybara.start_tunnel
    end

    @browser = TestingBot::SeleniumWebdriver.new(@options || {})

    main = Process.pid
    at_exit do
      if @browser
        begin
          @browser.quit 
        rescue
        end
      end
      if TestingBot.get_config[:require_tunnel]
        @tunnel.stop unless @tunnel.nil?
      end
    end
  end
  @browser
end

#session_idObject



21
22
23
# File 'lib/testingbot/capybara.rb', line 21

def session_id
  @browser.session_id
end