My Research on Cucumber

Introduction#

Cucumber is a functional test automation tool for lean and agile teams. It supports behaviour-driven development, specification by example and agile acceptance

testing.The language that Cucumber understands is called Gherkin. You can use it to automate functional validation in a form that is easily readable and understandable

to business users, developers and testers. This helps teams create executable specifications, that are a goal for development, acceptance criteria and functional

regression checks for future changes. In this way, Cucumber allows teams to create living documentation, a single authoritative source of information on system

functionality that is always up-to-date.

 

AN EXAMPLE:


Feature: Search courses
  In order to ensure better utilization of courses
  Potential students should be able to search for courses

  Scenario: Search by topic
    Given there are 240 courses which do not have the topic "biology"
    And there are 2 courses A001, B205 that each have "biology" as one of the topics
    When I search for "biology"
    Then I should see the following courses:
      | Course code |
      | A001        |
      | B205        |

Background:

Cucumber comes about through a number of evolvements of a framework for defining and executing application requirements, using the vocabulary of behaviour-driven

development. Originally Dan North created Rbehave which he later rewrote as Rspecs story runner. Aslak Helles√ły one of the core contributors to Rspec frustrated with

some of the limitations of this implementation took the opportunity to rewrite from scratch which turned into Cucumber. This implementation learnt from the lessons of

the other incarnations while also taking the opportunity to introduce the language evolving around Feature Injection (Based on the musings of Dan North, Chris Matts,

Liz Keogh and David Chelimsky) and incorporating ideas from other specification tools such as Fitnesse. Cucumber continued to evolve creating a grammar called Gherkin

which is evolving into the specification for BDD tools. Also supporting more languages than the original Ruby such as Java, .Net, Clojure, Groovy, Scala, Python and

Javascript.

Scope:

Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber

only requires minimal use of Ruby programmiand Ruby is easyng , so it can also also be used if the developing code in is not Ruby.

Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and

serves as documentation, automated tests and development-aid - all rolled into one format.

Cucumber works with Ruby, Java, .NET, Flex or web applications written in any language.
Following are the specific topics (below) regarding the various aspects of setting up Cucumber.

    Cucumber and other languages (Cucumber’s example directory has examples for some of these)
        Java Virtual Machine: Cucumber-JVM
        .NET (Microsoft.NET and Mono): IronRuby and .NET, IronRuby and Mono
        Adobe Flex: FunFX, Melomel
        Python
        Perl: Test::BDD::Cucumber Test::Pcuke
        Erlang: cucumberl
        PHP: Behat (with Mink for browser testing)
        Web apps in any language: Drive a full or headless browser using one of these
            Webrat – Ruby acceptance testing for web applications
            Capybara – Acceptance testing framework with a webrat-like API and support for multiple backends, including RackTest, Selenium, Celerity and Culerity
            Steam – Drives a fast headless browser with Javascript support. Support for the normal webrat step definitions, see Setting up Steam
            PHP
            WebDriver – Drives IE, Firefox, Chrome
            Watir – Drives IE (Windows only)
            Watir WebDriver – Drives Firefox, Chrome, IE & Opera – optionally headless – Linux/Mac/Windows: “the most elegant way to use webdriver with ruby”
            Celerity – Drives a fast headless browser with Javascript support. Examples here
            Culerity – For when you can’t run your app under jRuby
            Selenium – Runs any browser (any OS), see: Setting up Selenium
            Mechanize – Runs a headless browser (any OS)
    Application frameworks
        Ruby on Rails
        Merb
        Sinatra
    Pimp my Cuke
        Custom Formatters
        Console Colours
        Hooks
        Tags
        Profiles
        Running Features
        Using Rake
        Using MiniTest
        Using RCov with Cucumber and Rails
        Using Test::Unit
    Integrate
        Fixtures
        Continuous Integration
        Autotest Integration
        Related tools that work with Cuke
        Maven cucumber-maven-plugin
        Spork and --drb to decrease Cucumber’s startup time
        Testjour to distribute your features between several machines and run them in parallel



Out of Scope: 

It cannot be integrated or used with QTP tool as working on different environment.

How this can be used with QTP:

 It cannot be used with QTP as each of them works on different languages as Ruby and vbscript.

Can Cucumber scripts be used in QTP and vice versa: 

No, due to technical limitations as mentioned above.

How easy it is to use for automation for manual tester:

 A Manual tester or BA can work on writing features but for implementing them in step definitions, technical person assistance is required.

What are the license costs (if any):

It is freely accessible under the open source MIT License.

Comments

Popular posts from this blog

Testing Webservice with SoapUI Having Windows Authentication

Data Driven Testing Using Selenium -WebDriver in Python

How to Re-run Failed Scenarios in Cucumber