Skip to content

Instantly share code, notes, and snippets.

@rodreegez
Created October 22, 2009 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodreegez/215924 to your computer and use it in GitHub Desktop.
Save rodreegez/215924 to your computer and use it in GitHub Desktop.
salient parts of my selenium/cuke env setup
# Set up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
# turn off transactions
Cucumber::Rails::World.use_transactional_fixtures = false
# configure webrat to use selenium
Webrat.configure do |config|
config.mode = :selenium
config.application_environment = :test
config.selenium_server_port = 9999
config.application_port = 5678
config.selenium_browser_key = "*chrome"
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end
# Factory_girl
require Rails.root.join('test','factory')
# Databse cleaner
Before do
puts 'truncating...'
require 'database_cleaner'
require 'database_cleaner/cucumber'
DatabaseCleaner.strategy = :truncation
end
World(Webrat::Selenium::Matchers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment