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


                                 RUBY UG
                                  NOV 2010


Amir Barylko - Capybara                      MavenThought Inc.
Thursday, November 25, 2010
WHO AM I?

    • Architect

    • Developer

    • Mentor

    • Great            cook

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


Amir Barylko - Capybara                                            MavenThought Inc.
Thursday, November 25, 2010
BDD




Amir Barylko - Capybara             MavenThought Inc.
Thursday, November 25, 2010
WHY TRADITIONAL
                               PROJECTS FAIL?

    • Delivering               late or over budget

    • Delivering               the wrong thing

    • Unstable                in production

    • Costly             to maintain


Amir Barylko - Capybara                              MavenThought Inc.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
OUTSIDE IN APPROACH




Amir Barylko - Capybara              MavenThought Inc.
Thursday, November 25, 2010
GHERKIN DSL

    • Business                readable DSL

    • Flush          out requirements

    • Documentation

    • Automated                 testing

    • Used   by Cucumber,
        SpecFlow, jBehave

Amir Barylko - BDD                                MavenThought Inc.
Thursday, November 25, 2010
CUCUMBER




Amir Barylko - Capybara                  MavenThought Inc.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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,"totalPages" =>
    1,"totalItems" => 1, "items" => projects})

      FakeWeb.register_uri(:get, "http://agilezen.com/api/v1/projects", :body =>
    fake_response)
      FakeWeb.register_uri(:get, "http://agilezen.com/api/v1/project/4444", :body =>
    JSON.generate(projects[0]))
    end


Amir Barylko - Capybara                                                       MavenThought Inc.
Thursday, November 25, 2010
CAPYBARA




Amir Barylko - Capybara                  MavenThought Inc.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
MATCHERS

    • has_selector?

    • has_no_selector?

    • has_content?

    • has_no_content




Amir Barylko - Capybara                  MavenThought Inc.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010
QUESTIONS?




Amir Barylko - Capybara                    MavenThought Inc.
Thursday, November 25, 2010
RESOURCES

    • Contact                 me: amir@barylko.com, @abarylko

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




Amir Barylko - Capybara                                         MavenThought Inc.
Thursday, November 25, 2010
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.
Thursday, November 25, 2010

Weitere ähnliche Inhalte

Ähnlich wie Capybara1

Page objects pattern
Page objects patternPage objects pattern
Page objects patternAmir Barylko
 
DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-CapybaraAmir Barylko
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-worldAmir Barylko
 
SDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-drivenSDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-drivenAmir Barylko
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenAmir Barylko
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planningAmir 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
 
Open source libraries and tools
Open source libraries and toolsOpen source libraries and tools
Open source libraries and toolsAmir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir Barylko
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsAmir Barylko
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patternsAmir Barylko
 
Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptanceAmir 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
 
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-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregatorAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir 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
 

Ähnlich wie Capybara1 (20)

Page objects pattern
Page objects patternPage objects pattern
Page objects pattern
 
DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-Capybara
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
 
SDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-drivenSDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-driven
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-driven
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planning
 
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
 
Open source libraries and tools
Open source libraries and toolsOpen source libraries and tools
Open source libraries and tools
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
Agile planning
Agile planningAgile planning
Agile planning
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patterns
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patterns
 
Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptance
 
2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patterns
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregator
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Nuget
NugetNuget
Nuget
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven
 

Mehr von Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir 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
 
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 requirements
Agile requirementsAgile requirements
Agile requirementsAmir 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
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecsAmir Barylko
 

Mehr von Amir Barylko (19)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
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 requirements
Agile requirementsAgile requirements
Agile requirements
 
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
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
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
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecs
 

Kürzlich hochgeladen

KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 

Kürzlich hochgeladen (20)

KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 

Capybara1

  • 1. AMIR BARYLKO INTRO TO CAPYBARA RUBY UG NOV 2010 Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 2. WHO AM I? • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 3. BDD Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 6. OUTSIDE IN APPROACH Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 7. GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehave Amir Barylko - BDD MavenThought Inc. Thursday, November 25, 2010
  • 8. CUCUMBER Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 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,"totalPages" => 1,"totalItems" => 1, "items" => projects}) FakeWeb.register_uri(:get, "http://agilezen.com/api/v1/projects", :body => fake_response) FakeWeb.register_uri(:get, "http://agilezen.com/api/v1/project/4444", :body => JSON.generate(projects[0])) end Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 11. CAPYBARA Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 14. 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. Thursday, November 25, 2010
  • 15. 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. Thursday, November 25, 2010
  • 16. MATCHERS • has_selector? • has_no_selector? • has_content? • has_no_content Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010
  • 18. 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. Thursday, November 25, 2010
  • 19. 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. Thursday, November 25, 2010
  • 20. 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. Thursday, November 25, 2010
  • 21. QUESTIONS? Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 22. RESOURCES • Contact me: amir@barylko.com, @abarylko • Materials: http://www.orthocoders.com/presentations Amir Barylko - Capybara MavenThought Inc. Thursday, November 25, 2010
  • 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. Thursday, November 25, 2010