Quality Assurance in software development, is not the sole responsibility any one team, yet the structure (and project schedules) of many organizations makes the Test team, in particular, "accountable".
The net effect is you end up with strange beliefs that "not letting developers talk to testers" will improve the quality of the software product. What gives?
At what point did we lose the plot?
Fortunately, there's some smart folks out there who realize there's a better way. Competitive software companies nowadays are doing some interesting things;
* Building & Testing what the customer actually wants (BDD, Agile Specs
* Not wasting time (and money) on stuff that's not important. (MMF, Getting Real)
* Automating things instead of doing them by hand. (Like testing!)
* Training people how to write Code That's Easy to Test (the Pragmatic Programmer)
* Training people how to write tests for that same code (cmon, this is basic QA people! Educate your developers.)
* Training people to write & run those tests before they write any code (e.g. BDD/TDD/XP )
* Isolating bugs when they are introduced, not 6 months later (Continuous Integration) And last but not least;
* Responsibility, accountability and pride your own/team's work. (Leadership, Software Craftmanship, SCRUM)
Easier said than done, yes, but its not rocket surgery.
wget <http://server/path/to/cucumber-0.2.3.1.gem> git clone git://github.com/aslakhellesoy/cucumber.git cd cucumber rake install_gem
selenium
Cucumber comes with 2 trivial examples, which you can run;
h4. Running the sample Cucumber + Selenium test
cucumber ../selenium/features/
Ensure this works first before trying the Webrat test below;
h4. Running the sample Cucumber + Selenium + Webrat test
To run the example test which includes Webrat, you can also use the rakefile supplied;
@../examples/selenium_webrat]$ rake features --trace@
Jackpot Winner!
or not. For me at least. I hit the wall with a timeout error, which is probably some missing Webrat config;
23:59:22.555 INFO - Command request: type[webrat=q, rspec] on session fadcc5971c4d47e5aae10c41e03af3b2
23:59:22.578 INFO - Got result: OK on session fadcc5971c4d47e5aae10c41e03af3b2
23:59:22.581 INFO - Command request: waitForCondition[ var element;
try {
element = selenium.browserbot.findElement('button=evalregex:/btnG/');
} catch(e) {
element = null;
}
element != null;, 10000] on session fadcc5971c4d47e5aae10c41e03af3b2
23:59:32.607 INFO - Got result: Timed out after 10000ms on session fadcc5971c4d47e5aae10c41e03af3b2
23:59:32.611 INFO - Command request: testComplete[, ] on session fadcc5971c4d47e5aae10c41e03af3b2click_button('btnG')
versus
@browser.click 'btnG'
h4. Other Methods
In my quest for Cucumber Glory, I did stumble across these useful, related resources;
# "How To Setup RSpec, Cucumber, Webrat, RCov and Autotest on Leopard":http://www.claytonlz.com/index.php/2009/04/how-to-setup-rspec-cucumber-webrat-rcov-and-autotest-on-leopard/
# "Testing Non-Ruby Applications with Cucumber":http://www.vitarara.org/cms/testing_non-ruby_applications_with_cucumber
# "Using Cucumber for Acceptance Testing":http://www.pathf.com/blogs/2009/03/using-cucumber-for-acceptance-testing/
# "Cucumber...with webrat mechanized sessions":http://www.pathf.com/blogs/2009/03/using-cucumber-for-acceptance-testing/comment-page-1/#comment-6101
## And oelmekkis "env.rb":http://gist.github.com/82813
h4. My currently installed Gems
FYI my gem versions at time of writing;
*** LOCAL GEMS *** actionmailer (2.3.2, 2.2.2) actionpack (2.3.2, 2.2.2, 1.13.6) actionwebservice (1.2.6) activerecord (2.3.2, 2.2.2, 1.15.6) activeresource (2.3.2, 2.2.2) activesupport (2.3.2, 2.2.2, 1.4.4) builder (2.1.2) cucumber (0.2.3.1, 0.1.12) diff-lcs (1.1.2) fastercsv (1.4.0, 1.2.3) hoe (1.12.1) mechanize (0.9.2) nokogiri (1.2.3) polyglot (0.2.5) rails (2.3.2, 2.2.2) rake (0.8.4) rspec (1.1.12) ruby-oci8 (1.0.4) rubyforge (1.0.3) Selenium (1.1.14) selenium-client (1.2.14) syntax (1.0.0) term-ansicolor (1.0.3) treetop (1.2.5) webrat (0.4.3)