Search code examples
rubyseleniumcucumbercapybaraproject-structure

Ruby and Cucumber Project Structure


How to structure ruby cucumber project such that actual code resides in one folder and test suite resides in another with single point of entry to invoke entire test suite. And to achieve that what other factors do I need to consider.


Solution

  • You can easily set up cucumber for use with rails by using the cucumber-rails gem https://github.com/cucumber/cucumber-rails

    Then in your Gemfile add

    group :test do
      gem 'cucumber-rails', :require => false
    end
    

    Next you'll want to

    bundle install
    

    And then use the generator to set up cucumber in your rails app

    rails generate cucumber:install
    

    This will set up your cucumber code under the features directory in your app.

    Then you can run your cucumber using

     ./script/cucumber