Rails test runner
Summary
This is a simple rails application that allows remote execution of Ruby/Watir scripts. The scripts are expected to use test/unit (or otherwise provide meaningful console output).
The rails app runs on the client that will actually execute the tests; when a user accesses the application URL remotely, they should see a page containing the list of scripts available to run.
Clicking on a script's name will start execution, and the console output of the test script is displayed in the browser.
Installation and usage
Note that this app does not use or expect a database, so there's no need to set one up during install.
Install steps:
- On the client that will run the tests, install rails with 'gem install rails'
- Download runner.zip from the link below, and extract it in any dir on the client.
- Go into the extracted 'runner' dir and execute 'runner_start.bat'
- From either the local or a remote machine, open a browser and access http://HOST:3000
(where HOST is your machine's address) - Attempt to run the google test suite.
- If that works, place your own scripts into runner/data/suites/ and try to run them using the application.
A special note on running more than one test concurrently:
It is possible to execute more than one test script at the same time using this runner. However, this can result in problems when running Watir scripts against a target site that uses authentication, especially cookie-based authentication.
The most common problem appears when a Watir-driven browser accesses a site, and expects an authentication prompt - but if another browser is already open and authenticated with the target site, the second browser may reuse the credentials of the first browser. This might be because IE instances invoked using OLE automation (which Watir makes use of) appear to share the cookie state of any other IE instances open at the same time. This type of behavior is usually not seen in IE instances started manually.
Comments (3)
Mar 28, 2007
David Brown says:
Bill, Thank you very much for posting this test runner. It is great to finally ...Bill, Thank you very much for posting this test runner. It is great to finally have a way for developers who don't have Watir & Ruby installed on their machines to be able to run test and view the results remotely!
May 18, 2007
Robert Shaw says:
Bill, This is awsome.. I have been looking for something like this. We use WAT...Bill,
This is awsome.. I have been looking for something like this.
We use WATIR to run compatability tests against vaious ie/os versions..
Being able to run from one common lib.. Priceless..
I am having an issue with some of our suite..
Tests are not running and getting... with NO console output.
ApplicationController: missing default helper path application_helper
RunnerController: missing default helper path runner_helper
Any Ideas..?
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
C:/runner/config/environment.rb:4: warning: already initialized constant RAILS_R
OOT
ApplicationController: missing default helper path application_helper
RunnerController: missing default helper path runner_helper
May 24, 2007
Bill Agee says:
Robert - I sent a PM to your forum username with some suggestions. And there's ...Robert - I sent a PM to your forum username with some suggestions.
And there's another thing I just remembered to suggest: You might check to see if the problem scripts work when you manually execute them from a different directory. For example, cd to the root of your drive and run "ruby \path\to\script\foo.rb", and see if it works.
If it complains about not finding a required file then it is probably why the script isn't working in the runner. The runner's working dir is the runner\ directory, and not the runner\suites\ dir, where the test scripts live. I should probably change that and post a new version of the app.
There are a couple of ways to fix this on your end:
http://www.mail-archive.com/wtr-general@rubyforge.org/msg07822.html
http://www.mail-archive.com/wtr-general@rubyforge.org/msg07895.html