Sha256: 88bfa59e7ff4edbea8e7d22ec41521af5cc9fbf5d9fcf893230935db0f4e59ba

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'watir-webdriver'

module WatirWebdriverRails
  class WatirWebdriverRailsError < StandardError; end
  class TimeoutError < WatirWebdriverRailsError; end
 
end

require 'watir-webdriver-rails/rails'
require 'watir-webdriver-rails/driver'
require 'watir-webdriver-rails/browser'
require 'watir-webdriver-rails/rspec'

# start server
RSpec.configure do |config|
  
  config.include WatirWebdriverRails::RSpec, :example_group=>{:file_path=>/spec[\\\/](requests|integration)/}
  
  config.after(:each) do
    if self.class.include?(WatirWebdriverRails::RSpec)
      browser.clear_cookies
    end
  end
  
  config.after(:suite) do
    WatirWebdriverRails.close_browser if WatirWebdriverRails.close_browser_after_finish == true
  end

  config.before do
    if self.class.include?(WatirWebdriverRails::RSpec)
       WatirWebdriverRails.run_server
       WatirWebdriverRails.initialize_browser
    end
  end

# I would really love to add this hook, but it complains that URL is not valid.
#  config.before(:each) do
#    if self.class.include?(WatirWebdriverRails::RSpec)
#      browser.goto 'about:blank'
#    end
#  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-webdriver-rails-0.0.7 lib/watir-webdriver-rails.rb