Permalink
Browse files

Add readme and license

  • Loading branch information...
1 parent 0359e47 commit d17dd293e292553f2d6a0cf6904f1e49f5f617c1 @clemens clemens committed Nov 4, 2009
Showing with 83 additions and 2 deletions.
  1. +21 −0 MIT-LICENSE
  2. +45 −2 README
  3. +17 −0 example/cucumber/env.rb
View
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2009 Sven Fuchs <svenfuchs@artweb-design.de>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
47 README
@@ -1,6 +1,49 @@
+Steam
+=====
+
+Steam is a headless integration testing tool driving HtmlUnit (http://htmlunit.sourceforge.net/) (and at some point potentially other browsers) which enables testing JavaScript-driven web sites.
+
+Installation
+============
+
+Steam currently has the following dependencies:
+
+* Working Java Runtime
+* RJB (if you're on OS X, see Troubleshooting section)
+
+After that, installing Steam for a Rails project should be as simple as typing
+
+ $ ruby script/plugin install git://github.com/svenfuchs/steam.git
+
+Note: Since the HtmlUnit and all the JARs it depends on come packaged with Steam, the download might take a while.
+
+Usage
+=====
+
+You can use Steam by itself as well as with Cucumber. You can find an example for a Cucumber setup in examples/cucumber/env.rb.
+
+Steam is widely compatible with Webrat - many actions are implemented and take the same or very similar parameters as their Webrat equivalent. You should even be able to use the default webrat_steps.rb that ships with Cucumber.
+
+Troubleshooting
+===============
Installing RJB on Mac OS X:
-http://www.elctech.com/articles/sudo-java_home-and-mac-os-x
+ http://www.elctech.com/articles/sudo-java_home-and-mac-os-x
+
+The visudo way worked for us. Don't forget to add yourself to the sudoers file, though.
+
+Acknowledgements
+================
+
+Kudos to Alexander Lang (http://github.com/langalex) for writing Culerity (http://github.com/langalex/culerity) which pioneered full-stack AJAX-enabled integration testing in Rails.
+
+Developer
+=========
+
+Sven Fuchs <svenfuchs@artweb-design.de>
+
+Contributors
+============
-The visudo way worked for me. Don't forget to add yourself to the sudoers file though.
+Clemens Kofler <clemens@railway.at>
View
@@ -0,0 +1,17 @@
+# Sets up the Rails environment for Cucumber
+ENV["RAILS_ENV"] ||= "cucumber"
+
+$: << File.expand_path(File.dirname(__FILE__) + "/../../vendor/plugins/steam/lib")
+require 'steam'
+require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
+
+browser = Steam::Browser::HtmlUnit.new
+World do
+ Steam::Session::Rails.new(browser)
+end
+
+Before do
+ ActiveRecord::Base.send(:subclasses).each do |model|
+ model.connection.execute("DELETE FROM #{model.table_name}")
+ end
+end

0 comments on commit d17dd29

Please sign in to comment.