SlideShare ist ein Scribd-Unternehmen logo
1 von 22
by IntekhabSadekin CUCUMBER –Making BDD Fun
Question: One of main constituents of a salad? Answer: SURE!!! But that’s not what we are here for!!! What is Cucumber?
Behavior Driven Development and testing tool Bunch of behaviors in the form of scenarios Written mainly by non-technical people Written in plain english What is Cucumber actually?
Write a behavior in the form of scenario in a feature file Write the code in order to satisfy the scenario(the actual application and not the automation script) Run the feature file Watch it fail Write the automation script with the template provided by cucumber The behavior of the application is satisfied by the test script What should you actually do?
I am sorry but I am not going to discuss the merits and demerits of BDD Behavior Driven Development?
Project root/ Features fileName1.feature fileName2.feature Support Env.rb Step_definitions fileName1.rb fileName2.rb Directory structure
Feature: Title As a [role] I want [feature] So that [benefit] Scenario: Title Given [context] When [event] And [more event] Then [outcome] And [another outcome] Lets get straight to it!!!
What the @#$% !!!
Feature: Login As an admin I want be able to login with my credentials So that I get to the home page Scenario: Able to successfully login Given that I am on page “http://www.blahblah.com” When I provide my username “admin” And I provide my password “admin” Then I should be at “HomePage” Example
Develop the application driven by the behavior described earlier in the feature file Develop!!!
$ cucumber login.feature RUN the damn thing….
Run and watch it fail…
A template provided in order to write the automation script
      Given /^I am on "([^amp;quot;]*)"$/ do |url| pending end When /^I enter username "([^amp;quot;]*)"$/ do |userName| pending end When /^I enter password "([^amp;quot;]*)"$/ do |password|    pending end When /^I click the button with name "([^amp;quot;]*)"$/ do |buttonValue|   pending end Then /^I should be at "([^amp;quot;]*)"$/ do |url|  pending end What should I do?
They are called step definitions Essentially bunch of ruby code A library called Watir is used for the API What was that?
Run it again…. What next….
Watch it fail again…
Given /^I am on "([^amp;quot;]*)"$/ do |url| @browser.goto(url) end When /^I enter username "([^amp;quot;]*)"$/ do |userName|    pending end When /^I enter password "([^amp;quot;]*)"$/ do |password|    pending end When /^I click the button with name "([^amp;quot;]*)"$/ do |buttonValue|   pending end Then /^I should be at "([^amp;quot;]*)"$/ do |url|  pending end Make the necessary changes
Go back to step definitions and write the script in order to satisfy the behavior
Keep on running the feature file until all of them turns green like a Cucumber
? Thank You!!!

Weitere ähnliche Inhalte

Was ist angesagt?

A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberTechWell
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberAsheesh Mehdiratta
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsLeticia Rss
 
RSpec User Stories
RSpec User StoriesRSpec User Stories
RSpec User Storiesrahoulb
 
Geb for testing your grails application
Geb for testing your grails applicationGeb for testing your grails application
Geb for testing your grails applicationJacobAae
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...Paul Jensen
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerPaul Jensen
 
Introduction to React Native & Redux
Introduction to React Native & ReduxIntroduction to React Native & Redux
Introduction to React Native & ReduxBarak Cohen
 
Ryan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodRyan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodFITC
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Mindfire Solutions
 
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsSteve Malsam
 
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django SiteTeaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django SiteShawn Rider
 
I18n
I18nI18n
I18nsoon
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingDougal Campbell
 
Modern Functional Fluent ColdFusion REST Apis
Modern Functional Fluent ColdFusion REST ApisModern Functional Fluent ColdFusion REST Apis
Modern Functional Fluent ColdFusion REST ApisOrtus Solutions, Corp
 

Was ist angesagt? (20)

Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
BDD with cucumber
BDD with cucumberBDD with cucumber
BDD with cucumber
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using Cucumber
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
RSpec User Stories
RSpec User StoriesRSpec User Stories
RSpec User Stories
 
Geb for testing your grails application
Geb for testing your grails applicationGeb for testing your grails application
Geb for testing your grails application
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
 
Introduction to React Native & Redux
Introduction to React Native & ReduxIntroduction to React Native & Redux
Introduction to React Native & Redux
 
Ryan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodRyan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was Good
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)
 
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot Overlords
 
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django SiteTeaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
 
I18n
I18nI18n
I18n
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
 
Calabash for iPhone apps
Calabash for iPhone appsCalabash for iPhone apps
Calabash for iPhone apps
 
Modern Functional Fluent ColdFusion REST Apis
Modern Functional Fluent ColdFusion REST ApisModern Functional Fluent ColdFusion REST Apis
Modern Functional Fluent ColdFusion REST Apis
 

Ähnlich wie CUCUMBER - Making BDD Fun

Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /CapybaraShraddhaSF
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Updimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011dimakovalenko
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven DevelopmentAndy Kelk
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Jean-Loup Yu
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsEugene Andruszczenko
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryRefresh Events
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 
Cucumber: How I Slice It
Cucumber: How I Slice ItCucumber: How I Slice It
Cucumber: How I Slice Itlinoj
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliRebecca Eloise Hogg
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)aasarava
 
Using Ruby in Android Development
Using Ruby in Android DevelopmentUsing Ruby in Android Development
Using Ruby in Android DevelopmentAdam Blum
 

Ähnlich wie CUCUMBER - Making BDD Fun (20)

Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /Capybara
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Cucumber: How I Slice It
Cucumber: How I Slice ItCucumber: How I Slice It
Cucumber: How I Slice It
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
 
Using Ruby in Android Development
Using Ruby in Android DevelopmentUsing Ruby in Android Development
Using Ruby in Android Development
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 

Mehr von SQABD

Hasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery PluginHasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery PluginSQABD
 
Shoeb: Implementation Challenges of a Paperless Admission System
Shoeb: Implementation Challenges of a Paperless Admission SystemShoeb: Implementation Challenges of a Paperless Admission System
Shoeb: Implementation Challenges of a Paperless Admission SystemSQABD
 
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...SQABD
 
Zahidul: Meta Testing
Zahidul: Meta TestingZahidul: Meta Testing
Zahidul: Meta TestingSQABD
 
Rabbi: Good to Great
Rabbi: Good to GreatRabbi: Good to Great
Rabbi: Good to GreatSQABD
 
Imrul: Context Driven Testing
Imrul: Context Driven TestingImrul: Context Driven Testing
Imrul: Context Driven TestingSQABD
 
Tauhid: SQL Server Database Change Automation
Tauhid: SQL Server Database Change AutomationTauhid: SQL Server Database Change Automation
Tauhid: SQL Server Database Change AutomationSQABD
 
Ayman: When to stop testing?
Ayman: When to stop testing?Ayman: When to stop testing?
Ayman: When to stop testing?SQABD
 
Mozammel: Solo Scrum - The Pomodoro Technique
Mozammel: Solo Scrum - The Pomodoro TechniqueMozammel: Solo Scrum - The Pomodoro Technique
Mozammel: Solo Scrum - The Pomodoro TechniqueSQABD
 
Hasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate codeHasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate codeSQABD
 
Kabir Ahmed: AutoHotkey
Kabir Ahmed: AutoHotkeyKabir Ahmed: AutoHotkey
Kabir Ahmed: AutoHotkeySQABD
 
Mozammel Haque: Git -- Stupid, Fast, distributed content tracker
Mozammel Haque: Git -- Stupid, Fast, distributed content trackerMozammel Haque: Git -- Stupid, Fast, distributed content tracker
Mozammel Haque: Git -- Stupid, Fast, distributed content trackerSQABD
 
M. Ayman Noor: SQA Empowerment
M. Ayman Noor: SQA EmpowermentM. Ayman Noor: SQA Empowerment
M. Ayman Noor: SQA EmpowermentSQABD
 
Shimul: Testing Mnemonics
Shimul: Testing MnemonicsShimul: Testing Mnemonics
Shimul: Testing MnemonicsSQABD
 
Tanvir Afzal: Selenium
Tanvir Afzal: SeleniumTanvir Afzal: Selenium
Tanvir Afzal: SeleniumSQABD
 
Jan Friis Nielson: Bideshi Experience
Jan Friis Nielson: Bideshi ExperienceJan Friis Nielson: Bideshi Experience
Jan Friis Nielson: Bideshi ExperienceSQABD
 
Hasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itHasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itSQABD
 
Mozammel Haque: Scrum
Mozammel Haque: ScrumMozammel Haque: Scrum
Mozammel Haque: ScrumSQABD
 
Innovation Stories of Test Toolsmiths
Innovation Stories of Test ToolsmithsInnovation Stories of Test Toolsmiths
Innovation Stories of Test ToolsmithsSQABD
 
Code Review In Testing View
Code Review In Testing ViewCode Review In Testing View
Code Review In Testing ViewSQABD
 

Mehr von SQABD (20)

Hasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery PluginHasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery Plugin
 
Shoeb: Implementation Challenges of a Paperless Admission System
Shoeb: Implementation Challenges of a Paperless Admission SystemShoeb: Implementation Challenges of a Paperless Admission System
Shoeb: Implementation Challenges of a Paperless Admission System
 
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...
Aman: Developing a lightweight, hi-performance and dynamic JSON api server wi...
 
Zahidul: Meta Testing
Zahidul: Meta TestingZahidul: Meta Testing
Zahidul: Meta Testing
 
Rabbi: Good to Great
Rabbi: Good to GreatRabbi: Good to Great
Rabbi: Good to Great
 
Imrul: Context Driven Testing
Imrul: Context Driven TestingImrul: Context Driven Testing
Imrul: Context Driven Testing
 
Tauhid: SQL Server Database Change Automation
Tauhid: SQL Server Database Change AutomationTauhid: SQL Server Database Change Automation
Tauhid: SQL Server Database Change Automation
 
Ayman: When to stop testing?
Ayman: When to stop testing?Ayman: When to stop testing?
Ayman: When to stop testing?
 
Mozammel: Solo Scrum - The Pomodoro Technique
Mozammel: Solo Scrum - The Pomodoro TechniqueMozammel: Solo Scrum - The Pomodoro Technique
Mozammel: Solo Scrum - The Pomodoro Technique
 
Hasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate codeHasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate code
 
Kabir Ahmed: AutoHotkey
Kabir Ahmed: AutoHotkeyKabir Ahmed: AutoHotkey
Kabir Ahmed: AutoHotkey
 
Mozammel Haque: Git -- Stupid, Fast, distributed content tracker
Mozammel Haque: Git -- Stupid, Fast, distributed content trackerMozammel Haque: Git -- Stupid, Fast, distributed content tracker
Mozammel Haque: Git -- Stupid, Fast, distributed content tracker
 
M. Ayman Noor: SQA Empowerment
M. Ayman Noor: SQA EmpowermentM. Ayman Noor: SQA Empowerment
M. Ayman Noor: SQA Empowerment
 
Shimul: Testing Mnemonics
Shimul: Testing MnemonicsShimul: Testing Mnemonics
Shimul: Testing Mnemonics
 
Tanvir Afzal: Selenium
Tanvir Afzal: SeleniumTanvir Afzal: Selenium
Tanvir Afzal: Selenium
 
Jan Friis Nielson: Bideshi Experience
Jan Friis Nielson: Bideshi ExperienceJan Friis Nielson: Bideshi Experience
Jan Friis Nielson: Bideshi Experience
 
Hasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itHasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of it
 
Mozammel Haque: Scrum
Mozammel Haque: ScrumMozammel Haque: Scrum
Mozammel Haque: Scrum
 
Innovation Stories of Test Toolsmiths
Innovation Stories of Test ToolsmithsInnovation Stories of Test Toolsmiths
Innovation Stories of Test Toolsmiths
 
Code Review In Testing View
Code Review In Testing ViewCode Review In Testing View
Code Review In Testing View
 

Kürzlich hochgeladen

Call Girls Dubai O525547819 Favor Dubai Call Girls Agency
Call Girls Dubai O525547819 Favor Dubai Call Girls AgencyCall Girls Dubai O525547819 Favor Dubai Call Girls Agency
Call Girls Dubai O525547819 Favor Dubai Call Girls Agencykojalkojal131
 
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...JeylaisaManabat1
 
ingrediendts needed in preparing dessert and sweet sauces
ingrediendts needed in preparing dessert and sweet saucesingrediendts needed in preparing dessert and sweet sauces
ingrediendts needed in preparing dessert and sweet saucesJessicaEscao
 
Spiritual Life Quote from Shiva Negi
Spiritual Life Quote from Shiva Negi Spiritual Life Quote from Shiva Negi
Spiritual Life Quote from Shiva Negi OneDay18
 
The 5 sec rule - Mel Robins (Hindi Summary)
The 5 sec rule - Mel Robins (Hindi Summary)The 5 sec rule - Mel Robins (Hindi Summary)
The 5 sec rule - Mel Robins (Hindi Summary)Shakti Savarn
 
Benefits of Co working & Shared office space in India
Benefits of Co working & Shared office space in IndiaBenefits of Co working & Shared office space in India
Benefits of Co working & Shared office space in IndiaBrantfordIndia
 
integrity in personal relationship (1).pdf
integrity in personal relationship (1).pdfintegrity in personal relationship (1).pdf
integrity in personal relationship (1).pdfAmitRout25
 
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?Mikko Kangassalo
 
English basic for beginners Future tenses .pdf
English basic for beginners Future tenses .pdfEnglish basic for beginners Future tenses .pdf
English basic for beginners Future tenses .pdfbromerom1
 

Kürzlich hochgeladen (9)

Call Girls Dubai O525547819 Favor Dubai Call Girls Agency
Call Girls Dubai O525547819 Favor Dubai Call Girls AgencyCall Girls Dubai O525547819 Favor Dubai Call Girls Agency
Call Girls Dubai O525547819 Favor Dubai Call Girls Agency
 
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
 
ingrediendts needed in preparing dessert and sweet sauces
ingrediendts needed in preparing dessert and sweet saucesingrediendts needed in preparing dessert and sweet sauces
ingrediendts needed in preparing dessert and sweet sauces
 
Spiritual Life Quote from Shiva Negi
Spiritual Life Quote from Shiva Negi Spiritual Life Quote from Shiva Negi
Spiritual Life Quote from Shiva Negi
 
The 5 sec rule - Mel Robins (Hindi Summary)
The 5 sec rule - Mel Robins (Hindi Summary)The 5 sec rule - Mel Robins (Hindi Summary)
The 5 sec rule - Mel Robins (Hindi Summary)
 
Benefits of Co working & Shared office space in India
Benefits of Co working & Shared office space in IndiaBenefits of Co working & Shared office space in India
Benefits of Co working & Shared office space in India
 
integrity in personal relationship (1).pdf
integrity in personal relationship (1).pdfintegrity in personal relationship (1).pdf
integrity in personal relationship (1).pdf
 
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?
Virtue ethics & Effective Altruism: What can EA learn from virtue ethics?
 
English basic for beginners Future tenses .pdf
English basic for beginners Future tenses .pdfEnglish basic for beginners Future tenses .pdf
English basic for beginners Future tenses .pdf
 

CUCUMBER - Making BDD Fun

  • 1. by IntekhabSadekin CUCUMBER –Making BDD Fun
  • 2. Question: One of main constituents of a salad? Answer: SURE!!! But that’s not what we are here for!!! What is Cucumber?
  • 3. Behavior Driven Development and testing tool Bunch of behaviors in the form of scenarios Written mainly by non-technical people Written in plain english What is Cucumber actually?
  • 4. Write a behavior in the form of scenario in a feature file Write the code in order to satisfy the scenario(the actual application and not the automation script) Run the feature file Watch it fail Write the automation script with the template provided by cucumber The behavior of the application is satisfied by the test script What should you actually do?
  • 5. I am sorry but I am not going to discuss the merits and demerits of BDD Behavior Driven Development?
  • 6. Project root/ Features fileName1.feature fileName2.feature Support Env.rb Step_definitions fileName1.rb fileName2.rb Directory structure
  • 7. Feature: Title As a [role] I want [feature] So that [benefit] Scenario: Title Given [context] When [event] And [more event] Then [outcome] And [another outcome] Lets get straight to it!!!
  • 9. Feature: Login As an admin I want be able to login with my credentials So that I get to the home page Scenario: Able to successfully login Given that I am on page “http://www.blahblah.com” When I provide my username “admin” And I provide my password “admin” Then I should be at “HomePage” Example
  • 10. Develop the application driven by the behavior described earlier in the feature file Develop!!!
  • 11. $ cucumber login.feature RUN the damn thing….
  • 12. Run and watch it fail…
  • 13. A template provided in order to write the automation script
  • 14. Given /^I am on "([^amp;quot;]*)"$/ do |url| pending end When /^I enter username "([^amp;quot;]*)"$/ do |userName| pending end When /^I enter password "([^amp;quot;]*)"$/ do |password| pending end When /^I click the button with name "([^amp;quot;]*)"$/ do |buttonValue| pending end Then /^I should be at "([^amp;quot;]*)"$/ do |url| pending end What should I do?
  • 15. They are called step definitions Essentially bunch of ruby code A library called Watir is used for the API What was that?
  • 16. Run it again…. What next….
  • 17. Watch it fail again…
  • 18. Given /^I am on "([^amp;quot;]*)"$/ do |url| @browser.goto(url) end When /^I enter username "([^amp;quot;]*)"$/ do |userName| pending end When /^I enter password "([^amp;quot;]*)"$/ do |password| pending end When /^I click the button with name "([^amp;quot;]*)"$/ do |buttonValue| pending end Then /^I should be at "([^amp;quot;]*)"$/ do |url| pending end Make the necessary changes
  • 19. Go back to step definitions and write the script in order to satisfy the behavior
  • 20. Keep on running the feature file until all of them turns green like a Cucumber
  • 21.