Sha256: e12eea7dbc88f684d41e3ee6eed7867e5c5c176f165def5c79272149fc184644

Contents?: true

Size: 477 Bytes

Versions: 8

Compression:

Stored size: 477 Bytes

Contents

require 'watir-webdriver'
require 'selenium-webdriver'

module PersistentBrowser

  @@browser = false

  def self.get_browser
    unless @@browser
      @@browser = Watir::Browser.new :firefox if ENV['DRIVER'] == 'WATIR'
      @@browser = Selenium::WebDriver.for :firefox if ENV['DRIVER'] == 'SELENIUM'
    end
    @@browser
  end

  def self.quit
    @@browser.quit
  end
end

Before do
  @browser = PersistentBrowser.get_browser
end

at_exit do
  PersistentBrowser.quit
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jqueryui_widgets-1.0 features/support/hooks.rb
jqueryui_widgets-0.7.1 features/support/hooks.rb
jqueryui_widgets-0.6 features/support/hooks.rb
jqueryui_widgets-0.5 features/support/hooks.rb
jqueryui_widgets-0.4 features/support/hooks.rb
jqueryui_widgets-0.3 features/support/hooks.rb
jqueryui_widgets-0.2 features/support/hooks.rb
jqueryui_widgets-0.1 features/support/hooks.rb