SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
AMIR BARYLKO
                           INTRO TO
                          CAPYBARA


               EDMONTON RUBY USER GROUP
                              JUNE 2011


Amir Barylko - Capybara                   MavenThought Inc.
WHO AM I?

  • Architect

  • Developer

  • Mentor

  • Great     cook

  • The     one who’s entertaining you for the next hour!


Amir Barylko - Capybara                                     MavenThought Inc.
BDD




Amir Barylko - Capybara         MavenThought Inc.
WHY TRADITIONAL
                    PROJECTS FAIL?

  • Delivering       late or over budget

  • Delivering       the wrong thing

  • Unstable       in production

  • Costly     to maintain


Amir Barylko - Capybara                    MavenThought Inc.
BDD PRINCIPLES

  • Behaviour   Driven development is about implementing an
     application by describing its behaviour from the perspective of
     the stakeholder

     • Enough       is Enough

     • Deliver      stakeholder value

     • It’s   all behaviour


Amir Barylko - Capybara                                   MavenThought Inc.
OUTSIDE IN APPROACH




Amir Barylko - Capybara       MavenThought Inc.
GHERKIN DSL

  • Business      readable DSL

  • Flush    out requirements

  • Documentation

  • Automated             testing

  • Used  by Cucumber,
     SpecFlow, jBehave

Amir Barylko - Capybara                     MavenThought Inc.
CUCUMBER




Amir Barylko - Capybara              MavenThought Inc.
FEATURES
  Feature: Listing projects
    As a user
    I Want to see the list of projects
    So I can choose one to see the details

     Scenario: List all projects
       Given I'm logged in
       And   I have the projects:
               | Caruso    |
               | Pucini    |
               | Mariachi |
       When I go to the projects page
       Then I should see "Caruso"
       And   I should see "Pucini"
       And   I should see "Mariachi"



Amir Barylko - Capybara                      MavenThought Inc.
STEPS
  Given /^I have the projects:$/ do |table|

    projects = table.raw.collect do |project|

        {"id" => 4444,

            "name" => "#{project}",

            "description" => "Project developed in rails",
            "createTime" => "/Date(1256774726000-0500)/",

            "owner" => {"id" => 2222,"name" => "Some user"}}

    end

    fake_response = JSON.generate({"page" => 1,"pageSize" => 10,...})

    FakeWeb.register_uri(:get, "http://agilezen....", :body => fake_response)

    FakeWeb.register_uri(:get, "http://agilezen....", :body => JSON.generate(projects[0]))
  end




Amir Barylko - Capybara                                                     MavenThought Inc.
CAPYBARA




Amir Barylko - Capybara              MavenThought Inc.
WHAT

  • Gem      to simplify integration tests

  • Inspired      by Webrat

  • Can     be used with Cucumber steps or in any other test

  • Easy    to install: gem install capybara




Amir Barylko - Capybara                                  MavenThought Inc.
WHY

  • Support       for different web browsers

  • Provides       driver to run headless (without browser)

  • Can     combine different scenarios with different browsers

  • Supports        Rack and any remote web application

  • Supports        asynchronous calls


Amir Barylko - Capybara                                       MavenThought Inc.
FORMS

  • click_link(...)                  • check(...)

  • click_button(...)                • uncheck(...)

  • click_link_or_button(...)        • attach_file(...)

  • choose(...)                      • select_option(...)

  • fill_in(“FirstName”, :with   =>
     “John”)

Amir Barylko - Capybara                                     MavenThought Inc.
FINDERS

  • all(*args)                              • find_button
     •   page.all(:css, ‘a#user’)
                                            • find_by_id
     •   page.all(:xpath, ‘//[@id=user]’)

  • find     (same args as all)

  • find_field

  • find_link



Amir Barylko - Capybara                                    MavenThought Inc.
MATCHERS

  • has_selector?

  • has_no_selector?

  • has_content?

  • has_no_content




Amir Barylko - Capybara              MavenThought Inc.
STEPS

  • Given      I am on Home

  • When       I go to Projects

  • When       I press “login” within “user”

  • When       I follow “help” within “support”




Amir Barylko - Capybara                           MavenThought Inc.
STEPS II

  • When       I fill “username” with “mel”

  • When       I select “Winnipeg” from “cities”

  • When       I check “remember_me”

  • When       I uncheck “remember_me”

  • When       I choose “Option”

  • When       I attach then file “settings.xml” to “file”
Amir Barylko - Capybara                                    MavenThought Inc.
STEPS III

  • Then      I should see “Welcome”

  • Then      I should not see “Welcome”

  • Then      the field “user” should contain “Mel”

  • Then      show me the page




Amir Barylko - Capybara                              MavenThought Inc.
XPATH

  • Then      I should see “Welcome”

  • Then      I should not see “Welcome”

  • Then      the field “user” should contain “Mel”

  • Then      show me the page




Amir Barylko - Capybara                              MavenThought Inc.
QUESTIONS?




Amir Barylko - Capybara                MavenThought Inc.
RESOURCES

  • Email: amir@barylko.com,

  • Twitter: @abarylko

  • Blog: http://orthocoders.com

  • Materials: http://orthocoders.com/presentations

  • Website: http://maventhought.com



Amir Barylko - Capybara                        MavenThought Inc.
RESOURCES II

  • Capybara: https://github.com/jnicklas/capybara

  • Cucumber: https://github.com/aslakhellesoy/cucumber/wiki

  • Culerity: https://github.com/langalex/culerity

  • Celerity: http://celerity.rubyforge.org

  • Selenium: http://seleniumhq.org



Amir Barylko - Capybara                               MavenThought Inc.

Weitere ähnliche Inhalte

Was ist angesagt?

PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1Amir Barylko
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with AdobeGrace Solivan
 
every-day-automation
every-day-automationevery-day-automation
every-day-automationAmir Barylko
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patternsAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrapAmir Barylko
 
Agile planning
Agile planningAgile planning
Agile planningAmir Barylko
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 

Was ist angesagt? (9)

PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with Adobe
 
every-day-automation
every-day-automationevery-day-automation
every-day-automation
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patterns
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Agile planning
Agile planningAgile planning
Agile planning
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 

Andere mochten auch

Performance testing with loadrunner by kc
Performance testing with loadrunner by kcPerformance testing with loadrunner by kc
Performance testing with loadrunner by kckrishna chaitanya
 
No estimates
No estimatesNo estimates
No estimatesAmir Barylko
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep diveAmir Barylko
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web developmentAmir Barylko
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net CoreAmir Barylko
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance TestingAtul Pant
 

Andere mochten auch (6)

Performance testing with loadrunner by kc
Performance testing with loadrunner by kcPerformance testing with loadrunner by kc
Performance testing with loadrunner by kc
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
 

Ähnlich wie YEG-UG-Capybara

DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-CapybaraAmir Barylko
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-patternAmir Barylko
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptAmir Barylko
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planningAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir Barylko
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregatorAmir Barylko
 
2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resourcesAmir Barylko
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality drivenAmir Barylko
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecsAmir Barylko
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsAmir Barylko
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsAmir Barylko
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patternssdeconf
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patternsAmir Barylko
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 
In App Purchases
In  App  PurchasesIn  App  Purchases
In App PurchasesMugunth Kumar
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublinroland99
 
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Peter Leschev
 

Ähnlich wie YEG-UG-Capybara (20)

DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-Capybara
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-pattern
 
Capybara1
Capybara1Capybara1
Capybara1
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planning
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregator
 
2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecs
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patterns
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patterns
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patterns
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patterns
 
Nuget
NugetNuget
Nuget
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
In App Purchases
In  App  PurchasesIn  App  Purchases
In App Purchases
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
 
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
 

Mehr von Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir Barylko
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting trainingAmir Barylko
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessAmir Barylko
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6Amir Barylko
 
Productive teams
Productive teamsProductive teams
Productive teamsAmir Barylko
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideAmir Barylko
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityAmir Barylko
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilitiesAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
Teams and responsibilities
Teams and responsibilitiesTeams and responsibilities
Teams and responsibilitiesAmir Barylko
 

Mehr von Amir Barylko (17)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescript
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Teams and responsibilities
Teams and responsibilitiesTeams and responsibilities
Teams and responsibilities
 

KĂźrzlich hochgeladen

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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 WorkerThousandEyes
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

KĂźrzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

YEG-UG-Capybara

  • 1. AMIR BARYLKO INTRO TO CAPYBARA EDMONTON RUBY USER GROUP JUNE 2011 Amir Barylko - Capybara MavenThought Inc.
  • 2. WHO AM I? • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - Capybara MavenThought Inc.
  • 3. BDD Amir Barylko - Capybara MavenThought Inc.
  • 4. WHY TRADITIONAL PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintain Amir Barylko - Capybara MavenThought Inc.
  • 5. BDD PRINCIPLES • Behaviour Driven development is about implementing an application by describing its behaviour from the perspective of the stakeholder • Enough is Enough • Deliver stakeholder value • It’s all behaviour Amir Barylko - Capybara MavenThought Inc.
  • 6. OUTSIDE IN APPROACH Amir Barylko - Capybara MavenThought Inc.
  • 7. GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehave Amir Barylko - Capybara MavenThought Inc.
  • 8. CUCUMBER Amir Barylko - Capybara MavenThought Inc.
  • 9. FEATURES Feature: Listing projects As a user I Want to see the list of projects So I can choose one to see the details Scenario: List all projects Given I'm logged in And I have the projects: | Caruso | | Pucini | | Mariachi | When I go to the projects page Then I should see "Caruso" And I should see "Pucini" And I should see "Mariachi" Amir Barylko - Capybara MavenThought Inc.
  • 10. STEPS Given /^I have the projects:$/ do |table| projects = table.raw.collect do |project| {"id" => 4444, "name" => "#{project}", "description" => "Project developed in rails", "createTime" => "/Date(1256774726000-0500)/", "owner" => {"id" => 2222,"name" => "Some user"}} end fake_response = JSON.generate({"page" => 1,"pageSize" => 10,...}) FakeWeb.register_uri(:get, "http://agilezen....", :body => fake_response) FakeWeb.register_uri(:get, "http://agilezen....", :body => JSON.generate(projects[0])) end Amir Barylko - Capybara MavenThought Inc.
  • 11. CAPYBARA Amir Barylko - Capybara MavenThought Inc.
  • 12. WHAT • Gem to simplify integration tests • Inspired by Webrat • Can be used with Cucumber steps or in any other test • Easy to install: gem install capybara Amir Barylko - Capybara MavenThought Inc.
  • 13. WHY • Support for different web browsers • Provides driver to run headless (without browser) • Can combine different scenarios with different browsers • Supports Rack and any remote web application • Supports asynchronous calls Amir Barylko - Capybara MavenThought Inc.
  • 14. FORMS • click_link(...) • check(...) • click_button(...) • uncheck(...) • click_link_or_button(...) • attach_le(...) • choose(...) • select_option(...) • ll_in(“FirstName”, :with => “John”) Amir Barylko - Capybara MavenThought Inc.
  • 15. FINDERS • all(*args) • nd_button • page.all(:css, ‘a#user’) • nd_by_id • page.all(:xpath, ‘//[@id=user]’) • nd (same args as all) • nd_eld • nd_link Amir Barylko - Capybara MavenThought Inc.
  • 16. MATCHERS • has_selector? • has_no_selector? • has_content? • has_no_content Amir Barylko - Capybara MavenThought Inc.
  • 17. STEPS • Given I am on Home • When I go to Projects • When I press “login” within “user” • When I follow “help” within “support” Amir Barylko - Capybara MavenThought Inc.
  • 18. STEPS II • When I ll “username” with “mel” • When I select “Winnipeg” from “cities” • When I check “remember_me” • When I uncheck “remember_me” • When I choose “Option” • When I attach then le “settings.xml” to “file” Amir Barylko - Capybara MavenThought Inc.
  • 19. STEPS III • Then I should see “Welcome” • Then I should not see “Welcome” • Then the eld “user” should contain “Mel” • Then show me the page Amir Barylko - Capybara MavenThought Inc.
  • 20. XPATH • Then I should see “Welcome” • Then I should not see “Welcome” • Then the eld “user” should contain “Mel” • Then show me the page Amir Barylko - Capybara MavenThought Inc.
  • 21. QUESTIONS? Amir Barylko - Capybara MavenThought Inc.
  • 22. RESOURCES • Email: amir@barylko.com, • Twitter: @abarylko • Blog: http://orthocoders.com • Materials: http://orthocoders.com/presentations • Website: http://maventhought.com Amir Barylko - Capybara MavenThought Inc.
  • 23. RESOURCES II • Capybara: https://github.com/jnicklas/capybara • Cucumber: https://github.com/aslakhellesoy/cucumber/wiki • Culerity: https://github.com/langalex/culerity • Celerity: http://celerity.rubyforge.org • Selenium: http://seleniumhq.org Amir Barylko - Capybara MavenThought Inc.