LAGUREN.NET
  • HOME
  • About Me

Revisiting Cucumber Part 2 - Getting Set Up

6/6/2017

 
`In my previous post, I discussed a little bit about feature files.  Let’s see what it takes to set up and run the feature file.  These instructions are geared towards *nix and mac os.  Reach out to me, if you would like set up instructions for windows.

First, you’ll need to have ruby and bundler installed.  Visit here to learn how to install Ruby for you system and then install bundler by running the command `gem install bundler`.

Now, let’s create a folder to store all our code.

> mkdir cucumber-example

Navigate to that directory
> cd cucumber-example

*Gemfile*

To begin, create a file called Gemfile with the following entries:

source 'https://rubygems.org'

gem "cucumber", "2.4.0"
gem "rspec-expectations"

Now, run the following command
>  bundle install

This will generate a Gemfile.lock file.

Next, we’ll create the feature folder and place the feature file in it:

> mkdir features

Next we will insert the following feature file in the features folder:

> vi features/folders.feature

Now, we run the following command:

> bundle exec cucumber

If all goes well, you should end up with the following:

You can implement step definitions for undefined steps with these snippets:

Given(/^I have a new job id to process$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

 
You can implement step definitions for undefined steps with these snippets:

When(/^I read the list of job ids$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

 
You can implement step definitions for undefined steps with these snippets:

Then(/^I should have a new folder named after the new job$/) do
  pending # Write code here that turns the phrase above into concrete actions
end
1 scenario (1 undefined)
3 steps (3 undefined)
0m0.091s



Comments are closed.

    RSS Feed

    Categories

    All
    Advice
    Agile
    Android
    Automation
    BDD
    C9D9
    Capybara
    Career
    Continuous Delivery
    Continuous Integration
    Cucumber
    Database
    Ebates
    Firefox
    Fiverr
    GIT
    Groupon
    Interview
    Investing
    Jenkins
    JIRA
    Jmeter
    Jobs
    Meetup
    Melvinisms
    Metaprogramming
    Mobile
    Ruby
    Stockpile
    Training

© COPYRIGHT 2018. ALL RIGHTS RESERVED.
  • HOME
  • About Me