SlideShare a Scribd company logo
 
Dima Kovalenko @dimacus www.agilesoftwaretesting.com www.dimakovalenko.com linked in.com/in/dimakovalen ko
Past Experience
Disclaimer > Dima.kind_of?(Developer) => false
Why automated tests?
Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
We don’t need Automated Tests!
We don’t need Automated Tests! The End See You all at Selenium 2012!
 
Selenium and Cucumber Img Source: http://pickledillies.homestead.com/
Overview Set the stage Introduce Cucumber Good features Bad features ??? Profit!
Assumptions Startup or small business Understaffed Inadequate test coverage Need to defend existence of having automated tests to business.
The Stage
The Stage First casualty of an agile development environment is documentation.   - me
The Stage First casualty of an agile development environment is documentation.   - me No written test cases to speak of
The Stage First casualty of an agile development environment is documentation.   - me No written test cases to speak of Need to deliver features, NOW!!!
The Stage First casualty of an agile development environment is documentation.   - me No written test cases to speak of Need to deliver features, NOW!!! Groupon: Weekly deployments
The Stage First casualty of an agile development environment is documentation.   - me No written test cases to speak of Need to deliver features, NOW!!! Groupon: Weekly deployments IMVU: Up to 50 deploys a day http://timothyfitz.wordpress.com/2009/02/10/continuous-deployment-at-imvu-doing-the-impossible-fifty-times-a-day/
Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
Cucumber
Cucumber A BDD framework to help with TDD and other TLAs
Cucumber A BDD framework to help with TDD and other TLAs It’s Agile, Promotes Synergy, Enterprise, will shift Paradigms and completely Web 2.0
Cucumber A BDD framework to help with TDD and other TLAs It’s Agile, Promotes Synergy, Enterprise, will shift Paradigms and completely Web 2.0  You too can be BUZZ WORD compliant!
Img Source: http://www.themoreyouknow.com/
Natural Language @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google Scenario: User Searches for Hello World on Google.com Given  I'm on Google's Home Page And  I search for Hello World Then  I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given  I'm on Bing's Home Page And  I search for Hello World Then  I should see car videos as first result
Step Definitions Given   /^I'm on Google's Home Page$/   do @selenium.open " www.google.com " end Given   /^I'm on Bing's Home Page$/   do @selenium.open " www.bing.com " end When   /^I  search for Hello World$/   do @selenium.type "q", "Hello World" end Then   /^I should see Wikipedia's Hello World article as 1st result$/   do assert_stuff end Then   /^I should see car videos as first result$/   do assert_stuff end
Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
Who should be writing tests?
Who should be writing tests? Developers Unit, Integration, Functional
Who should be writing tests? Developers Unit, Integration, Functional QAs Functional, End-To-End
Who should be writing tests? Developers Unit, Integration, Functional QAs Functional, End-To-End Everyone else At least the feature definitions
Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
Mind Map Solution
Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
Good Features Tags Encourages BDD/TDD Supports multiple test drivers Selenium 1 and Selenium 2 support Multilingual  i18n support Readable test results
Tags @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google @selenium Scenario: User Searches for Hello World on Google.com Given  I'm on Google's Home Page And  I search for Hello World Then  I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given  I'm on Bing's Home Page And  I search for Hello World Then  I should see car videos as first result
Tags @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google @selenium Scenario: User Searches for Hello World on Google.com Given  I'm on Google's Home Page And  I search for Hello World Then  I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given  I'm on Bing's Home Page And  I search for Hello World Then  I should see car videos as first result
Encourages BDD/TDD Write feature description first Run test see it fail Create one step definition at the time Write functionality for the step Run test see it pass
First run
First run
Write Step Definitions
Write More Step Definitions
Even More Step Definitions
Multiple Test Drivers Steam Celerity Culerity FireWatir SafariWatir ChromeWatir Img Source: Wikipedia
Selenium 1 support Before do | scenario | @selenium  =  Selenium::Client::Driver.new ( :host  => "localhost", :port  => 4444, :browser  => “firefox”, :url  => “ www.google.com ”) end
Selenium 1 Tip Use Hpricot Or Nokogiri!!! page =  Hpricot ( @selenium .get_html_source)
 
 
Selenium 2 support
Selenium 2 support Capybara + Selenium = Love
Selenium 2 support Capybara + Selenium = Love Capybara + Selenium + Rails = .......
Capybara Uses Nokogiri Uses XPath outside of browser Works outside of rails
Multilingual JVM: JRuby, Java .NET: IronRuby, IronRuby .NET, Mono Adoby Flex: FunFX, Melomel Python Erlang Groovy Scala Closure Javascript Spring
Java Step Definition package cukes; import cuke4duke.annotation.I18n.EN.Given; import java.util.List; import java.util.ArrayList; public class BellySteps { private List<String> belly = new ArrayList<String>(); @Given(&quot;I have (\\d+) cukes in my belly&quot;) public void bellyCukes(int cukes) { for(int i = 0; i < cukes; i++) { belly.add(&quot;cuke &quot; + i); } } }
i18n
i18n Функционал:  Сложение чисел Чтобы не складывать в уме Все, у кого с этим туго Хотят автоматическое сложение целых чисел Сценарий:  Сложение двух целых чисел Допустим  я ввожу число 50 И  затем ввожу число 70 Если  я нажимаю &quot;+&quot; То  результатом должно быть число 120
i18n Chinese 功能 :  加法 為了避免愚蠢的錯誤 作為一個數學白痴  我希望有人能告訴我兩個數相加的結果 場景大綱 :   將兩個數相加 假 設我已經在計算機上輸入  < 數值 _1> 而 且我已經在計算機上輸入  < 數值 _2> 當 我按下  < 按鈕 > 那 麼螢幕上應該顯示  < 結果 >
i18n LOLz OH HAI:  STUFFING MISHUN:  CUCUMBR I CAN HAZ  IN TEH BEGINNIN 3 CUCUMBRZ WEN  I EAT 2 CUCUMBRZ DEN  I HAS 2 CUCUMBERZ IN MAH BELLY AN  IN TEH END 1 CUCUMBRZ KTHXBAI
Readable Test Results
Bad Features Regex step definitions Hard To find Step Definitions Slower Natural language parser Messy directory structure
Regex Step Definitions Good: Reuse Definitions Bad: Then   /^(?:|I )should see &quot;([^\&quot;]*)&quot;(?: within &quot;([^\&quot;]*)&quot;)?$/   do
Hard to find Step Definitions cucumber-tmbundle Vim Rails
Bad Features Regex step definitions Hard To find Step Definitions Slower Natural language parser Messy directory structure
Conclusion Cucumber is a great tool to Describe Features Document Features Get the whole team involved However, it has downsides also
@dhh RSpec offends me aesthetically with no  discernible benefit for its added complexity over test/unit.
@dhh RSpec offends me aesthetically with no  discernible benefit for its added complexity over test/unit. Cucumber makes no sense to me unless you have clients  reading the tests.  Why would you build a test-specific parser  for English?
@dhh RSpec offends me aesthetically with no  discernible benefit for its added complexity over test/unit. Cucumber makes no sense to me unless you have clients  reading the tests.  Why would you build a test-specific parser  for English? The important thing is of course that we get people testing, so tools shouldn't matter too much....
Work @ Groupon www.groupon.com/techjobs
The End
 

More Related Content

What's hot (20)

PDF
The LAZY Developer's Guide to BDD (with Cucumber)
Tze Yang Ng
 
PPTX
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
PPTX
Bdd – with cucumber and gherkin
Arati Joshi
 
PDF
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Gáspár Nagy
 
PPTX
Cucumber BDD
Pravin Dsilva
 
PDF
Put an end to regression with codeception testing
Joe Ferguson
 
PDF
Capybara testing
Futureworkz
 
PDF
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
PPTX
Writing automation tests with python selenium behave pageobjects
Leticia Rss
 
PDF
Front-end Automated Testing
Ruben Teijeiro
 
PDF
Composer at Scale, Release and Dependency Management
Joe Ferguson
 
PDF
Midwest PHP 2017 DevOps For Small team
Joe Ferguson
 
PDF
QAAgility Presentation - Cucumber with Appium
QAAgility Technologies
 
PPTX
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
PPTX
Cypress workshop for JSFoo 2019
Biswajit Pattanayak
 
PDF
Testing Code.org's Interactive CS Curriculum
Brian Jordan
 
PDF
Behavior Driven Development with Cucumber
Asheesh Mehdiratta
 
PDF
Behavior Driven Development - How To Start with Behat
imoneytech
 
PPT
Testing Any Site With Cucumber and Selenium
Chris Johnson
 
PDF
Selenium and Sauce Labs
hugs
 
The LAZY Developer's Guide to BDD (with Cucumber)
Tze Yang Ng
 
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
Bdd – with cucumber and gherkin
Arati Joshi
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Gáspár Nagy
 
Cucumber BDD
Pravin Dsilva
 
Put an end to regression with codeception testing
Joe Ferguson
 
Capybara testing
Futureworkz
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
Writing automation tests with python selenium behave pageobjects
Leticia Rss
 
Front-end Automated Testing
Ruben Teijeiro
 
Composer at Scale, Release and Dependency Management
Joe Ferguson
 
Midwest PHP 2017 DevOps For Small team
Joe Ferguson
 
QAAgility Presentation - Cucumber with Appium
QAAgility Technologies
 
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
Cypress workshop for JSFoo 2019
Biswajit Pattanayak
 
Testing Code.org's Interactive CS Curriculum
Brian Jordan
 
Behavior Driven Development with Cucumber
Asheesh Mehdiratta
 
Behavior Driven Development - How To Start with Behat
imoneytech
 
Testing Any Site With Cucumber and Selenium
Chris Johnson
 
Selenium and Sauce Labs
hugs
 

Viewers also liked (8)

PPTX
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QAFest
 
PDF
Continuous Security Testing
Steven Mak
 
PDF
QA Fest 2015. Игорь Хрол. Тестировщик в Agile - кто это?
QAFest
 
PPTX
Robot Framework (のSelenium2Libraryのお話)
泰 増田
 
PDF
TDC2016SP - Trilha Embarcados
tdc-globalcode
 
PDF
Robot Framework Dos And Don'ts
Pekka Klärck
 
PDF
Robot Framework Introduction
Pekka Klärck
 
PDF
Mobile automation using selenium cucumber & appium
Selenium Cucumber
 
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QAFest
 
Continuous Security Testing
Steven Mak
 
QA Fest 2015. Игорь Хрол. Тестировщик в Agile - кто это?
QAFest
 
Robot Framework (のSelenium2Libraryのお話)
泰 増田
 
TDC2016SP - Trilha Embarcados
tdc-globalcode
 
Robot Framework Dos And Don'ts
Pekka Klärck
 
Robot Framework Introduction
Pekka Klärck
 
Mobile automation using selenium cucumber & appium
Selenium Cucumber
 
Ad

Similar to Selenium and Cucumber Selenium Conf 2011 (20)

PDF
Behaviour driven infrastructure
Lindsay Holmwood
 
KEY
Graceful Failure with Selenium and Continuous Integration
Chris B. France
 
PPTX
Browser Automated Testing Frameworks - Nightwatch.js
Luís Bastião Silva
 
PPT
Selenium
Adam Goucher
 
PDF
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
PDF
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
PPT
jQuery For Developers Stack Overflow Dev Days Toronto
Ralph Whitbeck
 
PDF
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Edureka!
 
KEY
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
PDF
Cucumber tutorial
HarikaReddy115
 
ODP
Integration Testing in Python
Panoptic Development, Inc.
 
PDF
Introduction to Selenium and Test Automation
Ahmed Mubbashir Khan
 
PPTX
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Rebecca Eloise Hogg
 
PDF
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
ODP
Continuous integration with Git & CI Joe
Shawn Price
 
PPT
Встреча "QA: в каких направлениях может найти себя тестировщик?"
GoIT
 
PPT
Introduction to Selenium
rohitnayak
 
PPTX
Creating testing tools to support development
Chema del Barco
 
PDF
Developing an Ember Test Strategy - EmberConf 2019
Todd Jordan
 
PPT
BCS Selenium Workshop
Colin McDonald
 
Behaviour driven infrastructure
Lindsay Holmwood
 
Graceful Failure with Selenium and Continuous Integration
Chris B. France
 
Browser Automated Testing Frameworks - Nightwatch.js
Luís Bastião Silva
 
Selenium
Adam Goucher
 
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
jQuery For Developers Stack Overflow Dev Days Toronto
Ralph Whitbeck
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Edureka!
 
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
Cucumber tutorial
HarikaReddy115
 
Integration Testing in Python
Panoptic Development, Inc.
 
Introduction to Selenium and Test Automation
Ahmed Mubbashir Khan
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Rebecca Eloise Hogg
 
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
Continuous integration with Git & CI Joe
Shawn Price
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
GoIT
 
Introduction to Selenium
rohitnayak
 
Creating testing tools to support development
Chema del Barco
 
Developing an Ember Test Strategy - EmberConf 2019
Todd Jordan
 
BCS Selenium Workshop
Colin McDonald
 
Ad

More from dimakovalenko (8)

PPTX
Scaling and Managing Selenium Grid
dimakovalenko
 
PPTX
Managing Large Selenium Grid
dimakovalenko
 
PPTX
Selenium Conf 2013 Lightning Talk - Any-Branch
dimakovalenko
 
PPTX
Stabilizing SE Build - Selenium conf 2013
dimakovalenko
 
PPT
Jasmine presentation Selenium Camp 2013
dimakovalenko
 
PDF
Selenium camp v1
dimakovalenko
 
PPT
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
PPT
Evergreen build
dimakovalenko
 
Scaling and Managing Selenium Grid
dimakovalenko
 
Managing Large Selenium Grid
dimakovalenko
 
Selenium Conf 2013 Lightning Talk - Any-Branch
dimakovalenko
 
Stabilizing SE Build - Selenium conf 2013
dimakovalenko
 
Jasmine presentation Selenium Camp 2013
dimakovalenko
 
Selenium camp v1
dimakovalenko
 
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
Evergreen build
dimakovalenko
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 

Selenium and Cucumber Selenium Conf 2011

  • 1.  
  • 2. Dima Kovalenko @dimacus www.agilesoftwaretesting.com www.dimakovalenko.com linked in.com/in/dimakovalen ko
  • 6. Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
  • 7. We don’t need Automated Tests!
  • 8. We don’t need Automated Tests! The End See You all at Selenium 2012!
  • 9.  
  • 10. Selenium and Cucumber Img Source: http://pickledillies.homestead.com/
  • 11. Overview Set the stage Introduce Cucumber Good features Bad features ??? Profit!
  • 12. Assumptions Startup or small business Understaffed Inadequate test coverage Need to defend existence of having automated tests to business.
  • 14. The Stage First casualty of an agile development environment is documentation. - me
  • 15. The Stage First casualty of an agile development environment is documentation. - me No written test cases to speak of
  • 16. The Stage First casualty of an agile development environment is documentation. - me No written test cases to speak of Need to deliver features, NOW!!!
  • 17. The Stage First casualty of an agile development environment is documentation. - me No written test cases to speak of Need to deliver features, NOW!!! Groupon: Weekly deployments
  • 18. The Stage First casualty of an agile development environment is documentation. - me No written test cases to speak of Need to deliver features, NOW!!! Groupon: Weekly deployments IMVU: Up to 50 deploys a day http://timothyfitz.wordpress.com/2009/02/10/continuous-deployment-at-imvu-doing-the-impossible-fifty-times-a-day/
  • 19. Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
  • 21. Cucumber A BDD framework to help with TDD and other TLAs
  • 22. Cucumber A BDD framework to help with TDD and other TLAs It’s Agile, Promotes Synergy, Enterprise, will shift Paradigms and completely Web 2.0
  • 23. Cucumber A BDD framework to help with TDD and other TLAs It’s Agile, Promotes Synergy, Enterprise, will shift Paradigms and completely Web 2.0 You too can be BUZZ WORD compliant!
  • 25. Natural Language @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google Scenario: User Searches for Hello World on Google.com Given I'm on Google's Home Page And I search for Hello World Then I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given I'm on Bing's Home Page And I search for Hello World Then I should see car videos as first result
  • 26. Step Definitions Given /^I'm on Google's Home Page$/ do @selenium.open &quot; www.google.com &quot; end Given /^I'm on Bing's Home Page$/ do @selenium.open &quot; www.bing.com &quot; end When /^I search for Hello World$/ do @selenium.type &quot;q&quot;, &quot;Hello World&quot; end Then /^I should see Wikipedia's Hello World article as 1st result$/ do assert_stuff end Then /^I should see car videos as first result$/ do assert_stuff end
  • 27. Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
  • 28. Who should be writing tests?
  • 29. Who should be writing tests? Developers Unit, Integration, Functional
  • 30. Who should be writing tests? Developers Unit, Integration, Functional QAs Functional, End-To-End
  • 31. Who should be writing tests? Developers Unit, Integration, Functional QAs Functional, End-To-End Everyone else At least the feature definitions
  • 32. Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
  • 34. Why automated tests? Too expensive Too much work to create Not enough staff to maintain Never know the coverage level No one but developers knows what is being tested
  • 35. Good Features Tags Encourages BDD/TDD Supports multiple test drivers Selenium 1 and Selenium 2 support Multilingual i18n support Readable test results
  • 36. Tags @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google @selenium Scenario: User Searches for Hello World on Google.com Given I'm on Google's Home Page And I search for Hello World Then I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given I'm on Bing's Home Page And I search for Hello World Then I should see car videos as first result
  • 37. Tags @search Feature: Searching For Hello World, and some more overview of the feature that we are trying to test @google @selenium Scenario: User Searches for Hello World on Google.com Given I'm on Google's Home Page And I search for Hello World Then I should see Wikipedia's Hello World article as 1st result @bing Scenario: User Searches for Hello World on Bing.com Given I'm on Bing's Home Page And I search for Hello World Then I should see car videos as first result
  • 38. Encourages BDD/TDD Write feature description first Run test see it fail Create one step definition at the time Write functionality for the step Run test see it pass
  • 42. Write More Step Definitions
  • 43. Even More Step Definitions
  • 44. Multiple Test Drivers Steam Celerity Culerity FireWatir SafariWatir ChromeWatir Img Source: Wikipedia
  • 45. Selenium 1 support Before do | scenario | @selenium = Selenium::Client::Driver.new ( :host => &quot;localhost&quot;, :port => 4444, :browser => “firefox”, :url => “ www.google.com ”) end
  • 46. Selenium 1 Tip Use Hpricot Or Nokogiri!!! page = Hpricot ( @selenium .get_html_source)
  • 47.  
  • 48.  
  • 50. Selenium 2 support Capybara + Selenium = Love
  • 51. Selenium 2 support Capybara + Selenium = Love Capybara + Selenium + Rails = .......
  • 52. Capybara Uses Nokogiri Uses XPath outside of browser Works outside of rails
  • 53. Multilingual JVM: JRuby, Java .NET: IronRuby, IronRuby .NET, Mono Adoby Flex: FunFX, Melomel Python Erlang Groovy Scala Closure Javascript Spring
  • 54. Java Step Definition package cukes; import cuke4duke.annotation.I18n.EN.Given; import java.util.List; import java.util.ArrayList; public class BellySteps { private List<String> belly = new ArrayList<String>(); @Given(&quot;I have (\\d+) cukes in my belly&quot;) public void bellyCukes(int cukes) { for(int i = 0; i < cukes; i++) { belly.add(&quot;cuke &quot; + i); } } }
  • 55. i18n
  • 56. i18n Функционал: Сложение чисел Чтобы не складывать в уме Все, у кого с этим туго Хотят автоматическое сложение целых чисел Сценарий: Сложение двух целых чисел Допустим я ввожу число 50 И затем ввожу число 70 Если я нажимаю &quot;+&quot; То результатом должно быть число 120
  • 57. i18n Chinese 功能 : 加法 為了避免愚蠢的錯誤 作為一個數學白痴 我希望有人能告訴我兩個數相加的結果 場景大綱 : 將兩個數相加 假 設我已經在計算機上輸入 < 數值 _1> 而 且我已經在計算機上輸入 < 數值 _2> 當 我按下 < 按鈕 > 那 麼螢幕上應該顯示 < 結果 >
  • 58. i18n LOLz OH HAI: STUFFING MISHUN: CUCUMBR I CAN HAZ IN TEH BEGINNIN 3 CUCUMBRZ WEN I EAT 2 CUCUMBRZ DEN I HAS 2 CUCUMBERZ IN MAH BELLY AN IN TEH END 1 CUCUMBRZ KTHXBAI
  • 60. Bad Features Regex step definitions Hard To find Step Definitions Slower Natural language parser Messy directory structure
  • 61. Regex Step Definitions Good: Reuse Definitions Bad: Then /^(?:|I )should see &quot;([^\&quot;]*)&quot;(?: within &quot;([^\&quot;]*)&quot;)?$/ do
  • 62. Hard to find Step Definitions cucumber-tmbundle Vim Rails
  • 63. Bad Features Regex step definitions Hard To find Step Definitions Slower Natural language parser Messy directory structure
  • 64. Conclusion Cucumber is a great tool to Describe Features Document Features Get the whole team involved However, it has downsides also
  • 65. @dhh RSpec offends me aesthetically with no discernible benefit for its added complexity over test/unit.
  • 66. @dhh RSpec offends me aesthetically with no discernible benefit for its added complexity over test/unit. Cucumber makes no sense to me unless you have clients reading the tests. Why would you build a test-specific parser for English?
  • 67. @dhh RSpec offends me aesthetically with no discernible benefit for its added complexity over test/unit. Cucumber makes no sense to me unless you have clients reading the tests. Why would you build a test-specific parser for English? The important thing is of course that we get people testing, so tools shouldn't matter too much....
  • 68. Work @ Groupon www.groupon.com/techjobs
  • 70.