• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Cucumber
 

Cucumber

on

  • 903 views

A high level, integration testing framework

A high level, integration testing framework

Statistics

Views

Total Views
903
Views on SlideShare
895
Embed Views
8

Actions

Likes
0
Downloads
7
Comments
0

3 Embeds 8

http://www.linkedin.com 5
http://www.slideshare.net 2
https://www.linkedin.com 1

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • (possibly even javascript or flash) <br /> (to later be interpreted into ruby)
  • Scenario is made up of many steps, defined with regex
  • Scenario is made up of many steps, defined with regex
  • Cucumber provides prewritten steps (webrat.steps)
  • translate plain english into a resource path (URL) with regex
  • Steps that will be run for all scenarios in a feature

Cucumber Cucumber Presentation Transcript

  • CUCUMBER A high level, integration testing framework
  • • Testing the entire stack • Designed to create applications via BDD • Define behavior in plain english, not "code"
  • WORK FLOW 1. Feature - integration test 2. Spec - unit test 3. Code
  • FEATURES Feature... name In order... goal As a... role I want... action
  • FEATURES # manage_articles.feature Feature: Manage Articles In order to make a blog As an author I want to create articles
  • SCENARIOS Scenario... name Given... setup When... exercise Then... test
  • SCENARIOS # manage_articles.feature Scenario: Articles List Given I have articles titled Pizza, Breadsticks When I go to the list of articles Then I should see "Pizza" And I should see "Breadsticks"
  • STEPS # manage_articles_steps.rb Given /^I have articles titled (.+)$/ do |titles| titles.split(', ').each do |title| Article.create!(:title => title) end end
  • PATHS # paths.rb # When I go to the list of articles def path_to(page_name) case page_name when /the list of articles/ articles_path end end
  • BACKGROUND # manage_articles.feature Background: Given the following user records | username | password | admin | | bob | secret | false | | admin | secret | true | Scenario: Protect articles from regular users Given I am logged in as "bob" When I visit the list of articles And I press "Delete all" Then I should see "Sorry you cannot do that" Scenario: Delete articles as admin Given I am logged in as "bob" When I visit the list of articles And I press "Delete all" Then I should see "Articles deleted”
  • RESOURCES • http://cuckes.info • http://wiki.github.com/brynary/webrat • http://rubular.com • http://ianwhite.github.com/pickle/