How to Setup Cucumber with Ruby



                                                     

1.Ruby 1.9.3 Download and install the following version in separate root directory.
  Last Stable Version: Ruby 1.9.3-p545:

Verification:
 C:\Ruby193:>ruby –v
In case of successful installation, it will show the installed version of the ruby on the system as below:
2.Ruby Dev Kit Download & Installation For Windows 7 -64 Bit
Steps To configure RDK After Download:
1.:>ruby dk.rb init
2.:>ruby dk.rb install
Verification:
Open the Config.yml file(under the RDK installed directory) and verify the current installed version of the ruby at the bottom of the document.
3.Cucumber Installation & verification:
C:\Ruby193:>gem install cucumber
:>gem install rspec (rspec is not mandatory, but it is required in test assertions in cucumber at many places)
4.Ansicon.exe Installation-For command prompt color output
  (also follow the additional instructions in the above link)
  Verification:
 After Ansicon installation, go to command prompt and type
 :>cucumber –help
 :>cucumber test.feature (it should be name of any valid feature file from within project folder)
 In case of successful installation, it will show the help information.
 It will show the tests as passed in green colour after execution.
5.RubyMine IDE 6.3.3. Download and Installation
During installation: make sure to check the 3 options which is for creating shortcuts and adding references to the environment Path.
6.Capybara Installation For Web Test Automation
:>gem install capybara
:>gem install selenium-webdriver

Verification:
1. Open any cucumber feature file and right click and run. It should show the steps as passed after execution in green colour.

Few Learnings:

1.Make sure to create a separate project directory. Inside it create the Features directory and inside it keep the step_definitions folder as follows:
      CucumberProject->features->step_definitions.
2.keep a track of installed components/gems versions on your system while installing or use a gem called Bundler along with gemfile for dependency management.To avoid confusion at later stages.
:>gem install bundler
3.To see the current list with versions of installed gems on your system , type following command at prompt:
:> gem list --local
4. Install the debugger gem for easy debugging while coding/testing in Rubymine IDE by following command:
:>gem ruby-debug19 (Please keep the 19 after the debug as the older version of debugger does not support ruby 1.9X versions. )













  

Comments

Popular posts from this blog

Testing Webservice with SoapUI Having Windows Authentication

How to Re-run Failed Scenarios in Cucumber