Method: Appium::Capybara::Driver#browser

Defined in:
lib/appium_capybara/driver/appium/driver.rb

#browserObject

override

Creates and starts a new appium driver. To access the browser without creating one use @browser



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/appium_capybara/driver/appium/driver.rb', line 20

def browser
  return @browser if @browser

  @appium_driver = Appium::Driver.new @options, false
  # browser is the standard selenium driver without any appium methods
  @browser = @appium_driver.start_driver

  main = Process.pid
  at_exit do
    # Store the exit status of the test run since it goes away after calling the at_exit proc...
    @exit_status = $ERROR_INFO.status if $ERROR_INFO.is_a?(SystemExit)
    quit if Process.pid == main
    exit @exit_status if @exit_status # Force exit with stored status
  end
  @browser
end