Home > cucumber > Introduction to Cucumber

Introduction to Cucumber

More than a testing tool, Cucumber is a collaboration tool.

It is designed to accommodate both the technical(developers, automation testers) and non-technical(stakeholders, product owners) members of the software development team.

Cucumber supports behavior-driven development(BDD). In BDD, users(business analysts, product owners) first write scenarios or acceptance tests that describes the behavior of the system from the customer’s perspective, for review and sign-off by the product owners before developers write their codes.

When you run your test, Cucumber reads through user-readable files called features, parse it to scenarios which contains set of steps that are then matched to a step definitions of Ruby code using a regular expression.

Feature files could be deceiving. It may look simple and plain in the outside. But complex in the inside, within step definition or the ruby files which controls the flow of actions and where all the magic happens.

In order for Cucumber to understand the feature files, it uses a basic syntax called Gherkin. Gherkin makes use of the following keywords for documentation and readability — Feature, Background, Scenario, Given, When, Then, And, But, *, Scenario Outline and Examples.

To dive more information about Cucumber, I would recommend you read The Cucumber Book  which have valuable information you would need in learning this new technology.

In preparation to  your Cucumber testing experience, will be needing to setup the following in your local machine.

1. Java installation – JRE will do, mine is Java(TM) SE Runtime Environment 1.6

2. Ruby installation – visit their Downloads page. I have Jruby 1.6.7.2 installed in my box.

Don’t forget to define Java and Ruby Path in your system’s environment variables as well.

3. RubyGems installation – use “gem install <name of gem>” command. Here are some of the basic, helpful gems:

– Cucumber

– Capybara

– Rspec

If you’re all setup, feel free to jump to the next post – Automated Testing with Cucumber + Capybara

Reference: The Cucumber Book by Matt Wynne and Aslak Hellesoy

Advertisements
Categories: cucumber Tags: , ,
  1. No comments yet.
  1. October 29, 2012 at 5:21 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: