Created
October 22, 2009 12:27
-
-
Save rodreegez/215924 to your computer and use it in GitHub Desktop.
salient parts of my selenium/cuke env setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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