Adventures of a wannabe geek!

Ranting within

Automated UI Testing - Part 2 - Installing Cucumber

OK, so after my foraging into WatiN, I really wanted to push things a bit further and begin to look at other ways of automating UI testing. This is when I was pointed in the direction of Cucumber.

Cucumber lets software development teams describe how software should behave in plain text. The text is written in business-readable domain-specific language and serves as documentation, automated tests and development-aid - all rolled into one format. [Thanks to cukes.info for the blurb :)]

To install Cucumber i have had a nightmare following many many different guides. the way i installed it works as follows:

  1. Download the one click ruby installer from here [I installed the 1.91 version]
  2. install Ruby [the path I installed to was c:/ruby19] as this does not come with the new installer
  3. Download the Ruby Development kit from here
  4. Extract the location of the Ruby development kit to the ruby install path [for me c:/ruby19]
  5. The last change i had to make was to update the Ruby development kit to show the path for my ruby installation
  6. C:\Ruby19\devkit\msys\1.0.11\etc\fstab
  7. This just required changing c:\ruby to c:\ruby19 in the paths
  8. Start > All Programs > Ruby 1.9.1-p243 > Start Ruby With Console to open the command line tool
  9. We need to add gemcutter.org to our list of Ruby Gem sources
    • Do this by typing
    • gem sources -a http://gemcutter.org/
  10. Install Cuke4Nuke gem
    • Do this by typing
    • gem install cuke4nuke
  11. Install the Win32Console gem to get colour reports in the windows console window
    • Do this by typing
    • gem install win32console
  12. Save a copy of WAC to work out console colour problems. Download it here
    • I saved this to an easy path - c:/wac.exe

To check all is working, open a command line and type

Cuke4Nuke

If all is working well then you will see a list of help commands

My product didn’t install correctly at this point due to location of ruby files. So i had to make a few changes as detailed. Please note that this is my installation paths and the paths should be changed to your versions:

  • My console ANSI file was not reporting the correct encoding
    • C:\Ruby19\lib\ruby\gems\1.9.1\gems\win32console-1.2.0-x86-mingw32\lib\Win32\Console\ANSI.rb
    • I added the following to the first line of this file
      • # encoding: ISO-8859-1
  • The change detailed above then reports an error in a ruby18.dll
    • removing this files solves this error
      • C:\Ruby19\lib\ruby\gems\1.9.1\gems\win32console-1.2.0-x86-mingw32\lib\Win32\console.so

Hopefully when you run a command line and type Cuke4Nuke the help options will show

Next post will be a sample application that can be run via Cuke4Nuke