public
Description: A set of commonly used story steps that allow anyone to write rspec stories!
Homepage: http://www.movesonrails.com
Clone URL: git://github.com/foeken/webrat_story_steps.git
webrat_story_steps / SELENIUM
100644 29 lines (18 sloc) 1.498 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Author: Andre Foeken - Nedap
Article: http://www.movesonrails.com/
Bug Tracker: http://nedaphealthcare.lighthouseapp.com/projects/15738/home
 
Special thanks: Notch8 for making the rake stuff work like it should
 
NOTE: All this has only been tested under osx
NOTE: Updating from previous version? Remove the selenium-specr plugin!
 
Using your stories to drive selenium is a breeze when you are using the webrat story steps. You need to do some legwork first by installing the items:
 
A.) Install selenium plugin from github
    CLONE @ git://github.com/wolfdancer/selenium.git
 
* Make sure you have Firefox installed in /Applications/Firefox.app (!)
 
For now you have to run the stories by hand. Now let's get started.
 
First we need a story. Any story will do. Currently each story has a 'story.txt' file and a 'story_spec.rb' file.
We no longer need to add anything to the story to run via selenium.
 
1.) Run './script/generate stories' again if you installed the previous version without selenium support. It will add the helper to your stories directory.
 
2.) Start selenium server and mongrel/webrick: 'rake selenium:start'
    This will start selenium, and run script/server with the correct arguments (-e test -p 3000 --debugger)
 
3.) Now run your story with the SELENIUM variable set: 'SELENIUM=true ruby stories/story_spec.rb'
 
NOTE: If you want specific environment stuff in your selenium session just create a selenium environment / database config and it will default to that.