SlideShare a Scribd company logo
1 of 11
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/

More Related Content

What's hot

Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
Spike Brehm
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 

What's hot (14)

BBUI
BBUIBBUI
BBUI
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
JavaScript on Rails 튜토리얼
JavaScript on Rails 튜토리얼JavaScript on Rails 튜토리얼
JavaScript on Rails 튜토리얼
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with Adobe
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
 
An introduction to jQuery
An introduction to jQueryAn introduction to jQuery
An introduction to jQuery
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
BDD in Drupal 8 Using Behat, mink and Selenium
BDD in Drupal 8 Using Behat, mink and SeleniumBDD in Drupal 8 Using Behat, mink and Selenium
BDD in Drupal 8 Using Behat, mink and Selenium
 
Browserify
BrowserifyBrowserify
Browserify
 
How to driver your webservices with ansible
How to driver your webservices with ansibleHow to driver your webservices with ansible
How to driver your webservices with ansible
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Lightning Talk: Making JS better with Browserify
Lightning Talk: Making JS better with BrowserifyLightning Talk: Making JS better with Browserify
Lightning Talk: Making JS better with Browserify
 
Rails3 asset-pipeline
Rails3 asset-pipelineRails3 asset-pipeline
Rails3 asset-pipeline
 
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JSWordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JS
 

Viewers also liked

School Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
School Presentation Szkoła Podstawowa nr 6 im. Janusza KorczakaSchool Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
School Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
Tiina Sarisalmi
 
Amia Chi Citizen Public Health V2
Amia Chi Citizen Public Health V2Amia Chi Citizen Public Health V2
Amia Chi Citizen Public Health V2
bonander
 
Digital Trends Impacting News Companies
Digital Trends Impacting News CompaniesDigital Trends Impacting News Companies
Digital Trends Impacting News Companies
Reid Williams
 
Christmas Handicraft by Thanasis
Christmas Handicraft by ThanasisChristmas Handicraft by Thanasis
Christmas Handicraft by Thanasis
Tiina Sarisalmi
 
Lunch Menus and Recipes from Portugal
Lunch Menus and Recipes from PortugalLunch Menus and Recipes from Portugal
Lunch Menus and Recipes from Portugal
Tiina Sarisalmi
 
Copyright and Fair Use for USU Extension
Copyright and Fair Use for USU ExtensionCopyright and Fair Use for USU Extension
Copyright and Fair Use for USU Extension
Britt Fagerheim
 
Copyright: Regional Campuses and Distance Education
Copyright: Regional Campuses and Distance EducationCopyright: Regional Campuses and Distance Education
Copyright: Regional Campuses and Distance Education
Britt Fagerheim
 
SEO pro manažery
SEO pro manažerySEO pro manažery
SEO pro manažery
vaclav.lohr
 
Personagraph Whitepaper
Personagraph WhitepaperPersonagraph Whitepaper
Personagraph Whitepaper
Tapan Kamdar
 

Viewers also liked (20)

All Objects are created .equal?
All Objects are created .equal?All Objects are created .equal?
All Objects are created .equal?
 
plaY [commercial]
plaY [commercial]plaY [commercial]
plaY [commercial]
 
WELD, Why, Content Marketing & Gamification
WELD, Why, Content Marketing & GamificationWELD, Why, Content Marketing & Gamification
WELD, Why, Content Marketing & Gamification
 
School Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
School Presentation Szkoła Podstawowa nr 6 im. Janusza KorczakaSchool Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
School Presentation Szkoła Podstawowa nr 6 im. Janusza Korczaka
 
Amia Chi Citizen Public Health V2
Amia Chi Citizen Public Health V2Amia Chi Citizen Public Health V2
Amia Chi Citizen Public Health V2
 
Digital Trends Impacting News Companies
Digital Trends Impacting News CompaniesDigital Trends Impacting News Companies
Digital Trends Impacting News Companies
 
Christmas Handicraft by Thanasis
Christmas Handicraft by ThanasisChristmas Handicraft by Thanasis
Christmas Handicraft by Thanasis
 
Lunch Menus and Recipes from Portugal
Lunch Menus and Recipes from PortugalLunch Menus and Recipes from Portugal
Lunch Menus and Recipes from Portugal
 
plaY [pera]
plaY [pera]plaY [pera]
plaY [pera]
 
Our School in Turkey
Our School in TurkeyOur School in Turkey
Our School in Turkey
 
Relief 2.0 in Japan (Japanese Version)
Relief 2.0 in Japan (Japanese Version)Relief 2.0 in Japan (Japanese Version)
Relief 2.0 in Japan (Japanese Version)
 
Credentials - ways2engage
Credentials - ways2engageCredentials - ways2engage
Credentials - ways2engage
 
Copyright and Fair Use for USU Extension
Copyright and Fair Use for USU ExtensionCopyright and Fair Use for USU Extension
Copyright and Fair Use for USU Extension
 
Double Trouble
Double TroubleDouble Trouble
Double Trouble
 
Matias Perez Garate
Matias Perez GarateMatias Perez Garate
Matias Perez Garate
 
Copyright: Regional Campuses and Distance Education
Copyright: Regional Campuses and Distance EducationCopyright: Regional Campuses and Distance Education
Copyright: Regional Campuses and Distance Education
 
SEO pro manažery
SEO pro manažerySEO pro manažery
SEO pro manažery
 
The vmware story
The vmware storyThe vmware story
The vmware story
 
CoreyGerovac
CoreyGerovacCoreyGerovac
CoreyGerovac
 
Personagraph Whitepaper
Personagraph WhitepaperPersonagraph Whitepaper
Personagraph Whitepaper
 

Similar to Cucumber

UPenn on Rails pt 2
UPenn on Rails pt 2UPenn on Rails pt 2
UPenn on Rails pt 2
Mat Schaffer
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
Mat Schaffer
 
PTW Rails Bootcamp
PTW Rails BootcampPTW Rails Bootcamp
PTW Rails Bootcamp
Mat Schaffer
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
Frank Rousseau
 

Similar to Cucumber (20)

Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirent
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à Ruby
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
UPenn on Rails pt 2
UPenn on Rails pt 2UPenn on Rails pt 2
UPenn on Rails pt 2
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
 
PTW Rails Bootcamp
PTW Rails BootcampPTW Rails Bootcamp
PTW Rails Bootcamp
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
Rails 3 (beta) Roundup
Rails 3 (beta) RoundupRails 3 (beta) Roundup
Rails 3 (beta) Roundup
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
Ruby on Rails - Introduction
Ruby on Rails - IntroductionRuby on Rails - Introduction
Ruby on Rails - Introduction
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 
Test legacy apps with Behat
Test legacy apps with BehatTest legacy apps with Behat
Test legacy apps with Behat
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicação
 
Rails vu d'un Javaiste
Rails vu d'un JavaisteRails vu d'un Javaiste
Rails vu d'un Javaiste
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)
 
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatGrand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
 
Associations & JavaScript
Associations & JavaScriptAssociations & JavaScript
Associations & JavaScript
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Cucumber

Editor's Notes

  1. (possibly even javascript or flash) (to later be interpreted into ruby)
  2. Scenario is made up of many steps, defined with regex
  3. Scenario is made up of many steps, defined with regex
  4. Cucumber provides prewritten steps (webrat.steps)
  5. translate plain english into a resource path (URL) with regex
  6. Steps that will be run for all scenarios in a feature