The idea is to get Cucumber running features of Webrat together with Celerity. Right now they are running together, only I need some help getting celerity waiting for Ajax responses, see error in gist.
The features directory is set up like recommended in cucumber wiki setting up selenium
Webrat and Celerity steps are both using (there's still cleaning to do) the same API (the webrat one) so you have common steps in features/step_definitions/webrat_steps.rb and celerity only in features/step_definitions/celerity_steps.rb
$ rake db:migrate
create a pids directory for jruby process handling
$ mkdir tmp/pids -p
start your test server to have celerity requesting resources
$ ruby script/server -p 80 -e test
There are Webrat features in features/plain then you run them with:
$ cucumber -p webrat
There are Celerity only features in features/celerity you run them with:
$ cucumber -p celerity
To do it we have defined two profiles in cucumber.yml:
webrat: -r features/support/env.rb -r features/support/webrat.rb -r features/step_definitions/webrat_steps.rb features/plain celerity: -r features/support/env.rb -r features/support/culerity.rb -r features/step_definitions/culerity_steps.rb features/celerity
The latter would allow to define browser indepent setups (by passing options to Celerity.Browser.new) and then run your steps against e.g firefox and IE.
Inside features/support/webrat.rb and celerity.rb the needed setups for each are accomplished.
sometimes you can have jruby processes alive when they should not, kill them:
$ ps aux | grep jruby | awk '{ print $2 }' | xargs kill TERM
- get celerity smoothly running and waiting for ajax responses
- have this all clean up, and have culerity generators do the job
- make the culerity objects initialization in a before_all/after_all manner (now are done in before_each/after_all manner)
- Automate rails server starting and stoping