github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

brynary / webrat

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1,417
    • 312
  • Source
  • Commits
  • Network (312)
  • Wiki (10)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (8)
    • 0-3-stable
    • 0-4-stable
    • 0-5-stable
    • limit_open_errors
    • master ✓
    • rack
    • rails_attach_file
    • rspec_book
  • Switch Tags (19)
    • v0.7.2.beta.1
    • v0.7.1
    • v0.7.0
    • v0.6.rc1
    • v0.6.0
    • v0.5.3
    • v0.5.1
    • v0.5.0
    • v0.4.5
    • 0.4.4
    • 0.4.3
    • 0.4.2
    • 0.4.1
    • 0.4.0
    • 0.3.4
    • 0.3.3
    • 0.3.2
    • 0.2.2
    • 0.2.1
  • Branch List
Sending Request…

Webrat - Ruby Acceptance Testing for Web applications — Read more

  Cancel

http://gitrdoc.com/brynary/webrat/tree/master/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Prep for 0.7.2.beta.1 release 
brynary (author)
Sun Jul 25 17:30:23 -0700 2010
commit  dcd17ac39f00e62104ff
tree    d9f5c768f10427f7822d
parent  caa6870cdefeffcf8e19
webrat /
name age
history
message
file .document Mon Nov 24 22:04:26 -0800 2008 Adding .document RDoc config file [brynary]
file .gitignore Fri Nov 13 14:41:33 -0800 2009 Use Bundler for managing dependencies needed to... [brynary]
file Gemfile Fri Apr 23 09:15:30 -0700 2010 Update Gemfile to the newest Bundler. [djanowski]
file History.txt Mon Apr 26 19:10:16 -0700 2010 Releasing v0.7.1 [brynary]
file MIT-LICENSE.txt Sun Mar 02 16:35:46 -0800 2008 Add hoe for gem support [brynary]
file README.rdoc Sat Dec 27 15:22:51 -0800 2008 updated from master [gaffo]
file Rakefile Mon Apr 12 19:30:56 -0700 2010 Some explicit requires of RubyGems are necessar... [djanowski]
file Thorfile Sun Jan 17 17:42:37 -0800 2010 Added missing dependency "rack-test" to gemspec... [noahd1]
file install.rb Mon Nov 24 17:34:10 -0800 2008 Adding gemspec. Hopfully gem will build on GitH... [brynary]
directory lib/ Sun Jul 25 17:30:23 -0700 2010 Prep for 0.7.2.beta.1 release [brynary]
directory spec/ Wed Jul 07 20:36:52 -0700 2010 Consider whether inner text matches when select... [Luke Melia]
directory vendor/ Sat Jul 24 10:31:56 -0700 2010 Bump vendored Selenium RC server to 1.0.3 [brynary]
file webrat.gemspec Sun Jul 25 17:30:23 -0700 2010 Prep for 0.7.2.beta.1 release [brynary]
README.rdoc

Webrat - Ruby Acceptance Testing for Web applications

  • gitrdoc.com/brynary/webrat
  • groups.google.com/group/webrat
  • webrat.lighthouseapp.com/
  • github.com/brynary/webrat
  • #webrat on Freenode

Description

Webrat lets you quickly write expressive and robust acceptance tests for a Ruby web application.

Features

  • Browser Simulator for expressive, high level acceptance testing without the performance hit and browser dependency of Selenium or Watir (See Webrat::Session)
  • Use the same API for Browser Simulator and real Selenium tests using Webrat::Selenium when necessary (eg. for testing AJAX interactions)
  • Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
  • Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
  • Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.

Example

  class SignupTest < ActionController::IntegrationTest

    def test_trial_account_sign_up
      visit home_path
      click_link "Sign up"
      fill_in "Email", :with => "good@example.com"
      select "Free account"
      click_button "Register"
    end

  end

Behind the scenes, Webrat will ensure:

  • If a link, form field or button is missing, the test will fail.
  • If a URL is invalid, the test will fail.
  • If a page load or form submission is unsuccessful, the test will fail.

Installing Nokogiri

Users of Debian Linux (e.g. Ubuntu) need to run:

  sudo apt-get install libxslt1-dev libxml2-dev.

Otherwise the Nokogiri gem, which Webrat depends on, won’t install properly.

Install for Rails

To install the latest release as a gem:

  sudo gem install webrat

To install the latest code as a plugin: (_Note:_ This may be less stable than using a released version)

  script/plugin install git://github.com/brynary/webrat.git

In your test_helper.rb or env.rb (for Cucumber) add:

  require "webrat"

  Webrat.configure do |config|
    config.mode = :rails
  end

Install with Merb

Merb 1.0 has built-in, seamless Webrat support. Just start using methods from Webrat::Session in your specs.

Authors

  • Maintained by Bryan Helmkamp
  • Original code written by Seth Fitzsimmons
  • Initial development was sponsored by EastMedia
  • Many other contributors. See attributions in History.txt

License

Copyright © 2007-2008 Bryan Helmkamp, Seth Fitzsimmons. See MIT-LICENSE.txt in this directory.

Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文