tchandy / watircuke forked from nofxx/watircuke

Webrat & Watir H30 Family common (and some cool) steps as a gem.

This URL has Read+Write access

name age message
file .gitignore Tue Jun 16 03:14:56 -0700 2009 Gemify, just create a profile and require 'wati... [nofxx]
file README.rdoc Loading commit data...
file Rakefile Tue Jun 16 03:41:10 -0700 2009 rakefile credits [nofxx]
file VERSION
file cucumber.yml
directory features/
directory lib/
directory spec/
file watircuke.gemspec
README.rdoc

Watircuke

Webrat & Watir Family common (and some cool) steps as a gem.

Install

Cucumber:wiki.github.com/aslakhellesoy/cucumber/install
Watir ~ Firewatir ~ Safariwatir:wtr.rubyforge.org/install.html

Use

  • Remove step_definitions/webrat_steps.rb if you have it.
  • In the scenarios you want to run watir, just add the @watir tag before.
  • Run `cucumber` for webrat and `cucumber -p watir` for some Watir =D

Rails Sample

cucumber.yml

    default: CUC_ENV=webrat -r features/support/env.rb features -t ~watir
    watir: CUC_ENV=watir  -r features/support/env.rb features -t  watir

support/env.rb

    ENV["RAILS_ENV"] ||= "cucumber"
    require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
    require 'cucumber/rails/world'
    require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
    Cucumber::Rails.use_transactional_fixtures
    Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling

    if ENV['CUC_ENV'] == 'watir'
      require 'watircuke'
      Before do
        @environment = "http://localhost:3000/
        sleep 1
      end
      # optional
      # at_exit do
      #   @browser.close
      # end
    else
      require 'webrat'
      Webrat.configure do |config|
        config.mode = :rails
      end
      require 'cucumber/rails/rspec'
      require 'webrat/core/matchers'
      require 'webratcuke'
    end

ABOUT

**cukewatir maximizes the Gherkin speak and minimizes the Watir code.