svenfuchs / steam

Headless integration testing w/ HtmlUnit: enables testing JavaScript-driven web sites

This URL has Read+Write access

Fritz Thielemann (author)
Wed Nov 11 07:30:59 -0800 2009
svenfuchs (committer)
Fri Dec 25 10:18:35 -0800 2009
steam /
name age message
file .gitignore Wed Oct 07 04:45:30 -0700 2009 remove test log [Clemens Kofler and Sven Fuchs]
file MIT-LICENSE Wed Nov 04 14:01:00 -0800 2009 Add readme and license [clemens]
file README Fri Dec 25 10:18:35 -0800 2009 initial config params handling [Fritz Thielemann]
file TODO Wed Nov 04 16:03:40 -0800 2009 add todo file [clemens]
directory app/ Sat Oct 03 00:28:34 -0700 2009 initial commit [svenfuchs]
directory config/ Sat Oct 03 00:28:34 -0700 2009 initial commit [svenfuchs]
directory doc/ Mon Nov 09 00:00:03 -0800 2009 add doc/images [svenfuchs]
directory example/ Wed Nov 18 04:12:24 -0800 2009 Add a webrat step file that will work under eit... [robholland]
file init.rb Fri Dec 25 10:18:35 -0800 2009 reworked [Fritz Thielemann]
directory lib/ Fri Dec 25 10:18:35 -0800 2009 reworked [Fritz Thielemann]
directory test/ Sun Nov 29 15:01:43 -0800 2009 Don't raise Steam::NotFoundError at the moment ... [clemens]
README
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.

Concept
=======

Check out the pictures in the "doc" directory to get an idea how Steam is different from a classic (Webrat) Cucumber or 
Culerity setup.

Demo
====

You can find a demo application here:

  http://github.com/clemens/steam-demo

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.

Configuration
=============

You can control some parameters in init.rb for fitting your needs:

  Steam.configure do |config|
    #:javaloadparams: "-Xms256M -Xmx2048M"
    config.java_load_params = "-Xmx2048M"
  # your test server running steam
    config.server_name = "localhost"
  # the port you start your test server
    config.server_port = "3000"
  # the url scheme for rack
    config.rack_url_scheme = "http"
  # defaut charset
    config.charset = "utf-8"
  # DRB uri
    config.drb_uri = "druby://127.0.0.1:9000"
  # for which server the session request the env
    config.request_env_for = "http://localhost"
  end

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

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.

Developers
==========

Sven Fuchs <svenfuchs@artweb-design.de>
Clemens Kofler <clemens@railway.at>