Sha256: 28170b2585179deb824308ab71c36e1c00a3adefc472fb6e4c8881d5673f195e

Contents?: true

Size: 683 Bytes

Versions: 12

Compression:

Stored size: 683 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
      return @@browser
    end
    def self.quit
      @@browser.quit
    end
  end  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
page-object-0.4.3 features/support/env.rb
page-object-0.4.2 features/support/env.rb
page-object-0.4.1 features/support/env.rb
page-object-0.4.0 features/support/env.rb
page-object-0.3.2 features/support/env.rb
page-object-0.3.1 features/support/env.rb
page-object-0.3.0 features/support/env.rb
page-object-0.2.5 features/support/env.rb
page-object-0.2.4 features/support/env.rb
page-object-0.2.3 features/support/env.rb
page-object-0.2.2 features/support/env.rb
page-object-0.2.1 features/support/env.rb