The simplicity thesis

My thoughts on automation engineering

 

Cucumber

  1. I've used Cucumber in 2009 in the first conference I've attended as speaker (BDD4Fun 2009 - Brazil). In my topic I have talked about tools that support BDD and Cucumber was at that time a really fresh and innovative framework that could be used to "run" plain text feature description. Since then Cucumber has been pushed forward and it is today a mature project with a great community support. It is definitely my favorite BDD framework.

Given 'I am on the Google search page' do

  @browser.goto 'http://www.google.com/'

end


When /I search for "(.*)"/ do |query|

  @browser.text_field(:name, 'q').set(query)

  @browser.button(:name, 'btnG').click

end


Then /I should see/ do |text|

  @browser.text.should =~ /#{text}/m

end

Feature: Search

  In order to learn more

  As an information seeker

  I want to find more information


Scenario: Find what I'm looking for

    Given I am on the Google search page

    When I search for "cucumber github"

    Then I should see

     """

      GitHub

      """

Yet Cucumber is threat!

In a world where maintainable code and stupid things like pair programming and collaboration offers no job security, Cucumber should definitely be treated as a threat, since it...

  1. Promotes collaboration between stakeholders and developers

  2. Encourages transparency of how the system actually behaves

  3. Aims to develop a shared understanding or ubiquitous language within the team

  1. Cucumber is a tool that executes plain-text functional descriptions as automated tests.

  2. The language that Cucumber understands is called Gherkin.

    Here is an example in how to execute plain text functional description using watir-webdriver:

What is Cucumber?