Sha256: 8c5d282ccfa9c8c8ad59616fef53897b8c0a4f221824e65e36947e1a7f99ef4f

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))

require 'rspec/expectations'
require 'watir-webdriver'
require 'selenium-webdriver'

require 'page-object'



Before do
  @browser = PageObject::PersistantBrowser.get_browser
end
at_exit do
  PageObject::PersistantBrowser.quit
end

module PageObject
  module PersistantBrowser
    @@browser = false
    def self.get_browser 
      if !@@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  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
page-object-0.5.4 features/support/env.rb
page-object-0.5.3 features/support/env.rb
page-object-0.5.2 features/support/env.rb
page-object-0.5.1 features/support/env.rb
page-object-0.5.0 features/support/env.rb
page-object-0.4.4 features/support/env.rb